DO

Documcp MCP Server for Intelligent Document Processing

Streamline intelligent document processing with an MCP server that supports multiple formats, automates workflows, and simplifies document management.

Quick Install
npx -y @tosin2013/documcp

Overview

Documcp MCP Server is a lightweight server that implements the Model Context Protocol (MCP) to streamline intelligent document processing. It centralizes document ingestion, preprocessing, and context-aware query workflows so you can connect documents to language models and retrieval systems without building a custom pipeline for each format. The server helps teams automate extraction, chunking, embedding, and storage of document context, enabling efficient semantic search, summarization, and downstream LLMintegration.

The server is useful when you need a repeatable, API-driven way to turn heterogeneous documents into model-ready context. It supports multiple input formats, pluggable connectors, and configurable preprocessing steps, so developers can integrate document intelligence into applications (search, Q&A, assistants) with minimal setup.

Features

  • REST API for document ingestion, querying, and workflow management
  • Support for common document formats: PDF, DOCX, HTML, TXT, and images (OCR)
  • Configurable preprocessors: chunking, deduplication, language detection
  • Embedding generation and vector store integration for semantic search
  • Pluggable storage backends (local filesystem, S3-compatible, SQL)
  • Webhooks and callbacks for asynchronous processing
  • Simple authentication via API key or JWT
  • Docker-friendly deployment and CLI for local testing

Installation / Configuration

Quick start with Docker:

# Pull and run the server (replace IMAGE with the actual image tag)
docker run -d \
  -p 8080:8080 \
  -e DOCUMCP_API_KEY=your_api_key \
  -e STORAGE_PATH=/data \
  -v $(pwd)/data:/data \
  tosindoc/documcp:latest

Example docker-compose.yml:

version: "3.8"
services:
  documcp:
    image: tosindoc/documcp:latest
    ports:
      - "8080:8080"
    environment:
      - DOCUMCP_API_KEY=${DOCUMCP_API_KEY}
      - STORAGE_BACKEND=s3
      - S3_BUCKET=my-bucket
      - S3_REGION=us-east-1
    volumes:
      - ./config:/app/config

Basic configuration (config.yaml):

server:
  port: 8080
  api_key_env: DOCUMCP_API_KEY

storage:
  backend: local
  path: /data/documents

processing:
  chunk_size: 1000
  overlap: 200
  ocr_enabled: true

models:
  embedding_provider: mcp-compatible
  embedding_params:
    dimension: 1536

Start from source (general):

git clone https://github.com/tosin2013/documcp.git
cd documcp
# Follow repository-specific build steps, e.g.:
# make build
# ./documcp --config ./config/config.yaml

Available Tools

  • REST API: endpoints for /ingest, /documents, /search, /status, /health
  • CLI: basic commands to ingest files, list documents, and run local tests
  • Webhooks: configure callbacks to notify your app when processing completes
  • Connectors: S3, local filesystem, SQL for metadata; optional OCR service integration
  • SDKs: community SDKs or examples (Python/JS) in the repo for quick integration

API example — upload and search using curl:

# Ingest a document
curl -X POST "http://localhost:8080/ingest" \
  -H "Authorization: Bearer $DOCUMCP_API_KEY" \
  -F "file=@/path/to/contract.pdf" \
  -F "metadata={\"source\":\"contracts\"}"

# Semantic search
curl -X POST "http://localhost:8080/search" \
  -H "Authorization: Bearer $DOCUMCP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"termination clause","top_k":5}'

Python example (requests):

import requests

API_URL = "http://localhost:8080"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

# Upload
with open("invoice.pdf", "rb") as f:
    r = requests.post(f"{API_URL}/ingest", headers=HEADERS, files={"file": f})
    print(r.json())

# Search
r = requests.post(f"{API_URL}/search", headers=HEADERS, json={"query":"invoice total", "top_k":3})
print(r.json())

Use Cases

  • Contract analysis: ingest a corpus of contracts, create embeddings, and run clause-level semantic search to locate termination, indemnity, or liability language quickly.
  • Invoice automation: extract line items, totals, and vendor fields from PDFs (with OCR), then populate accounting systems or trigger workflows.
  • Knowledge base augmentation: convert technical docs and manuals into a vectorized knowledge store to power an assistant that answers developer and support queries.
  • E-discovery and legal review: centralize diverse document formats, deduplicate content, and enable fast semantic filtering for review prioritization.
  • Product documentation search: index multi-format docs (Markdown, HTML, PDF) so product teams provide contextual answers and summaries without manual tagging.

Supported Formats & Connectors

Input FormatExtraction Method
PDFText extraction + OCR fallback
DOCXNative text extraction
HTML/TXTDirect parsing
ImagesOCR pipeline
ZIP/ArchivesBatch ingestion, recursive extraction
ConnectorPurpose
Local FSStore raw files and metadata
S3-compatibleCloud storage integration
SQL (Postgres)Metadata, indexing

Resources

  • GitHub: https://github.com/tosin2013/documcp
  • Typical endpoints: /ingest, /documents, /search, /embeddings, /health
  • Configuration reference in repo: config/*.yaml
  • Look for SDK examples and sample pipelines in the repository for quick adaptation

If you need to adapt Documcp to a specific LLM or vector store, check the configuration section in the repo for provider hooks and connector examples.