invoice-intake-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-intake-mcpprocess the new invoices in the inbox and show me what needs approval"
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-intake-mcp
Reference implementation of the tool-design rules in Designing MCP servers and tools that agents can use safely, on a real back-office process: supplier invoice intake.
It is small on purpose. The fake ERP is a JSON file; everything else is the shape we use in production systems.
What it shows
Rule | Where |
Model the business operation, not the API |
|
Separate reads, drafts and commits |
|
Strict schemas |
|
Permissions on the server and credential | specialist agents get read; only the orchestrator connects to commit |
Tool results are untrusted input |
|
Typed errors |
|
Log for the auditor |
|
Human checkpoint enforced server-side |
|
Related MCP server: Ledger
Run it
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
python -m invoice_intake_mcp.orchestrator # process the inbox
python -m invoice_intake_mcp.approve list # see what is waiting
python -m invoice_intake_mcp.approve APR-xxxx approved --by cfo
python -m invoice_intake_mcp.orchestrator --resume # post the approved item
cat audit.jsonlExpected first run:
plan: 4 new invoices -> extract, resolve vendor, match, stage, post-or-approve
invoice_2291.pdf: staged STG-… -> WAITING for APR-… (7,420 EUR > 5,000 limit)
invoice_2292.pdf: match=goods_not_received -> REVIEW
invoice_2293.pdf: match=variance {"variance_pct": 2.34} -> REVIEW
invoice_2294.pdf: no PO reference -> REVIEW (ask requester)The orchestrator is deterministic so the flow replays without an API key.
An LLM belongs in the places marked in orchestrator.py (ambiguous vendor
candidates, free-text remarks, the note back to the requester), not in the
match rule, the tolerance or the approval limit.
Use the servers from an MCP client
{
"mcpServers": {
"invoice-intake-read": { "command": "uvx", "args": ["invoice-intake-mcp", "--role", "read"] },
"invoice-intake-commit": { "command": "uvx", "args": ["invoice-intake-mcp", "--role", "commit"] }
}
}Give an agent only the read server unless it is the orchestrator.
Tests and evals
pytest # unit tests on the core operations and the gate
python evals/run.py # replayable decision cases, run on every changeLayout
invoice_intake_mcp/
core.py business operations + policy (tolerance, approval limit), pure functions
server.py the two MCP servers and their tool descriptions
orchestrator.py minimal hub over MCP stdio: read server for work, commit server for posting
approve.py the human decision, as a CLI
audit.py append-only JSONL audit log
erp.py fake ERP / inbox state (JSON file)
tests/ pytest
evals/ cases.jsonl + run.pyMIT. Built by JustDukkan, AI solutions architecture.
This server cannot be deployed
Maintenance
Related MCP Connectors
- kanonikOAuthai.kanonik
Governance runtime for compliance: verified, human-approved writes to a tamper-evident record.
Read-only finance and operations controls for AI agents with evidence and safe next actions.
Scoped agent execution. Server-side credentials, policy, budgets and verifiable receipts.
Immutable event logging and audit trail for agent transactions
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables managing invoice workflows using Temporal, allowing submission, approval, rejection, and status checking of invoices through MCP tools.421MIT
- AlicenseNot gradedqualityBmaintenanceAn accounting-ops agent that reconciles payments against open orders, auto-books provably safe payments through a deterministic policy gate, and escalates exceptions to a human queue with audit trails.MIT
- FlicenseAqualityBmaintenanceExposes a ledger system (invoice queue, duplicate control, VAT register, contractor history, decision journal) as MCP tools for AI agents, enabling accurate invoice processing with deterministic validation.7-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to safely mutate business state by demonstrating phase-gating, validation-before-mutation, and structured audit logging in a toy inventory and purchase order system.-