DocAgent
Click on "Install 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., "@DocAgentwhat does my contract say about termination?"
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.
DocAgent — RAG + Agent System with Document AI
An end-to-end retrieval-augmented generation (RAG) pipeline plus a tool-using LangGraph agent over your own documents. Upload PDFs, scanned images, or text files; DocAgent chunks and embeds them into Qdrant, retrieves and reranks relevant context, and answers with citations — either via a simple grounded QA endpoint, or via an agent that can also call a calculator, search the web, and OCR documents on demand.
Built for ML/GenAI engineer portfolios: RAG, agents, Document AI, local inference, and observability, all running fully offline via Ollama.
Architecture
┌─────────────┐ ┌──────────────┐
PDF/image/text →│ Ingestion │→ chunks→│ Qdrant │
│ (OCR via │ │ (vector DB) │
│ Tesseract) │ └──────┬───────┘
└─────────────┘ │ similarity search
▼
┌───────────────┐
│ Cross-encoder │
│ reranker │
└──────┬────────┘
▼
FastAPI ── /query ─────────► Grounded QA (Ollama, JSON + Pydantic,
citations)
── /agent/chat ────► LangGraph ReAct agent
tools: retrieve_documents, calculator,
web_search (Tavily), ocr_scan
└─ also exposed via MCP (mcp_server.py)
└─ every run logged to runs/*.jsonl
Streamlit UI ── talks to FastAPI, shows answers + citations + tool callsTech stack
Python, FastAPI, Pydantic v2, LangChain + LangGraph, Ollama (local LLM +
embeddings), Qdrant (vector DB), a small HF sentence-transformers
cross-encoder for reranking, Tesseract OCR, MCP (Model Context Protocol),
Streamlit, Docker Compose.
Quickstart (Docker Compose — easiest)
cp .env.example .env # edit if you want a different model or a Tavily key
docker compose up -d qdrant ollama backend streamlit
./scripts/pull_ollama_models.sh # pulls the LLM + embedding model into OllamaThen open:
Streamlit UI: http://localhost:8501
API docs: http://localhost:8000/docs
macOS tip: running Ollama natively (
brew install ollama, thenollama serve) is noticeably faster than the containerizedollamaservice since it gets Metal acceleration. If you do that, stop theollamaservice in compose and setOLLAMA_BASE_URL=http://host.docker.internal:11434in.env.
Local dev (no Docker for the backend)
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements-dev.txt
docker compose up -d qdrant ollama # or run both natively
./scripts/pull_ollama_models.sh
uvicorn app.main:app --reload
# in another terminal:
streamlit run streamlit_app/app.pyRequires tesseract and poppler on PATH for OCR (brew install tesseract poppler on macOS).
API
POST /ingest— multipart file upload (pdf,png/jpg/tiff/bmp,txt/md). Scanned PDF pages and images are OCR'd automatically. Returnsdoc_id.POST /query—{"question": "...", "doc_id": "optional"}→ grounded, Pydantic-validated answer with citations (AnswerResponse). No tool use.POST /agent/chat—{"message": "...", "doc_id": "optional"}→ LangGraph agent response, may callretrieve_documents,calculator,web_search,ocr_scanacross multiple steps. Returns citations + a tool-call trace.GET /health— reports whether Qdrant and Ollama are reachable.
MCP server
The same four tools are exposed as an MCP server for external MCP clients (e.g. Claude Desktop):
python -m app.mcp_serverRun tracing
Every /query and /agent/chat call appends a structured JSON record
(retrieved chunks, tool calls, latencies, final answer) to runs/<date>.jsonl
— no external service required. Set LANGCHAIN_API_KEY in .env to
additionally send traces to LangSmith.
Tests
pytest # unit tests always run; live-service API test
# auto-skips unless Qdrant + Ollama are reachableNotes on deviations from a pure Ollama stack
Reranking uses a small local HF cross-encoder (
cross-encoder/ms-marco-MiniLM-L-6-v2) since Ollama has no reranking model type — it's a separate, tiny CPU model, not a generation backend.Web search (
web_searchtool) uses Tavily and requiresTAVILY_API_KEYin.env; without it the tool reports itself unavailable and the agent falls back to documents/general knowledge.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sharvary-HH/DocAgent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server