docintel-mcp

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.

Category
访问服务器

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 FieldExtractor protocol in extraction.py is 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_documents tool 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选