Invoice Vision MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | Bind address for HTTP transport | 127.0.0.1 |
| MCP_PORT | No | Bind port for HTTP transport | 8000 |
| OCR_LANG | No | Tesseract languages, e.g. eng+ara | eng |
| INVOICE_DB | No | SQLite path | ./data/invoices.db |
| INVOICE_INBOX | No | Only folder the server may read images from | ./samples |
| MCP_TRANSPORT | No | Transport mode: stdio or streamable-http | stdio |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Reads invoice images with computer vision (OpenCV + Tesseract OCR), validates them against Saudi VAT rules (15%) and stores them in a SQLite database for analysis. Use list_inbox to see new images, ingest_invoice to process one, and spending_report or query_invoices_sql to analyse stored data.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_inboxB | List invoice images in the inbox and whether each one has already been ingested. |
| extract_invoiceA | Run computer vision + OCR on an invoice image and return structured fields WITHOUT saving. Args: filename: image file name inside the inbox, e.g. "inv_001.png" |
| ingest_invoiceB | Extract an invoice image and save it to the database. Invalid invoices are saved but flagged. Args: filename: image file name inside the inbox |
| list_invoicesC | List stored invoices with optional filters. Dates are ISO strings (yyyy-mm-dd). Categories: office_supplies, it_services, utilities, catering, logistics, maintenance, other. |
| get_invoiceA | Get one stored invoice with its line items and validation issues. |
| spending_reportB | Aggregate spend (count, subtotal, VAT, total) grouped by 'vendor', 'category' or 'month'. |
| query_invoices_sqlA | Run a read-only SQL SELECT against the invoice database (tables: invoices, line_items). Read the invoices://schema resource first. Writes are rejected. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| monthly_spend_report | Prompt template for a monthly finance report. month format: yyyy-mm |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| schema | Database schema, so a model can write correct SQL. |
| summary | Headline numbers: invoice count, vendors, total spend, VAT, invalid count, date range. |
TDQS
Scored across 7 tools
Each tool has a distinct role: listing inbox files vs. listing stored invoices, extracting without saving vs. ingesting with save, plus a report aggregator and a raw SQL escape hatch. The only real point of confusion is list_inbox vs. list_invoices, which differ in resource (inbox images vs. database records) but sound similar; descriptions clarify the difference.
Most tools follow a clean verb_noun snake_case pattern (list_inbox, get_invoice, extract_invoice, ingest_invoice, list_invoices). spending_report drops the verb and query_invoices_sql appends a suffix, which are minor but noticeable deviations.
Seven tools is a well-scoped surface for an invoice pipeline: inbox discovery, extraction, ingestion, retrieval, listing, aggregation, and SQL query. Every tool earns its place with no obvious filler.
The pipeline covers the full core lifecycle from inbox image to stored, queryable invoice with reporting. Gaps exist around mutation/cleanup (no delete or re-ingest/update of stored invoices, no way to resolve flagged validation issues), but read-only SQL and the flags field provide reasonable workarounds.