mcp-server-ledger
Model Context Protocol server for interacting with Ledger CLI via AI assistants.
Key Features
Use Cases
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 Docker (recommended)
You can also use the Docker image from the minhyeoky/mcp-ledger repository:
docker pull minhyeoky/mcp-ledger
Add this to your claude_desktop_config.json:
"mcp-ledger": {
"command": "docker",
"args": [
"run",
"-v",
"/path/to/your/ledger/file.ledger:/main.ledger",
"-e",
"LEDGER_FILE=/main.ledger",
"-i",
"--rm",
"minhyeoky/mcp-ledger"
]
}
Replace /path/to/your/ledger/file.ledger with the actual path to your ledger file.
Installing via Smithery
To install Ledger CLI MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @minhyeoky/mcp-ledger --client claude
Using uv
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_FILEenvironment 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.
Star History
Repository Owner
User
Repository Details
Programming Languages
Tags
Join Our Newsletter
Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.
Related MCPs
Discover similar Model Context Protocol servers
Bitcoin & Lightning Network MCP Server
Enable AI models to safely interact with Bitcoin and Lightning Network in a standardized way.
The Bitcoin & Lightning Network MCP Server implements the Model Context Protocol, allowing AI models to interface with Bitcoin and Lightning Network functionalities such as key generation, address validation, transaction decoding, blockchain queries, and lightning payments. It provides standardized endpoints for AI model integration, including support for Claude Desktop and Goose. The solution supports querying blockchain data, parsing transactions and invoices, and managing cryptographic operations in a secure and extensible manner.
- ⭐ 65
- MCP
- AbdelStark/bitcoin-mcp
MCP CLI
A powerful CLI for seamless interaction with Model Context Protocol servers and advanced LLMs.
MCP CLI is a modular command-line interface designed for interacting with Model Context Protocol (MCP) servers and managing conversations with large language models. It integrates with the CHUK Tool Processor and CHUK-LLM to provide real-time chat, interactive command shells, and automation capabilities. The system supports a wide array of AI providers and models, advanced tool usage, context management, and performance metrics. Rich output formatting, concurrent tool execution, and flexible configuration make it suitable for both end-users and developers.
- ⭐ 1,755
- MCP
- chrishayuk/mcp-cli
Twelve Data MCP Server
Seamless AI-powered access to financial market data via the Twelve Data API.
Twelve Data MCP Server provides a Model Context Protocol-compliant server for integrating and accessing Twelve Data’s financial market API. It enables users and AI agents to retrieve historical data, real-time quotes, and instrument metadata for stocks, forex, and crypto using natural language or endpoint calls. The system leverages AI-driven routing, including OpenAI GPT-4o, to intelligently map plain English queries to relevant API endpoints for structured or conversational workflows. Integration options are available for platforms like Claude Desktop and VS Code, with flexible local or remote deployment.
- ⭐ 43
- MCP
- twelvedata/mcp
mcp-graphql
Enables LLMs to interact dynamically with GraphQL APIs via Model Context Protocol.
mcp-graphql provides a Model Context Protocol (MCP) server that allows large language models to discover and interact with GraphQL APIs. The implementation facilitates schema introspection, exposes the GraphQL schema as a resource, and enables secure query and mutation execution based on configuration. It supports configuration through environment variables, automated or manual installation options, and offers flexibility in using local or remote schema files. By default, mutation operations are disabled for security, but can be enabled if required.
- ⭐ 319
- MCP
- blurrah/mcp-graphql
mcp-get
A command-line tool for discovering, installing, and managing Model Context Protocol servers.
mcp-get is a CLI tool designed to help users discover, install, and manage Model Context Protocol (MCP) servers. It enables seamless integration of Large Language Models (LLMs) with various external data sources and tools by utilizing a standardized protocol. The tool provides access to a curated registry of MCP servers and supports installation and management across multiple programming languages and environments. Although now archived, mcp-get simplifies environment variable management, package versioning, and server updates to enhance the LLM ecosystem.
- ⭐ 497
- MCP
- michaellatman/mcp-get
@dealx/mcp-server
MCP server enabling LLMs to search and interact with the DealX platform.
Implements the Model Context Protocol, providing a standardized interface for large language models to interact with the DealX platform. Supports searching for ads through structured prompts and is designed for easy integration with tools like Claude and VS Code extensions. Flexible configuration options are available for environment variables, logging, and deployment. Extensible architecture supports future feature additions beyond ad search.
- ⭐ 0
- MCP
- DealExpress/mcp-server
Didn't find tool you were looking for?