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"
}
}
}
}
  1. Startup — Open Accountant reads ~/.openaccountant/mcp.json and starts configured MCP servers as child processes
  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
  • MCP servers run as child processes on your local machine
  • 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