beanquery
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.
claude mcp add --transport stdio vanto-beanquery-mcp uvx run server.py \ --env BEANCOUNT_LEDGER="path/to/your/ledger.bean (or leave unset to set via environment)"
How to use
Beanquery MCP Server provides a Beancount-focused MCP service that uses Beancount and beanquery to expose financial data and tables via MCP-compatible queries and resources. You can load a Beancount ledger and then run BQL queries against that ledger, discover available tables, and list accounts accessible to BQL. Tools exposed include set_ledger_file for selecting the ledger and run_query to execute BQL queries. This setup enables AI assistants to interact with financial data in a standardized, queryable manner, while also offering a preview of available resources via beanquery://tables and beanquery://accounts.
To use the server, start it with the environment pointing to your ledger or pass it at runtime. Once running, you can interact with the endpoints/tools through your MCP client integration (e.g., Claude Desktop, or an MCP-enabled client). The server is designed for experimentation and development, so expect evolving features and potential changes as feedback is incorporated.
How to install
Prerequisites:
- Python 3.10 or later
- uv (recommended) for managing Python projects
- Install Python dependencies
# If you have a requirements.txt provided by the project
pip install -r requirements.txt
- Prepare your environment
- Create or choose a Beancount ledger file (e.g., sample.bean).
- Optional: set BEANCOUNT_LEDGER to the ledger file path.
export BEANCOUNT_LEDGER=/path/to/your/ledger.bean
- Run the MCP server in development mode
uvx run server.py
- Verify installation
pytest server_test.py
- Optional Claude Desktop integration (as described in the README)
uv run mcp install server.py -v BEANCOUNT_LEDGER=$(pwd)/sample.bean --with beancount --with beanquery
Additional notes
Tips and considerations:
- The server is marked experimental; use in a development environment and provide feedback.
- If you encounter issues loading the ledger, ensure your Beancount file is valid and accessible at the path specified by BEANCOUNT_LEDGER.
- Be mindful of privacy; sensitive financial data may be transmitted when using MCP with external LLM backends. Mask or redact data in test environments.
- The available tools include set_ledger_file to select the ledger and run_query to execute BQL queries. The resources beanquery://tables and beanquery://accounts expose what’s available for querying.
- Environment variables: BEANCOUNT_LEDGER is the primary one; you can also load configurations from a .env file if supported by your setup.
Related MCP Servers
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
mcp-pinecone
Model Context Protocol server to allow for reading and writing from Pinecone. Rudimentary RAG
Gitingest
mcp server for gitingest
blender-open
Open Models MCP for Blender Using Ollama
microsoft_fabric_mcp
MCP server wrapping around the Fabric Rest API
mcp -memos-py
A Python package enabling LLM models to interact with the Memos server via the MCP interface for searching, creating, retrieving, and managing memos.