Accounting Ledger MCP Server
Provides double-entry accounting ledger creation, transaction recording, and financial reporting capabilities via MCP.
README
Accounting Ledger Model Context Protocol Server
A Model Context Protocol (MCP) server that provides accounting ledger creation, transaction and reporting capabilities using the MCP Python SDK and Python Accounting library.
Overview
This MCP server enables AI assistants to interact with a double-entry accounting system, allowing for:
- Creating accounting entities including the chart of accounts, currencies, and tax codes
- Recording various types of transactions (cash sales, cash purchases, supplier invoices, customer bills)
- Generating financial reports (profit & loss statements)
📹 Demo Video
Watch the MCP Accounting Ledger Server in action:
<video src="https://github.com/user-attachments/assets/dae6e6ad-03cc-40ff-ae30-45d441bd89b2"></video>
This demo shows the complete workflow from setup to creating ledgers, recording transactions, and generating reports using the MCP server with Claude Desktop.
Features
🏢 Entity Management
- Create accounting entities with default configuration (companies/organizations)
💰 Transaction Recording
- Cash Sales: Record immediate revenue transactions
- Cash Purchases: Record immediate expense transactions
- Client Invoices: Create receivable transactions
- Supplier Bills: Create payable transactions
📊 Financial Reporting
- Generate profit & loss statements
- Customizable date ranges for reports
🔧 Built-in Tools
- Echo tool for testing connectivity
- Comprehensive error handling
- SQLite database backend
Installation
This project uses UV for dependency management. Make sure you have UV installed on your system.
Prerequisites
Install uv
Setup
-
Clone the repository: Clone this repository locally and update config.toml with the path to your local project
-
Create the virtual environment:
uv venv -
Activate the virtual environment:
source .venv/bin/activate -
Install dependencies:
uv sync
Running the Server
Development Mode
To run the server in development mode:
uv run mcp dev server.py
This will start the server the MCP Inspector which is a useful tool for testing and debugging the MCP server. To access the MCP Inspector navigate to http://localhost:6274.
Testing in Claude Desktop
After installing Claude Desktop add the MCP server to it by running:
uv run mcp install server.py
After running this command open Claude Desktop. There will most likely be an error with the MCP server. Open Claude Desktop settings, navigate to Developer, select our MCP Server (My Ledger) and click Edit Config. Open the JSON configuration file and update the command and args values as shown (replacing path_to_server with the path to the server on your local machine).
{
"mcpServers": {
"My Ledger": {
"command": "/path_to_server/.venv/bin/python",
"args": [
"/path_to_server/server.py"
]
}
}
}
Now restart Claude Desktop and the MCP server should be working.
Available Tools
| Tool | Description | Parameters |
|---|---|---|
echo |
Test connectivity | message: str |
create_ledger |
Set up new accounting entity | entity_name: str |
record_cash_sale |
Record cash sale transaction | narration: str, amount: float, quantity: int, tax_code: str, entity_name: str |
record_cash_purchase |
Record cash purchase transaction | narration: str, amount: float, quantity: int, tax_code: str, entity_name: str |
record_client_invoice |
Create client invoice | narration: str, amount: float, quantity: int, tax_code: str, entity_name: str |
record_supplier_bill |
Create supplier bill | narration: str, amount: float, quantity: int, tax_code: str, entity_name: str |
generate_profit_loss_report |
Generate P&L report | entity_name: str, start_date: str, end_date: str |
Configuration
The server uses a config.toml file for configuration. Key settings include:
- Database: SQLite database URL
- Account Types: Chart of accounts configuration
- Transaction Types: Available transaction types and prefixes
- Tax Settings: Default tax codes and rates
- Reporting: Report formatting and sections
Database Schema
The system uses the Python Accounting library's database schema, which includes:
- Entities: Companies/organizations
- Currencies: Supported currencies
- Accounts: Chart of accounts with types
- Taxes: Tax codes and rates
- Transactions: Various transaction types
- Line Items: Transaction details
Development
Project Structure
mcpServerDemo/
├── server.py # Main MCP server implementation
├── main.py # Entry point
├── pyproject.toml # UV project configuration
├── config.toml # Accounting system configuration
├── test_accounting.db # SQLite database
└── python_accounting/ # Local Python Accounting library
Adding New Features
- Add new tools to
server.pyusing the@mcp.tool()decorator - Update the configuration in
config.tomlif needed - Test using the MCP Inspector
- Update this README with new tool documentation
Dependencies
- mcp[cli]: Model Context Protocol SDK
- python-dateutil: Date parsing utilities
- sqlalchemy: Database ORM
- strenum: String enumerations
- toml: Configuration file parsing
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。