Skip to content

MCP (Model Context Protocol)

Open Accountant supports Model Context Protocol (MCP) servers, allowing you to extend its capabilities with external tools. MCP is an open standard for connecting AI models to external data sources and tools.

Add MCP servers in ~/.openaccountant/mcp.json:

{
"servers": {
"my-server": {
"command": "npx",
"args": ["-y", "my-mcp-server"],
"env": {}
}
}
}
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
"env": {}
},
"web-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "your-key"
}
}
}
}

For HTTP-based MCP servers, use SSE transport instead of spawning a child process:

{
"servers": {
"local-tools": {
"command": "npx",
"args": ["-y", "my-local-server"]
},
"remote-server": {
"transport": "sse",
"url": "http://localhost:3001/sse"
}
}
}

The transport type is auto-detected: if url is set without command, SSE is used. You can also set "transport": "sse" explicitly.

Verify your MCP connections with --mcp:

Terminal window
wilson --mcp

This connects to all configured servers and lists their names, tool counts, and tool descriptions. Use it to verify servers are reachable before starting interactive mode.

  1. Startup — Open Accountant reads ~/.openaccountant/mcp.json and connects to configured servers (stdio or SSE)
  2. Discovery — Each server advertises its available tools via the MCP protocol
  3. Registration — Discovered tools are added to Open Accountant’s tool registry alongside built-in tools
  4. Execution — When the AI decides to use an MCP tool, Open Accountant routes the call to the appropriate server
  5. Results — Tool results are returned to the AI agent loop like any other tool result

Open Accountant’s MCP implementation consists of three modules:

ModuleFileRole
Configsrc/mcp/config.tsReads and validates mcp.json
Clientsrc/mcp/client.tsManages MCP server lifecycle and communication
Adaptersrc/mcp/adapter.tsConverts MCP tools to Open Accountant’s internal tool format
  • Custom data sources — Connect Open Accountant to proprietary APIs or databases
  • Specialized calculations — Add domain-specific computation tools
  • External services — Integrate with accounting software, banks, or other fintech APIs
  • File access — Give Open Accountant read/write access to specific directories
  • Stdio servers run as child processes on your local machine
  • SSE servers must be reachable over HTTP from the machine running Open Accountant
  • Each server must implement the MCP protocol
  • Server crashes are isolated — other tools continue to work
  • MCP tools are available alongside (not replacing) Open Accountant’s built-in tools