mcp-server-ledger: A Ledger CLI MCP Server
A Model Context Protocol server that allows AI assistants to query and analyze financial data through Ledger CLI, enabling tasks like financial reporting, budget analysis, and accounting.
minhyeoky
README
mcp-server-ledger: A Ledger CLI MCP Server
Overview
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.
Features
The server provides the following tools that map to Ledger CLI commands:
-
ledger_balance
- Shows account balances with powerful filtering options
- Inputs: query pattern, date ranges, display options
- Returns: Formatted balance report
-
ledger_register
- Shows transaction register with detailed history
- Inputs: query pattern, date ranges, sorting options
- Returns: Formatted register report
-
ledger_accounts
- Lists all accounts in the ledger file
- Input: optional query pattern
- Returns: List of matching accounts
-
ledger_payees
- Lists all payees from transactions
- Input: optional query pattern
- Returns: List of matching payees
-
ledger_commodities
- Lists all commodities (currencies) used
- Input: optional query pattern
- Returns: List of matching commodities
-
ledger_print
- Prints transactions in ledger format
- Inputs: query pattern, date ranges
- Returns: Formatted ledger entries
-
ledger_stats
- Shows statistics about the ledger file
- Input: optional query pattern
- Returns: Statistical summary of the ledger
-
ledger_budget
- Shows budget analysis
- Inputs: query pattern, date ranges, reporting period
- Returns: Budget report
-
ledger_raw_command
- Runs a raw Ledger CLI command
- Input: command arguments as a list of strings
- Returns: Command output as text
Prerequisites
- Ledger CLI must be installed and available in your PATH
- A valid Ledger file with your financial data
Installation
Using uv (recommended)
The easiest way to install and run this server is with uv:
uv sync
Configuration
The server requires a path to your Ledger file. This can be provided through:
- The
LEDGER_FILE
environment variable - Command-line arguments when starting the server
Using with Claude Desktop
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
]
}
}
Usage Examples
Once configured, you can ask your AI assistant questions about your financial data:
- "Show me my expenses for the last month"
- "What's my current balance in all accounts?"
- "List all transactions with Amazon"
- "How much did I spend on groceries in 2023?"
- "Show me my budget performance for Q1"
The AI will use the appropriate Ledger CLI commands through the server to get the information.
Debugging
For more detailed local testing:
mcp dev main.py
Development
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:
- Clone the repository
- Install development dependencies
- Make your changes
- Test using the MCP inspector or by integrating with Claude Desktop
Security Considerations
This server runs Ledger CLI commands on your financial data. While it includes basic validation to prevent command injection, you should:
- Only use with trusted clients
- Be careful about which file paths you expose
- Review all commands before execution
License
This MCP server is licensed under the MIT License. Feel free to use, modify, and distribute it according to the license terms.
Recommended Servers
Crypto Price & Market Analysis MCP Server
A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.

chromia-mcp
Enables AI to interact with Chromia Wallet for sending $CHR transactions.
TripleWhale MCP Server
An implementation of Model Context Protocol (MCP) that allows users to interact with TripleWhale's e-commerce analytics platform using natural language queries through Claude Desktop.
Adamik MCP Server
Enables read and write interactions with 60+ blockchain networks through Claude Desktop, providing a standardized multi-chain API for transaction management, account insights, staking, and token interactions.
Open-Ledger-MCP-Server
A Model Context Protocol (MCP) server implementation for the OpenLedger API. This server provides structured context to AI models according to the MCP specification.
ntropy-mcp MCP Server
Enables enriching banking data with the Ntropy API, providing tools to create account holders and enrich transactions efficiently.
Iaptic MCP Server
A server for interacting with the Iaptic API, allowing AI models like Claude to query customer, purchase, and transaction data, as well as retrieve statistical insights.
Bitrefill Search and Shop
This MCP wraps Bitrefill public API to allow agents to search for products and shop using cryptocurrencies like Bitcoin, Ethereum, Solana, and many more.
MCP EVM Signer
A server that securely manages Ethereum private keys locally and enables Claude for Desktop to interact with EVM-compatible blockchains through Infura.
Cryptocurrency Daemon MCP Server
Enables secure interactions with cryptocurrency daemon RPC interfaces through AI assistants, supporting transaction management, wallet operations, and daemon monitoring for Bitcoin-derived cryptocurrencies.