invoice-match-mcp
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., "@invoice-match-mcp Three-way match invoice INV-1001 against PO-4455 and show any holds."
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.
invoice-match-mcp
A small MCP server that lets an AI model three-way-match supplier invoices (invoice vs purchase order vs goods received) without ever being the one who decides.
The model calls the tools and explains the outcome. The decision comes from a deterministic rule engine, so it is reproducible, testable and auditable. That split is the point of this repo: LLM as interface, rules as policy, evals as proof.
What it exposes
MCP item | Purpose |
| Returns |
| Lets the model look up PO lines, received quantities and agreed prices before it answers. |
resource | The policy in plain language, so the model can quote it. |
Rules: unit price within 2 % of the PO; invoiced quantity not above received quantity; same currency; same supplier plus invoice number twice is a duplicate; no PO number gives REVIEW at best, never APPROVE.
Related MCP server: ledger-mcp
Run it
Requires Python 3.10+ and the MCP Python SDK 2.x.
pip install -e ".[dev]"
python -m invoice_match.server # stdio MCP serverClaude Desktop / any MCP client:
{ "mcpServers": { "invoice-match": { "command": "python", "args": ["-m", "invoice_match.server"] } } }Use your own purchase orders by pointing INVOICE_MATCH_PO_FILE at a CSV with the columns of data/purchase_orders.csv.
Evals
python evals/run_evals.pyevals/golden_cases.json holds 11 invoices with the expected decision (clean match, price drift, over-billing, unknown PO, wrong supplier, currency, ambiguous PO, ...). The same file can grade an LLM agent: give the model each invoice with the server attached and compare its final answer to expect. One source of truth for engine, tools and agent.
pytest covers the engine (including the exact 2 % boundary and purity) and starts the real server over stdio, calling the tool the way a model would.
Why this exists
Built by Paweł Boruta-Ośko, who ran an omnichannel retailer for almost 20 years (ERP, WMS, 50+ integrations) and now builds agentic systems. See also OpenFill, an MCP browser agent. All data in this repo is fictional. Written with substantial help from Claude (Anthropic): the matching rules and scope were specified by the author, the code, tests and evals were drafted by Claude Code and reviewed by him.
MIT licence.
Available Tools
2 toolscheck_invoiceA
Three-way match one invoice against the PO file.
invoice_json: {"invoice_number": str, "supplier": str, "po_number": str|null, "currency": "EUR", "lines": [{"sku": str, "qty": number, "unit_price": number}]} register: if true and the decision is APPROVE, remember the invoice so a resubmission is flagged as a duplicate. Returns status (APPROVE, HOLD_*, REVIEW), reasons and the PO used. It never pays or posts anything.
Inputs: invoice_json (required), register.
list_open_purchase_ordersC
List PO lines for a supplier, with ordered/received quantities and agreed unit price.
Inputs: supplier (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools target clearly different actions on different resources: one reads PO lines for a supplier, the other performs a three-way match on a single invoice. There is no realistic way to confuse them, and the descriptions reinforce the boundary (read-only listing vs. decision-returning validation).
Both names follow a snake_case verb_noun convention (list_..., check_...) that reads naturally and consistently. The only minor deviation is that list_open_purchase_orders stacks multiple qualifiers while check_invoice is terse, but the pattern is still predictable.
Two tools is thin even for a narrowly scoped three-way match server; the whole workflow lives in a single check_invoice call with one supporting lookup. It is functional and focused, but borderline under-provisioned for a stated accounts-payable domain.
The core path (fetch PO lines with ordered/received quantities, then match an invoice) is covered, and the register flag gives basic duplicate handling. However there is no way to look up a previously registered invoice, list invoices for a supplier, inspect prior decisions, or re-check a HOLD after correction, leaving notable gaps in the lifecycle.
Maintenance
Related MCP Connectors
Quote-to-cash tools: parse invoices and POs, match POs to invoices, collection emails, billing math.
Documents 1.4.2: five focused MCP tools. analyze_receipt extracts caller-supplied receipt text or checks supported fields (0.25 USDC). match_invoice allocates invoice quantities against a purchase order, including split lines and remaining quantities (0.50 USDC). reconcile_purchase_documents is the free choice for discrepancies across supplied receipt, invoice and PO fields; missing documents remain needs_review and split links are flagged rather than allocated. Neither comparison requires the other. Consolidated example and status tools are free. Paid calls require buyer-authorized x402 on Base. Human review required; no image OCR, stored-analysis retrieval, delivery certification, payment approval or accounting writes. Service-specific cache and payment-metadata terms are disclosed through status. Runtime utilities: https://agents.getardaro.com/mcp/utilities . Legacy /mcp remains compatible. Guide: https://agents.getardaro.com/document-review
Purchase orders, approvals, accruals and month-end close for finance teams, from your AI assistant.
Receipt extraction, invoice-to-PO quantity allocation, and free three-document discrepancy checks.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables AI assistants to query and manage self-hosted accounting data—invoices, balances, and books—through natural language, with read-only tools by default and optional scoped write operations.3027 PyPI2AGPL 3.0
- AlicenseAqualityCmaintenanceEnables LLM agents to query and reconcile an accounts-payable ledger through safe read-only SQL, deterministic invoice-to-payment matching, and exception explanations for underpayments, duplicates, currency mismatches, and overdue invoices. Ships with a synthetic ledger, golden-set evals, and a month-end review workflow so quality can be measured in CI.4MIT
- AlicenseNot gradedqualityBmaintenanceGives AI agents a safe way to read and check invoices, returning a deterministic APPROVE, REVIEW or STOP decision with every reason, while no tool can pay, approve or change anything.MIT
- AlicenseAqualityBmaintenanceIt enables an LLM agent to list and inspect invoices, run three-way matches against purchase orders and goods receipts, and route exceptions under server-enforced policy.5MIT