Give your agent books it can't unbalance.
15 MCP tools for reading and writing a double-entry ledger. The rules live in the server, so your prompt doesn't have to carry them.
Updated
Where agents and money go wrong.
01
Rules in the prompt
Telling a model to keep the books balanced works until the one time it doesn't.
02
Floats in the tool call
A model writes 125.5 as easily as 12550, and a plain table stores whichever it gets.
03
Silent overwrites
An agent that can update rows can erase the mistake it's meant to fix.
Scenarios
What your agent can do with it.
How OpenLedger answers
One post_transaction call with two lines in whole cents. If it balances and the accounts exist, it's saved with its audit row.
How OpenLedger answers
A JSON error naming the line and the rule, so it can fix the call and send it again.
How OpenLedger answers
reverse_transaction with a reason. The original stays, and the reversal flips every line.
What you get.
- Rules you don't have to promptThe server enforces balance, cents and immutability.
- Errors your agent can act onEvery refusal names the rule it broke.
- Reports without extra codeTrial balance, profit and loss and balance sheet are tools.
- Nothing to host but a fileSQLite and one Python process, under Apache 2.0.
Under the hood.
Balanced on write
An entry that doesn't balance is refused, and nothing is written.
Whole cents
Every amount is an integer number of cents.
Reversals, not edits
The original stays beside a reversal and its reason.
Audit log
Every change writes an audit row in the same transaction.
Read-only SQL
run_query accepts SELECT statements only.
Self-hosted
One SQLite file on infrastructure you control.
Questions.
Which agents can use it?
Any MCP client that can start a stdio server or connect over SSE, including Claude Desktop and Claude Code.
Is there a REST API?
Not yet. A REST version of every MCP tool is planned for v0.2.
Can I run it next to my agent in Docker?
Yes. docker compose up --build runs the server over SSE on port 8791, bound to localhost, with the ledger in a named volume.
Let your agents keep the books. Keep the rules on the server.
Run OpenLedger on sample books in minutes, or have Attri deploy it inside your environment with access control and approval rules.