MCP Document Analysis Server
A Model Context Protocol server that provides document analysis capabilities to LLM applications, including extraction, chunking, summarization, and semantic search for PDF, DOCX, and plaintext documents.
README
MCP Document Analysis Server
A Model Context Protocol (MCP) server that provides document analysis capabilities to LLM applications. Supports PDF, DOCX, and plaintext extraction with chunking, summarization, and semantic search.
Features
- Document Extraction - Parse PDF, DOCX, and TXT files into structured text
- Smart Chunking - Split documents with configurable overlap for RAG pipelines
- Semantic Search - Embed and search document chunks using Cohere Embed v3
- Summarization - Generate document summaries with configurable detail level
- Metadata Extraction - Extract titles, authors, dates, page counts
- MCP Protocol - Full MCP compliance for integration with Claude, IDEs, and other MCP hosts
Architecture
MCP Client (Claude, IDE, etc.)
│
│ MCP Protocol (JSON-RPC over stdio)
│
▼
┌─────────────────────────────┐
│ MCP Document Server │
├─────────────────────────────┤
│ Tools: │
│ ├── extract_text │
│ ├── chunk_document │
│ ├── search_chunks │
│ ├── summarize_document │
│ └── get_metadata │
├─────────────────────────────┤
│ Resources: │
│ ├── document://{path} │
│ └── chunks://{doc_id} │
├─────────────────────────────┤
│ Parsers: │
│ ├── PDFParser │
│ ├── DocxParser │
│ └── TextParser │
└─────────────────────────────┘
Quick Start
Installation
git clone https://github.com/BabyChrist666/mcp-document-server.git
cd mcp-document-server
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
Usage with Claude Desktop
Add to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"document-analysis": {
"command": "python",
"args": ["-m", "mcp_doc_server"],
"cwd": "/path/to/mcp-document-server"
}
}
}
Usage with Claude Code CLI
claude --mcp-server "python -m mcp_doc_server"
Tools
extract_text
Extract full text from a document file.
{
"name": "extract_text",
"arguments": {
"file_path": "/path/to/document.pdf"
}
}
chunk_document
Split a document into overlapping chunks for RAG.
{
"name": "chunk_document",
"arguments": {
"file_path": "/path/to/document.pdf",
"chunk_size": 500,
"overlap": 50
}
}
search_chunks
Semantic search across document chunks.
{
"name": "search_chunks",
"arguments": {
"query": "What are the payment terms?",
"doc_id": "contract_2024",
"top_k": 5
}
}
summarize_document
Generate a summary of a document.
{
"name": "summarize_document",
"arguments": {
"file_path": "/path/to/report.pdf",
"detail_level": "brief"
}
}
get_metadata
Extract document metadata (title, author, pages, etc.).
{
"name": "get_metadata",
"arguments": {
"file_path": "/path/to/document.pdf"
}
}
Configuration
| Variable | Description | Default |
|---|---|---|
COHERE_API_KEY |
Cohere API key for embeddings and generation | Required |
EMBEDDING_MODEL |
Cohere embedding model | embed-english-v3.0 |
CHUNK_SIZE |
Default chunk size in characters | 500 |
CHUNK_OVERLAP |
Default overlap between chunks | 50 |
Testing
pytest tests/ -v
Tech Stack
- Python 3.10+ - Runtime
- MCP SDK - Model Context Protocol implementation
- Cohere - Embeddings and generation
- PyPDF2 - PDF parsing
- python-docx - DOCX parsing
- Pydantic - Data validation
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.