Varlink MCP Bridge
A bridge that exposes Varlink services as MCP (Model Context Protocol) tools for Claude Code.
Quick Start
Install:
nix profile install https://sources.profpatsch.de/Profpatsch.tar.gz#varlink-mcp-bridge
Configure (.mcp.json in your project):
{
"mcpServers": {
"my-service": {
"command": "varlink-mcp-bridge",
"args": [
"--varlink-address=unix:/run/user/1000/my.service.Socket",
"--interface=my.service.Interface"
]
}
}
}
Restart Claude Code to load the MCP server.
Documentation
See man varlink-mcp-bridge for comprehensive documentation including:
- MCP integration patterns
- Type mapping (Varlink IDL → JSON Schema)
- Error handling
- Examples and troubleshooting
- Implementation details
Or view the manpage directly:
man ./varlink-mcp-bridge.1
What It Does
- Connects to your Varlink service
- Introspects the interface definition
- Exposes each method as an MCP tool with auto-generated JSON Schema
- Translates tool calls ↔ Varlink method invocations
- Preserves documentation from Varlink interface comments
Example: A Varlink method GetLastPosition() -> (path: string, line: int) becomes an MCP tool GetLastPosition that Claude can invoke.
Building
With Nix:
nix-build ~/kot/Profpatsch -A users.Profpatsch.varlink-mcp-bridge
With Go:
go build