docintel
Planned integration with Amazon Textract for OCR and Amazon Bedrock for structured extraction of insurance documents, complementing the rules-based extractor.
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., "@docintel List the documents and extract loss_run_002_bad_total.txt, then flag what needs review"
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.
docintel-mcp
AI document intelligence for insurance documents, exposed to AI agents as an MCP server.
It extracts structured data from certificates of insurance and loss runs, checks it against deterministic business rules, and routes anything uncertain to a human reviewer. Agents reach it through four MCP tools; every call is audited.
All sample documents are synthetic. No real customer data is used anywhere in this repo.
Status
Stage | What | State |
1 | MCP server, typed schemas, rules extractor, validation, audit log, tests | Done |
2 | Amazon Textract (OCR) + Amazon Bedrock structured output, hybrid with the rules | Next |
3 | HTTP transport behind Kong, OAuth scopes per tool, caller identity in the audit log | Planned |
4 | Evaluation: per-field precision/recall and cost per document, rules vs. LLM vs. hybrid | Planned |
5 | Terraform, Fargate, CloudWatch telemetry, runbook | Planned |
Related MCP server: OpenRater
Architecture
agent (Claude Code, etc.)
│ MCP: stdio today, streamable HTTP behind a gateway in stage 3
▼
server.py ── tools: list_documents · extract_document · get_extraction · list_low_confidence_fields
│ input validation · audit log (one JSON line per call)
▼
pipeline.py ── extractor ──▶ fit to schema ──▶ business rules ──▶ status
│ accepted | needs_review | rejected
├─ extractors/rules.py (today; the rules-only baseline later)
└─ extractors/textract_bedrock.py (stage 2)
▼
store.py ── one JSON result per document id (content hash, so re-runs are idempotent)Key design points:
One schema, many extractors.
schemas.pydefines each document type once. Rules, LLM and hybrid extractors all have to produce it, which is what makes them comparable in stage 4.Rules after the model, always. Arithmetic, date order and identifier formats are checked in
validation.pyno matter which extractor ran.Confidence drives human review. Any field under
REVIEW_THRESHOLD(0.80), or any rule failure, sets the status toneeds_review.Tool arguments are untrusted. Tools accept a document name from an allow-listed inbox, never a path. Ids are format-checked before they touch the filesystem.
Quick start
Requires uv. uv installs Python 3.12 itself if it is missing.
uv sync # creates .venv and installs the locked dependencies, dev tools included
uv run pytest # 15 tests, including end-to-end calls through the MCP protocol
uv run ruff check .Add a dependency with uv add <package> (or uv add --dev <package>); commit uv.lock with it.
Use it from Claude Code
A project-level .mcp.json is included, so starting claude in this folder offers the
docintel server. To add it by hand instead:
claude mcp add docintel -- uv run --directory "$(pwd)" docintel-mcpThen try:
List the documents, extract
loss_run_002_bad_total.txt, and tell me what a reviewer needs to check.
Inspect the tools by hand
npx @modelcontextprotocol/inspector uv run docintel-mcpConfiguration
Variable | Default | Meaning |
|
| Folder the tools may read documents from |
|
| Where extraction results are stored |
|
| Audit trail, one JSON line per tool call |
Samples
File | Shows |
| Clean certificate → |
| Non-standard labels, odd policy number, no holder → |
| Clean loss run, three claims → |
| Stated total does not match the claims → caught by a rule |
Docs
docs/adr/– architecture decision recordsdocs/threat-model.md– threats specific to exposing tools to AI agentsNOTES.md– running log of decisions and surprises
License
MIT. See LICENSE.
Available Tools
4 toolsextract_documentB
Extract structured data from one document and store the result.
Returns the document id, detected type, status (accepted, needs_review or
rejected), the normalized data, and any validation issues.
Inputs: document_name (required). Returns: object
get_extractionA
Fetch a stored extraction result, including per-field confidence, by document id.
Inputs: document_id (required). Returns: object
list_documentsA
List the names of documents available for extraction.
Inputs: no named parameters. Returns: result
list_low_confidence_fieldsC
List the fields of a stored extraction that need human review, and why.
Inputs: document_id (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct action+target: listing documents, running an extraction, fetching a stored result, and listing low-confidence fields. The only mild overlap is between get_extraction and list_low_confidence_fields, since both read extraction results, but the descriptions make the split (full result vs. review-needed fields) reasonably clear.
All four names follow a clean snake_case verb_noun pattern (list_documents, extract_document, get_extraction, list_low_confidence_fields). Verb choice is meaningful: list for enumeration, extract for the write action, get for single-item fetch.
Four tools is a coherent, small surface for a focused extraction service, and each one plays a role in the extract-then-review flow. It sits slightly on the thin side given the workflow it implies, but nothing here is redundant.
The surface covers listing documents, extracting, and reading results, but the human-review loop is a dead end: you can list low-confidence fields yet there is no tool to submit corrections, accept/reject an extraction, or re-run one. No delete, update, or batch extraction operations are exposed, which will limit agents working beyond the happy path.
Maintenance
Related MCP Connectors
Checks certificates of insurance (ACORD 25) against your requirements. Pay per call, x402 USDC.
Human-in-the-loop review and approval for AI agents. Audit trail, approval policies, native MCP.
Insurance agency AI policy drafts, data-rule checks, workflows, and pricing.
Compliance frameworks (SOC 2, ISO 27001, CMMC, NIST, more) delivered to AI agents as MCP tools.
Related MCP Servers
- AlicenseBqualityCmaintenancePre-execution governance for AI agents. 45 MCP tools for hold queues, audit trails, risk scoring, and policy enforcement. Validates agent actions before they execute.4574 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to transcribe insurance rate filings into executable rating engines with full citation tracking, supporting validation, review, and quote generation through MCP tools.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to extract structured data from PDFs with confidence scores and provenance, and to search, review, and correct documents via MCP tools, resources, and prompts.-
- AlicenseAqualityDmaintenanceMCP server that exposes life-insurance back-office tools (policy document search, application status, product/underwriting rules) to LLM agents. Enables agents to retrieve policy documents, check application status, and evaluate underwriting rules via hybrid search and rule lookup.3MIT