lastro
Allows importing bank statements from Nubank accounts, parsing them for review and promotion into expenses, revenues, or transfers.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Lastro
Self-hosted, agent-first ledger for personal, family, property, project and
business finances. Each independent financial scope is a Book.
An AI agent operates Lastro over MCP: it sends the files your bank, card and point of sale export, and Lastro turns them into a reviewable ledger. A compact web app is where a person reviews and corrects. PostgreSQL is the source of truth.
The model in one picture
file ──▶ movements ──▶ descriptor ──▶ financial records
(evidence) (decides) expense ≠ payment
revenue ≠ receiptFour records. What is owed (an expense) is not what moved (a payment), and what was earned (a revenue) is not what arrived (a receipt). Settlements link them; status is derived from settlements, never stored.
Evidence first. Every imported line is staged as a movement. Nothing is inferred from its wording: a descriptor per name (or product code) says what its lines are, and once it is classified every past and future line of that name posts on its own.
Revenue from sales, cash from evidence. A point of sale's payments report and an acquirer's sales are the revenue; deposits, Pix credits and the till are the receipts that settle it, so a sale is counted once.
Related MCP server: Payments Agent Gateway (MCP)
Quick start
Requires Bun 1.4+ and Docker.
cp .env.example .env
# set BETTER_AUTH_SECRET — openssl rand -base64 32
docker compose -f docker-compose.release.yml up -d --build
bun install
bun run bootstrap --email you@example.com --password 'a-long-passphrase' \
--book "My business" --delegate agent@lastro.local --role EDITOR \
--agent agent:exampleThat prints an MCP credential once. Then:
Web app — http://localhost:3000
API — http://localhost:3001
MCP (Streamable HTTP) — http://localhost:3002/mcp/core, one endpoint per module
macOS on Apple Silicon can use Apple Container instead of Docker; see docs/operating/install.md.
Connecting an agent
Each module is its own MCP server at /mcp/<module>; connect to the ones the
agent uses, with one credential:
{
"mcpServers": {
"lastro-finance": {
"url": "http://127.0.0.1:3002/mcp/finance",
"headers": { "Authorization": "Bearer <credentialId>.<secret>" }
},
"lastro-finance-imports": {
"url": "http://127.0.0.1:3002/mcp/finance-imports",
"headers": { "Authorization": "Bearer <credentialId>.<secret>" }
}
}
}The others are /mcp/core, /mcp/sales, /mcp/sales-imports and
/mcp/close; GET /mcp lists them. A credential acts as one member of one
Book, with that member's role. Every operation of a module is a tool on its
server. Writes take an idempotencyKey,
destructive tools require confirmation: "confirm", and every write is
audited with the agent and the operator it acts for.
docs/operating/agent.md is the agent's guide: for
each import flow, the tool sequence and what to do when a line waits.
Import flows
Flow | Source file | Type | Becomes |
Nubank checking account CSV |
| expenses and payments, revenues and receipts, transfers | |
C6 checking account CSV |
| the same | |
Stone account statement |
| Pix sent; the day's Pix sales as one receipt | |
Stone payout report |
| expected receipts, paid by the bank line | |
C6 card invoice |
| purchases with their instalments | |
Point of sale payments by method |
| the day's revenue: gross, discount, tip | |
Stone sales export |
| the acquirer's fee | |
Point of sale sales by product |
| the day's sale lines |
The providers are examples: each flow is one parser over a documented format. Adding an import flow is a parser, its fixtures and a flow document.
Architecture
packages/kernel value types, defineOperation, defineModule, the importer registry
packages/host the module list, composition, the single generated init
packages/config validated environment configuration
packages/testing fitness tests, the integration suite, the smoke test
modules/core identity, Books, membership, agent credentials, audit, idempotency
modules/finance catalogs, the four records, transfers, imported evidence
modules/sales products, sale evidence and lines, sales days
modules/finance-imports parsers of bank, card, point-of-sale and acquirer files
modules/sales-imports parsers of point-of-sale sales by product
modules/close the daily close, read from sales and finance
apps/api HTTP adapter, hosts Better Auth
apps/mcp MCP adapter, stdio and Streamable HTTP
apps/web Next.js shell and each module's screensEach business module owns its rules, contracts, use cases, persistence port,
tables, triggers, operations and screens. finance and sales depend only on
core; the import modules and close build on them, and every module but
core can be left out. A parser can be its own package, contributed to an
import module through its manifest. An operation is declared once; the
HTTP routes, MCP tools, web client and proxy allowlist derive from it.
core's write envelope runs every write: authorization from Book
membership, one transaction, idempotent replay and the audit event. Adding a
module edits no other: docs/extending/adding-a-module.md.
More: architecture · data model · domain dictionary · data dictionary · diagrams · decisions · roadmap.
Invariants
Money is a
bigintin the currency's minor unit; JSON carries decimal strings. No floats, anywhere.Every operation is scoped to an authenticated Book, and every reference carries the Book in its key.
Settlements carry their item's sign and never exceed it; payments and receipts are the signed sum of their settlements and never negative. These are database triggers.
Status is derived from active settlements; settlements are voided, never edited.
Every write is idempotent by key and appends an audit event.
Development
docker compose up -d # PostgreSQL 16 on :5432
bun install
DATABASE_URL=postgres://lastro:lastro@localhost:5432/lastro bun run db:init
bun run check # typecheck, lint, unit and fitness tests, builds, scans
bun run test:integration # Docker: real PostgreSQL, both adapters
bun run smoke # Docker: the install path end to endChanging the schema: edit the owning module's src/db/schema.ts or
src/db/triggers.sql, then bun run db:regenerate. There is one init by
design; Lastro ships a database it creates, not one it upgrades.
Contributing
See CONTRIBUTING.md and the code of conduct. Security reports: SECURITY.md.
License
MIT — see LICENSE. UI primitives are copied from shadcn/ui, also MIT; see THIRD_PARTY_NOTICES.md.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Personal finance for AI agents — onboard, import statements, categorize & budget over MCP.
Headless API-first double-entry accounting & bookkeeping engine. 84 MCP tools over HTTP.
Read-only finance MCP server. Connects your banks, cards, payment apps, books and payroll into one ledger for your AI. Can't move money. Open source (AGPL-3.0), free during beta.
Host any HTTP API as MCP tools with a tamper-evident cross-agent settlement ledger.
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
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to safely interact with a double-entry payments ledger, enforcing idempotency, policy-based access control, and human-in-the-loop approval for high-value actions.-
- AlicenseNot gradedqualityCmaintenanceMCP server for double-entry bookkeeping with idempotent writes, immutable entries, and audit trail. Enables trustworthy financial recording and verification through natural language.8 npmMIT
- FlicenseAqualityDmaintenanceEnables AI agents to create accounts, record balanced double-entry transactions, query balances, and reconcile accounts against a SQLite-backed ledger through four MCP tools.4-