mcp-ledger-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., "@mcp-ledger-serverWhat invoices are pending?"
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.
Księga jako narzędzia — serwer MCP dla agentów AI
Serwer Model Context Protocol, który wystawia system księgowy (kolejkę faktur, kontrolę duplikatów, rejestr VAT, historię kontrahentów i dziennik decyzji) jako narzędzia dla dowolnego agenta AI — Claude Code, inspektora MCP czy skryptu testowego.
Czym jest MCP, po ludzku
MCP to „USB dla agentów": jeden standard wtyczki między modelem a systemami firmy. Zamiast pisać integrację szytą na miarę pod każdą parę „agent ↔ system", system wystawia narzędzia raz — a korzysta z nich każdy klient mówiący protokołem. Ten projekt pokazuje to w praktyce: te same narzędzia księgi obsługują sesję Claude Code i automatyczny harness testowy.
Related MCP server: mcp-business-docs
Narzędzia (7)
Narzędzie | Rola |
| kolejka niezaksięgowanych faktur |
| pełne dane dokumentu (nagłówek, strony, pozycje, sumy) |
| deterministyczna kontrola rachunkowa (grosze, per pozycja) |
| czy numer został już zaksięgowany (duplikaty) |
| dominujący format numeracji i granica kwot odstających |
| status podatnika (mock białej listy) + suma kontrolna NIP |
| decyzja auto/eskalacja z uzasadnieniem w dzienniku audytowym |
Najciekawszy wynik: 9/10 → 10/10 → 40/40
Agent (Claude) przetwarzał 60 faktur z wstrzykniętymi wadami (7 typów — korpus i klucz odpowiedzi wspólne z projektem zespołu agentów n8n):
Partia | Wynik | Co się wydarzyło |
inv_001–010 | 9/10 | agent policzył arytmetykę „w głowie" i pomylił się o 90 zł — przepuścił wadę na inv_008 |
— | — | agent sam zaproponował narzędzie |
inv_011–020 | 10/10 | w tym wada stawki VAT wykryta poglądem na dane (8% i 23% na identycznym towarze) |
inv_021–060 | 40/40 | komplet: duplikaty, zły NIP, niezarejestrowany podatnik, obcy format numeru, kwoty odstające |
Bilans: 59/60 trafnych decyzji, a jedyny błąd pochodzi sprzed narzędzia
i dokładnie z tej klasy, którą narzędzie wyeliminowało. Lekcja projektu:
model ma wnioskować i decydować — liczyć ma narzędzie. Dziennik decyzji
z całego przebiegu: data/ledger-demo-60.db (tabela decisions).
Uruchomienie
npm install
npm run build-ledger # księga SQLite z korpusu (60 faktur + rejestr VAT)
npm test # harness MCP: 16 asercji wg klucza odpowiedziPodłączenie do Claude Code: repo zawiera .mcp.json — wystarczy otworzyć
katalog i zatwierdzić serwer ledger. Serwer przy starcie sam zasila pustą
księgę (stdio, node:sqlite — zero natywnych zależności).
Struktura
src/server.ts # serwer MCP: 7 narzędzi na stdio
src/verify.ts # kontrola rachunkowa (grosze, per pozycja) — wspólna dla MCP i CLI
scripts/build-ledger.ts# budowa księgi z korpusu
scripts/verify-totals.ts# to samo co narzędzie MCP, z linii poleceń
test/harness.ts # skryptowy klient MCP: 16 asercji wg klucza
data/answer_key.json # korpus 60 faktur z kluczem odpowiedzi
data/ledger-demo-60.db # dziennik 60 decyzji agenta z sesji demo (59/60)Available Tools
1 toolvat_registryRejestr VATB
Status kontrahenta w rejestrze podatników VAT (mock białej listy) + kontrola sumy kontrolnej NIP.
| Name | Required | Description | Default |
|---|---|---|---|
| nip | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must fully convey behavioral traits. It only states basic actions (check status, validate checksum) but omits details such as whether the operation is read-only, if it makes any external calls, or any side effects. The term 'mock' suggests it's a simulation, but this is not explicitly explained.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, consisting of a single sentence that efficiently communicates the tool's core functionality. No unnecessary words or verbose phrasing detract from its clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has one parameter and no output schema. While the description covers the operation, it fails to specify the output format or return values, which are essential for a complete understanding. The agent is left guessing what the response contains, making the description incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides no descriptions for the 'nip' parameter (0% coverage). The description adds minimal semantic value by mentioning NIP checksum control, implying the parameter is validated. However, it lacks format details, examples, or constraints that would fully compensate for the schema gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: checking the VAT status of a contractor ('Status kontrahenta w rejestrze podatników VAT') and validating the NIP checksum ('kontrola sumy kontrolnej NIP'). This provides a specific verb and resource, and despite the lack of sibling tools, the purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No usage guidelines are provided. The description does not indicate when to use this tool versus alternatives, nor does it mention prerequisites or exclusions. This leaves the agent without context on appropriate usage scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
vat_registry
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion between tools. The single tool has a clear, distinct purpose.
With a single tool, naming consistency is not an issue. The name 'vat_registry' follows a clear noun form, which is acceptable.
One tool is on the low end for a server, but it serves a narrow, specific purpose (VAT registry check). It is borderline but not extreme given the focused functionality.
The single tool adequately covers the intended domain: checking contractor status in the VAT taxpayer registry and validating NIP checksum. No obvious gaps exist for the stated purpose.
Maintenance
Related MCP Connectors
Host any HTTP API as MCP tools with a tamper-evident cross-agent settlement ledger.
AI-native ERP MCP: ES/EU fiscal compliance (VeriFactu/TicketBAI/Facturae), invoicing, tax, banking
Create, send and track invoices from a conversation in Claude, ChatGPT or any MCP client that supports OAuth. Draft an invoice from one sentence or from last month's invoice for the same client, finalize it, email it to your client and send payment reminders for overdue ones. See revenue by month and by client, download PDFs and e-invoices (ZUGFeRD, XRechnung), and export DATEV packages for your tax advisor. Invoices follow the tax rules of 25 countries, including reverse charge and the small-business VAT exemption. New invoices are drafts, and nothing is emailed until you ask. Pay per invoice with no subscription: the first invoice is free.
15 deterministic validation tools for AI agents: tax IDs (15 countries), VAT, IBAN, LEI, HS codes.
Related MCP Servers
- AlicenseAqualityDmaintenanceAudit infrastructure for AI agents to log consequential decisions (invoice, GL, anomaly) and verify attestations via MCP tools.6MIT
- FlicenseNot gradedqualityCmaintenanceEnables MCP clients to search and inspect an invoice ledger, generate VAT summaries, run OCR on local documents, and use reusable prompts for chasing overdue invoices and reconciling entries.2-
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to query and reconcile electronic invoicing cases across multiple editors using six standardized MCP tools, with synthetic data and conformance checks.MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible agents such as Claude Desktop and Cursor to process invoices, list pending reviews, retrieve case details and risk signals, decide approvals or rejections, access masked vendor master data, and view AP dashboard metrics while resuming paused LangGraph workflows.MIT