Skip to main content

MCP server for DocReadi — document data extraction for finance, in your AI client.

Project description

docreadi-mcp

A local MCP server for DocReadi — document data extraction for finance. It runs on your machine, reads documents off your disk, and calls the hosted DocReadi API with your API key, so an AI client (Claude Desktop, Claude Code, Cursor, …) can extract documents and query your DocReadi corpus without leaving the chat.

Status: v1, in progress (see ../../MCP_SERVER_PLAN.md). Tools land phase by phase; this is the skeleton + first read tool.

How it works

Your MCP client spawns docreadi-mcp as a local subprocess and talks to it over stdio. The server is a thin courier — all extraction/storage happens on the hosted DocReadi API; the server just translates tool calls into HTTPS requests and (for ingestion) reads local files. Your API key lives only in your client config, never in this repo.

Install / configure

Add the server to your MCP client config with your DocReadi API key (get one at docreadi.com → Settings → API keys):

{
  "mcpServers": {
    "docreadi": {
      "command": "uvx",
      "args": ["docreadi-mcp"],
      "env": {
        "DOCREADI_API_KEY": "dr_live_…"
        // "DOCREADI_BASE_URL": "https://api.docreadi.com"  // override if self-hosting
      }
    }
  }
}
Env var Required Default
DOCREADI_API_KEY yes
DOCREADI_BASE_URL no https://api.docreadi.com

Tools

Tool What it does
check_connection First-run self-test — is DocReadi reachable and is your API key valid? Never errors; returns a diagnostic.
extract_document Extract structured data from a local PDF/JPG/PNG — uploads, waits for extraction, returns the fields + line items + totals + confidence.
get_document Fetch a document's status + extracted data by id.
extract_adhoc One-off, non-destructive extraction of caller-defined fields from a document already in DocReadi (e.g. "who signed these delivery notes?").
classify_document (Re)classify a document's type; returns the type + reasoning.
search_documents Search/list the workspace's documents (by vendor, number, type, status, or date range) — a summary row per match.
list_counterparties List vendors/customers (VAT, aliases, doc counts), paginated.
list_reports List the workspace's saved reports.
run_report Run a saved report and return its rows — the way to query/search the corpus.
export_report_csv Run a saved report and write the result as a CSV to a local path.

(search_documents is the raw query surface; for richer column selection and saved queries, author a report in the UI and use run_report / export_report_csv.)

Development

This package lives in the DocReadi monorepo so it's reviewed and CI'd alongside the API it wraps. Its layering keeps the dependency-free parts testable in the main CI without the mcp SDK:

  • docreadi_mcp/config.py — env config.
  • docreadi_mcp/catalog.py — pure-data tool→endpoint registry (the maintenance anchor: tests/test_mcp_catalog_contract.py binds it to agent_guide.GUIDE).
  • docreadi_mcp/client.py — httpx client (tested with MockTransport).
  • docreadi_mcp/server.py — thin FastMCP glue (lazy-imports the mcp SDK).
# from the repo root
pip install -e services/mcp          # installs mcp + httpx
DOCREADI_API_KEY=dr_… python -m docreadi_mcp   # run over stdio

Maintenance contract: when a DocReadi API endpoint a tool wraps changes, update docreadi_mcp/catalog.py (and the tool) — the contract test fails CI otherwise. See MCP_SERVER_PLAN.md §5.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docreadi_mcp-0.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docreadi_mcp-0.1.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file docreadi_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: docreadi_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for docreadi_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 588630de71ca33df4271e896743d8566f1d702a2ab512841146c387fff607c71
MD5 f81ceb8fdefd8a0d932fb0c7372b8727
BLAKE2b-256 d5870d488858b035d45abde0df633f8ea920c1aac680046e63a4a13eadb5c85d

See more details on using hashes here.

File details

Details for the file docreadi_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: docreadi_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for docreadi_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f75571b651b268eeec5f4609603668f626303dcaca3bdc7f472f861469bddc13
MD5 08c19831561076c670871d71c8de613d
BLAKE2b-256 a04fedee0f2792ba56bfbf367d9083611ef835265b696d284f0882c47bc1961f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page