docintel-mcp
A document intelligence MCP server that extracts text and structured fields from business documents, routes low-confidence extractions to a human review queue, and enables searching across processed documents.
README
docintel-mcp
A Document Intelligence MCP server — extract text and structured fields from business documents, route low-confidence extractions to a human review queue, and search everything you've processed. Built on the Model Context Protocol so any MCP client (Claude Desktop, Claude Code, or your own agent) can drive it.
This project packages the operating pattern I've shipped in production document pipelines: extract → score → route, with explicit confidence thresholds and a human in the loop for exactly the cases automation shouldn't decide alone.
Architecture
flowchart LR
subgraph client [MCP Client]
A[Claude Desktop / agent]
end
subgraph server [docintel-mcp]
B[process_document]
C[Extractor<br/>pypdf + pattern fields]
D{Confidence router}
E[(Document store<br/>BM25 search)]
F[(Review queue<br/>JSONL)]
end
A -- MCP over stdio --> B
B --> C --> D
D -- ">= accept" --> E
D -- "review band" --> F
D -- "below review" --> X[rejected]
A -- search_documents --> E
A -- review_queue_pending / review_resolve --> F
Every extracted field carries a confidence score and a source snippet, so a reviewer can confirm or correct a value in seconds without reopening the document. Thresholds are explicit and tunable — the difference between a demo and something an operations team will trust.
Tools exposed
| Tool | What it does |
|---|---|
process_document(path) |
Extract text + fields from a .pdf/.txt/.md, route by confidence, index for search |
search_documents(query, top_k) |
BM25 keyword search across processed documents |
get_document_text(document_id) |
Retrieve extracted text |
list_documents() |
List processed documents |
review_queue_pending() |
Fields awaiting human review |
review_resolve(item_id, corrected_value) |
Record the human-confirmed value |
Quick start
git clone https://github.com/reshma449/docintel-mcp.git
cd docintel-mcp
pip install -e ".[dev]"
# run the test suite
pytest
# run the server directly (stdio transport)
docintel-mcp
Connect from Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"docintel": {
"command": "docintel-mcp",
"env": {
"DOCINTEL_ACCEPT_THRESHOLD": "0.85",
"DOCINTEL_REVIEW_THRESHOLD": "0.30"
}
}
}
}
Then ask Claude: "Process examples/sample_invoice.txt and show me anything that needs review."
Configuration
| Env var | Default | Meaning |
|---|---|---|
DOCINTEL_ACCEPT_THRESHOLD |
0.85 |
Confidence at or above → auto-accept |
DOCINTEL_REVIEW_THRESHOLD |
0.30 |
Confidence at or above (but below accept) → human review |
DOCINTEL_REVIEW_QUEUE |
.docintel/review_queue.jsonl |
Where the review queue persists |
Design notes
- Why regex + heuristics instead of an LLM call in the default extractor? Determinism. The pipeline shape (extract → score → route) is what matters; the
FieldExtractorprotocol inextraction.pyis a one-method interface, so swapping in an LLM or cloud OCR extractor is a ~20-line change that doesn't touch routing, storage, or the MCP surface. - Why JSONL for the review queue? It's inspectable with
cat, diffable in git, and importable into a spreadsheet — which is how real review teams actually start before anyone builds them a UI. - Why BM25 and not embeddings? For short business documents, BM25 is strong, explainable ("it matched these terms"), and dependency-free. An embedding index would slot in behind the same
search_documentstool without changing the client contract. - Scanned PDFs produce an explicit warning instead of a silent empty extraction — silent empties are how bad data reaches dashboards.
Project layout
src/docintel_mcp/
server.py # FastMCP server + tool definitions
extraction.py # text + field extraction (FieldExtractor protocol)
confidence.py # thresholds, routing, review queue
store.py # BM25 document store
models.py # dataclasses shared across the pipeline
tests/ # unit tests for every module
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.