You signed in with another tab or window. Reload
to refresh your session. You signed out in another tab or window. Reload
to refresh your session. You switched accounts on another tab or window. Reload
to refresh your session. Dismiss alert
minhyeoky / mcp-server-ledger Public
A Model Context Protocol server for interacting with Ledger CLI, a powerful double-entry accounting system. This server enables Large Language Models to query and analyze financial data through a standardized interface, making it easy for AI assistants to help with financial reporting, budget analysis, and accounting tasks.
5 stars
0 forks
Branches
Tags
Activity
Notifications
You must be signed in to change notification settings
master
Go to file
Code
| Name | | Name | Last commit message | Last commit date |
| --- | --- | --- | --- |
| Latest commit
-------------
minhyeoky
docs: update README.md
Mar 22, 2025
576c9c4
· Mar 22, 2025
History
-------
3 Commits
| | |
| .gitignore | | .gitignore | feat: implement comprehensive MCP server for ledger-cli | Mar 16, 2025 |
| .python-version | | .python-version | feat: implement comprehensive MCP server for ledger-cli | Mar 16, 2025 |
| README.md | | README.md | docs: update README.md | Mar 22, 2025 |
| main.py | | main.py | feat: implement comprehensive MCP server for ledger-cli | Mar 16, 2025 |
| pyproject.toml | | pyproject.toml | feat: implement comprehensive MCP server for ledger-cli | Mar 16, 2025 |
| uv.lock | | uv.lock | feat: implement comprehensive MCP server for ledger-cli | Mar 16, 2025 |
| View all files | | |
A Model Context Protocol server for interacting with Ledger CLI
, a powerful, double-entry accounting system accessible from the command line. This server allows Large Language Models to query and analyze your financial data through the Ledger CLI tool.
This MCP server exposes Ledger CLI's functionality through a standardized interface, making it easy for AI assistants to help you with financial reporting, budget analysis, and accounting tasks.
The server provides the following tools that map to Ledger CLI commands:
ledger_balance
ledger_register
Shows transaction register with detailed history
ledger_accounts
Lists all accounts in the ledger file
ledger_payees
Lists all payees from transactions
ledger_commodities
Lists all commodities (currencies) used
ledger_print
Prints transactions in ledger format
ledger_stats
Shows statistics about the ledger file
ledger_budget
Shows budget analysis
ledger_raw_command
Runs a raw Ledger CLI command
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:
LEDGER_FILE
environment variableAdd 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\
]
}
}
Once configured, you can ask your AI assistant questions about your financial data:
The AI will use the appropriate Ledger CLI commands through the server to get the information.
For more detailed local testing:
mcp dev main.py
This server is built using the Model Context Protocol Python SDK
. For more information about MCP and how to develop MCP servers, see the official documentation
.
To contribute to this project:
This server runs Ledger CLI commands on your financial data. While it includes basic validation to prevent command injection, you should:
This MCP server is licensed under the MIT License. Feel free to use, modify, and distribute it according to the license terms.
A Model Context Protocol server for interacting with Ledger CLI, a powerful double-entry accounting system. This server enables Large Language Models to query and analyze financial data through a standardized interface, making it easy for AI assistants to help with financial reporting, budget analysis, and accounting tasks.
No releases published
No packages published
You can’t perform that action at this time.