ragdoc-mcp
Planned scaffolding support (roadmap): generated project templates include a FastAPI service exposing the planned retrieval pipeline as an HTTP API.
Planned scaffolding support (roadmap): the server can generate a ready-to-run RAG project template that wires its planned parser/chunker/embedder/store/retriever configuration into a LangChain pipeline.
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., "@ragdoc-mcpdiagnose why my RAG answer failed on the API docs"
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.
RAG Doctor MCP
Local-first MCP server for diagnosing and fixing retrieval pipelines over technical documents.
RAG Doctor helps AI agents and developers build, tune, and debug RAG pipelines over technical documents (PDFs with equations and tables, source code, manuals). Its distinctive feature is cross-stage diagnosis: when a RAG answer is wrong, it identifies which stage failed (parsing, chunking, indexing, retrieval, reranking, context packing) and proposes a fix that it can verify.
Why RAG Doctor?
Existing MCP tools each cover one stage: chunking tuners, retrieval evaluators, parser routers. Agents still lack a tool that answers: why did this question fail, and what exactly should I change?
RAG Doctor finds the broken stage and proves the fix.
Related MCP server: OmniDocs-RAG-CN
Features
Tool | Purpose |
| Sample files → type mix, scanned %, equation/table/code density, languages, pages |
| Profile + constraints → joint plan (parser/chunker/embedder/store/retriever) with measured time/cost estimates and decision log |
| Execute plan: resumable, batched, cached by file hash |
| Hybrid (dense+BM25 RRF) + cross-encoder rerank → chunks with citations |
| Trace question through all 7 stages → first failing stage, failure code, evidence, ranked fixes |
| Apply fix to shadow config/index → re-run failing + regression cases → before/after metrics |
| Measure hit@k, MRR, recall per content type (prose, table, equation, code) |
Quick Start
# Install (requires Python 3.10+)
pip install ragdoc-mcp
# or with uv
uvx ragdoc-mcp
# Profile a corpus
ragdoc profile_corpus --path ./my-docs --sample-size 200
# Create a plan
ragdoc plan_rag --path ./my-docs --privacy local_only --hardware cpu
# Build index (after reviewing plan)
ragdoc build_index --plan-id <plan_id>
# Search
ragdoc search --collection my-docs --query "How does the retry logic work?" --k 8
# Diagnose a failure
ragdoc diagnose_failure --collection my-docs --question "What is the timeout?" --expected-source "config/retry.py"MCP Client Configuration
Claude Code / Claude Desktop
Add to your MCP config:
{
"mcpServers": {
"ragdoc": {
"command": "uvx",
"args": ["ragdoc-mcp"],
"env": {
"RAGDOC_BASE_DIR": "~/.ragdoc"
}
}
}
}Hermes Agent
hermes mcp add ragdoc --command uvx --args ragdoc-mcp --env RAGDOC_BASE_DIR=~/.ragdocArchitecture
src/ragdoc/
├── server.py # FastMCP server with 7 tools + resources + prompts
├── parsers/ # Fast (pypdf), Docling (layout/tables/formulas/OCR), LlamaParse (cloud)
├── chunkers/ # Heading-aware, token window, table-per-chunk, formula-preserving, AST code
├── embedders/ # fastembed (bge, nomic, e5, jina-code) + sentence-transformers
├── stores/ # LanceDB (default), Qdrant, pgvector adapters
├── retrieval/ # Hybrid RRF + cross-encoder rerank
├── diagnose/ # 7-stage tracer with evidence and fix proposals
├── planner/ # profile_corpus + plan_rag with decision log
├── eval/ # domain_eval + verify_fix
├── security/ # Path allowlist, untrusted text wrapper, instruction detection
├── config/ # Models YAML, settings, scale tiers
└── schemas/ # Pydantic models for all tool I/OSecurity
Local-first: No network calls by default. Cloud parsers/LLMs need explicit consent.
Path allowlist: Only folders under
RAGDOC_BASE_DIRare readable; writes only inside collection dirs.Untrusted text: All document text labeled as untrusted; instruction-like patterns flagged.
No shell/eval/arbitrary URLs: Secrets only from environment, never logged.
Dependency hygiene: Pinned versions, pip-audit in CI, SBOM at release.
Development
# Clone and setup
git clone https://github.com/your-org/ragdoc-mcp
cd ragdoc-mcp
# Install dev dependencies
uv sync --dev
# Run tests
pytest
# Lint
ruff check .
mypy src
# Type check
mypy src/ragdocProject Structure
ragdoc-mcp/
├── src/ragdoc/ # Main package
├── tests/
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── fixtures/ # Test documents and failure fixtures
├── skills/rag-doctor/ # Claude Code skill
├── docs/ # Documentation
├── .github/workflows/ # CI/CD
├── pyproject.toml # Package config
├── server.json # MCP registry metadata
├── Dockerfile # Multi-stage Docker image
├── LICENSE # MIT
└── README.md # This fileLicense
MIT License - see LICENSE for details.
Contributing
See CONTRIBUTING.md for guidelines.
Roadmap
v1.1:
scaffold_project(tested templates for LlamaIndex, LangChain, plain Python + Dockerfile/FastAPI), remote HTTP modev2: Large-scale resumable ingestion with Qdrant/pgvector, drift monitoring, multi-user
Citation
If you use RAG Doctor in research, please cite:
@software{ragdoc-mcp,
title = {RAG Doctor MCP: Cross-Stage Diagnosis for Retrieval Pipelines},
year = {2026},
url = {https://github.com/your-org/ragdoc-mcp}
}This server cannot be deployed
Maintenance
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Build a RAG pipeline station by station and search your own documents with cited answers.
Structured knowledge base for AI agent solutions. Search, explore, and retrieve build logs.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides local technical documentation with hybrid search (semantic + BM25) for AI agents, ensuring access to up-to-date framework docs.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to index and search local files, websites, GitHub repos, and packages with hybrid AI-powered retrieval, all locally through IDE chat.Apache 2.0

Infino MCP serverofficial
AlicenseAqualityAmaintenanceEnables AI agents to perform keyword, semantic, hybrid, and SQL retrieval over data stored on object storage or local paths, using a local embedding model without requiring an API key.15178 npmApache 2.0- FlicenseNot gradedqualityCmaintenanceEnables document Q&A and knowledge retrieval through hybrid semantic and keyword search, with tools for document ingestion, chunking, summarization, PII redaction, and RAGAS-based evaluation.-