Accounting Ledger MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Accounting Ledger MCP Server Create a new ledger for my company 'TechStart'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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)
Related MCP server: postledger
š¹ Demo Video
Watch the MCP Accounting Ledger Server in action:
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 venvActivate the virtual environment:
source .venv/bin/activateInstall dependencies:
uv sync
Running the Server
Development Mode
To run the server in development mode:
uv run mcp dev server.pyThis 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.pyAfter 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 |
| Test connectivity |
|
| Set up new accounting entity |
|
| Record cash sale transaction |
|
| Record cash purchase transaction |
|
| Create client invoice |
|
| Create supplier bill |
|
| Generate P&L report |
|
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 libraryAdding New Features
Add new tools to
server.pyusing the@mcp.tool()decoratorUpdate the configuration in
config.tomlif neededTest 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
Available Tools
7 toolscreate_ledgerB
Sets up the ledger by:
- Creating the SQLAlchemy engine from configuration.
- Running migrations to create tables.
- Creating a default reporting entity, currency, chart of accounts, and taxes if not present.
Inputs: entity_name (required).
echoA
Echoes the input message back to the user.
Args:
message (str): The message to echo.
Inputs: message (required).
generate_profit_loss_reportA
Generates a Profit & Loss (Income Statement) report in JSON format.
Args:
entity_name: Entity name to generate report for
start_date: Start date for the report (YYYY-MM-DD format, optional)
end_date: End date for the report (YYYY-MM-DD format, optional)
Returns:
JSON string containing the P&L report
Inputs: end_date, start_date, entity_name.
record_cash_purchaseB
Records a cash purchase (expense) transaction.
Args:
narration: Description of the purchase
amount: Purchase amount (excluding tax)
quantity: Quantity of items purchased
tax_code: Tax code to apply (default: GSTIN)
entity_name: Entity name to use
Inputs: amount (required), narration (required), quantity, tax_code, +1 more.
record_cash_saleA
Records a cash sale transaction.
Args:
narration: Description of the sale
amount: Sale amount (excluding tax)
quantity: Quantity of items sold
tax_code: Tax code to apply (default: GSTOUT)
entity_name: Entity name to use
Inputs: amount (required), narration (required), quantity, tax_code, +1 more.
record_client_invoiceA
Records a client invoice (credit sale) transaction.
Args:
narration: Description of the invoice
amount: Invoice amount (excluding tax)
quantity: Quantity of items invoiced
tax_code: Tax code to apply (default: GSTOUT)
entity_name: Entity name to use
Inputs: amount (required), narration (required), quantity, tax_code, +1 more.
record_supplier_billA
Records a supplier bill (credit purchase) transaction.
Args:
narration: Description of the bill
amount: Bill amount (excluding tax)
quantity: Quantity of items billed
tax_code: Tax code to apply (default: GSTIN)
entity_name: Entity name to use
Inputs: amount (required), narration (required), quantity, tax_code, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: setup, reporting, and four specific transaction types. The echo tool is unrelated but not confusing, as it serves a generic utility function.
Most tools follow a consistent verb_noun pattern with snake_case (create_ledger, generate_profit_loss_report, record_*). The exception is 'echo', which is a simple verb, but this is a minor deviation.
Seven tools is well-scoped for an accounting ledger server: one setup tool, four transaction recording tools, one reporting tool, and one utility. Each tool earns its place.
The server covers setup, transaction recording, and reporting, but lacks fundamental operations like listing or retrieving transactions, editing, or deleting records. This creates a gap where agents cannot inspect or manage recorded data directly.
Maintenance
Related MCP Connectors
Headless API-first double-entry accounting & bookkeeping engine. 84 MCP tools over HTTP.
Hosted remote MCP for protected account access, permissions, activity history and supported undo.
Host any HTTP API as MCP tools with a tamper-evident cross-agent settlement ledger.
Read-only MCP server for Point (Tetra M Labs): demo ledger, trial balance, partners.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceDouble-entry accounting ledger MCP server for autonomous agents that enables creating accounts, posting journal entries, and generating financial reports.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for double-entry bookkeeping with idempotent writes, immutable entries, and audit trail. Enables trustworthy financial recording and verification through natural language.31 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to operate a self-hosted financial platform over MCP, managing books, expenses, revenues, settlements, payments, accounts, categories, transfers, positions, and cash flow with idempotent and audited writes.MIT
- AlicenseBqualityCmaintenanceEnables querying and managing a live accounting ledger, including transactions, balances, VAT summaries, deadlines, and documents, from any MCP client.8656 npmMIT