Beancount MCP Server is an experimental implementation that utilizes the Model Context Protocol (MCP) to enable AI assistants to query and analyze Beancount ledger files using Beancount Query Language (BQL) and the beanquery tool.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add beanquery -- uv run mcp install server.py -v 'BEANCOUNT_LEDGER=$(pwd)/sample.bean' --with beancount --with beanquery~/.codex/config.toml
[mcp_servers.beanquery]
command = "uv"
args = ["run", "mcp", "install", "server.py", "-v", "BEANCOUNT_LEDGER=$(pwd)/sample.bean", "--with", "beancount", "--with", "beanquery"]
# codex mcp add beanquery -- uv run mcp install server.py -v 'BEANCOUNT_LEDGER=$(pwd)/sample.bean' --with beancount --with beanquery~/.cursor/mcp.json
{
"mcpServers": {
"beanquery": {
"command": "uv",
"args": [
"run",
"mcp",
"install",
"server.py",
"-v",
"BEANCOUNT_LEDGER=$(pwd)/sample.bean",
"--with",
"beancount",
"--with",
"beanquery"
]
}
}
}.vscode/mcp.json
{
"servers": {
"beanquery": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"mcp",
"install",
"server.py",
"-v",
"BEANCOUNT_LEDGER=$(pwd)/sample.bean",
"--with",
"beancount",
"--with",
"beanquery"
]
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"beanquery": {
"command": "uv",
"args": [
"run",
"mcp",
"install",
"server.py",
"-v",
"BEANCOUNT_LEDGER=$(pwd)/sample.bean",
"--with",
"beancount",
"--with",
"beanquery"
]
}
}
}claude_desktop_config.json
{
"mcpServers": {
"beanquery": {
"command": "uv",
"args": [
"run",
"mcp",
"install",
"server.py",
"-v",
"BEANCOUNT_LEDGER=$(pwd)/sample.bean",
"--with",
"beancount",
"--with",
"beanquery"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"beanquery": {
"command": "uv",
"args": [
"run",
"mcp",
"install",
"server.py",
"-v",
"BEANCOUNT_LEDGER=$(pwd)/sample.bean",
"--with",
"beancount",
"--with",
"beanquery"
]
}
}
}