This MCP server integrates with Ledger CLI to allow AI assistants to analyze your financial data through a standardized interface. It provides tools for balance reports, transaction history, budget analysis, and more, making it easier to manage your personal or business finances.
The easiest way to install and run this server is with uv:
uv sync
The server requires a path to your Ledger file. This can be provided through:
Add this to your claude_desktop_config.json:
"mcpServers": {
"ledger": {
"command": "uv",
"args": [
"run",
"--env-file",
"/path/to/your/.env", // Optional: to set LEDGER_FILE
"--with",
"mcp[cli]",
"mcp",
"run",
"<repo_path>/main.py" // Path to the main.py file in this repository
]
}
}
The server provides several tools that map directly to Ledger CLI commands:
Shows account balances with powerful filtering options
Shows transaction register with detailed history
Lists all accounts in the ledger file
Lists all payees from transactions
Lists all commodities (currencies) used
Prints transactions in ledger format
Shows statistics about the ledger file
Shows budget analysis
Runs a raw Ledger CLI command
Once configured, you can ask your AI assistant questions about your financial data:
For more detailed local testing:
mcp dev main.py
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.