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 re
Add this skill
npx mdskills install minhyeoky/mcp-server-ledgerComprehensive financial analysis MCP server with well-documented tools for Ledger CLI integration
1[](https://mseep.ai/app/minhyeoky-mcp-server-ledger)23# mcp-server-ledger: A Ledger CLI MCP Server45[](https://smithery.ai/server/@minhyeoky/mcp-ledger)67## Overview89A Model Context Protocol server for interacting with [Ledger CLI](https://www.ledger-cli.org/), 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.1011This 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.1213## Features1415The server provides the following tools that map to Ledger CLI commands:16171. `ledger_balance`18 - Shows account balances with powerful filtering options19 - Inputs: query pattern, date ranges, display options20 - Returns: Formatted balance report21222. `ledger_register`23 - Shows transaction register with detailed history24 - Inputs: query pattern, date ranges, sorting options25 - Returns: Formatted register report26273. `ledger_accounts`28 - Lists all accounts in the ledger file29 - Input: optional query pattern30 - Returns: List of matching accounts31324. `ledger_payees`33 - Lists all payees from transactions34 - Input: optional query pattern35 - Returns: List of matching payees36375. `ledger_commodities`38 - Lists all commodities (currencies) used39 - Input: optional query pattern40 - Returns: List of matching commodities41426. `ledger_print`43 - Prints transactions in ledger format44 - Inputs: query pattern, date ranges45 - Returns: Formatted ledger entries46477. `ledger_stats`48 - Shows statistics about the ledger file49 - Input: optional query pattern50 - Returns: Statistical summary of the ledger51528. `ledger_budget`53 - Shows budget analysis54 - Inputs: query pattern, date ranges, reporting period55 - Returns: Budget report56579. `ledger_raw_command`58 - Runs a raw Ledger CLI command59 - Input: command arguments as a list of strings60 - Returns: Command output as text6162## Prerequisites6364- [Ledger CLI](https://www.ledger-cli.org/) must be installed and available in your PATH65- A valid Ledger file with your financial data6667## Installation6869### Using Docker (recommended)7071You can also use the Docker image from the minhyeoky/mcp-ledger repository:7273```bash74docker pull minhyeoky/mcp-ledger75```7677Add this to your `claude_desktop_config.json`:7879```json80"mcp-ledger": {81 "command": "docker",82 "args": [83 "run",84 "-v",85 "/path/to/your/ledger/file.ledger:/main.ledger",86 "-e",87 "LEDGER_FILE=/main.ledger",88 "-i",89 "--rm",90 "minhyeoky/mcp-ledger"91 ]92}93```9495Replace `/path/to/your/ledger/file.ledger` with the actual path to your ledger file.9697### Installing via Smithery9899To install Ledger CLI MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@minhyeoky/mcp-ledger):100101```bash102npx -y @smithery/cli install @minhyeoky/mcp-ledger --client claude103```104105### Using uv106107The easiest way to install and run this server is with [uv](https://docs.astral.sh/uv/):108109```bash110uv sync111```112## Configuration113114The server requires a path to your Ledger file. This can be provided through:115116- The `LEDGER_FILE` environment variable117- Command-line arguments when starting the server118119### Using with Claude Desktop120121Add this to your `claude_desktop_config.json`:122123```json124"mcpServers": {125 "ledger": {126 "command": "uv",127 "args": [128 "run",129 "--env-file",130 "/path/to/your/.env", // Optional: to set LEDGER_FILE131 "--with",132 "mcp[cli]",133 "mcp",134 "run",135 "<repo_path>/main.py" // Path to the main.py file in this repository136 ]137 }138139}140```141142## Usage Examples143144Once configured, you can ask your AI assistant questions about your financial data:145146- "Show me my expenses for the last month"147- "What's my current balance in all accounts?"148- "List all transactions with Amazon"149- "How much did I spend on groceries in 2023?"150- "Show me my budget performance for Q1"151152The AI will use the appropriate Ledger CLI commands through the server to get the information.153154## Debugging155156For more detailed local testing:157158```bash159mcp dev main.py160```161162## Development163164This server is built using the [Model Context Protocol Python SDK](https://github.com/modelcontextprotocol/python-sdk). For more information about MCP and how to develop MCP servers, see the [official documentation](https://modelcontextprotocol.io).165166To contribute to this project:1671681. Clone the repository1692. Install development dependencies1703. Make your changes1714. Test using the MCP inspector or by integrating with Claude Desktop172173## Security Considerations174175This server runs Ledger CLI commands on your financial data. While it includes basic validation to prevent command injection, you should:176177- Only use with trusted clients178- Be careful about which file paths you expose179- Review all commands before execution180181## License182183This MCP server is licensed under the MIT License. Feel free to use, modify, and distribute it according to the license terms.184
Full transparency — inspect the skill content before installing.