Skip to main content
Glama

Agent Docs

An MCP server that gives AI agents the current official documentation of Claude Code, Cursor, Codex and MCP.

Agent Docs MCP on mcprush

These tools change faster than a model's training data. Agent Docs keeps about 600 pages of their official docs in a search index, refreshes it every day, and gives your agent two tools: one finds the right passage, the other reads a whole section. The agent answers from the real docs and can link to them.

It runs as a remote MCP server (and over REST). It needs your own Cohere API key in the X-Cohere-Api-Key header: a free trial key is at dashboard.cohere.com/api-keys (sign up, then copy the Trial key). See Connect.

Step through it at your own pace (arrow keys work), or open the stills:

Source and how to rebuild: docs/flow/

How it was built and what was measured: ARCHITECTURE.md.


Connect

Add the server to any MCP client (Claude Code, Cursor, OpenWebUI and others):

{
  "mcpServers": {
    "agent-docs": {
      "url": "https://agent-docs-mcp.onrender.com/mcp/",
      "headers": { "X-Cohere-Api-Key": "<your Cohere key>" }
    }
  }
}

Calling a tool needs one of two headers:

  • Your own Cohere key: X-Cohere-Api-Key: <key>. A free trial key is at dashboard.cohere.com/api-keys. The key pays for reranking that one request; it is never stored or logged. Limit: 30 requests a minute per IP.

  • The owner's token: Authorization: Bearer <API_TOKEN>, for the owner's own use. There is no guest token: everyone else brings their own Cohere key.

The server is on a free plan: after 15 idle minutes, the first request takes about a minute.

Tool

What it returns

search_docs(query, limit=8, product=None, response_format="concise")

The best passage from each matching page, ranked, with the page's one-line description and a relevance score. Ask about one topic per call. product: claude-code, cursor, codex, mcp

read_section(url, heading=None, offset=0, outline_depth=2)

Without a heading: the page's description and outline (outline_depth=3 adds subsections). With a heading: the whole section, up to 8,000 characters per call (next_offset gives the rest)

Over REST:

curl -X POST https://agent-docs-mcp.onrender.com/ask \
  -H "Authorization: Bearer $API_TOKEN" -H 'content-type: application/json' \
  -d '{"question": "How do I add an MCP server in Claude Code?"}'

With your own key, replace the Authorization line with -H "X-Cohere-Api-Key: $COHERE_API_KEY".

Endpoint

Purpose

GET /health

Liveness, no token

POST /ask

A written answer with citations

POST /search

Passages with page descriptions (search_docs). product: claude-code, cursor, codex, mcp

POST /pages

Page cards: description and outline

POST /section

One section of a page (read_section)

POST /mcp/

MCP (streamable HTTP)

GET /docs

Interactive API docs (use Authorize with the token)

Locally, without a server (stdio, no token):

{ "mcpServers": { "agent-docs": { "command": "uv",
  "args": ["run", "--directory", "/path/to/agent-docs", "rag-mcp"] } } }

For MCP directories: connecting and listing the tools need no key (30 requests a minute per IP); only tools/call does. The server keeps no session, so GET /mcp answers 405; send everything with POST. Listed in the official MCP Registry as io.github.KonstantinStarovoytov/agent-docs (server.json).

Related MCP server: MCP Framework Documentation Server

What it covers

Product

Source

Claude Code (incl. Agent SDK, plugins)

code.claude.com/docs/llms.txt

Cursor

cursor.com/llms.txt

Codex

developers.openai.com/codex/llms.txt

MCP (latest spec, registry, extensions)

modelcontextprotocol.io/llms.txt

Agent Docs indexes pages of modelcontextprotocol.io. Per the LICENSE file of modelcontextprotocol/modelcontextprotocol (checked 2026-11-16), its documentation is under CC-BY-4.0 and its specification under Apache-2.0; older contributions that were not relicensed stay under MIT. In git, Agent Docs keeps only the pages' addresses, titles, headings and short summaries, not their text.


How it works

Your agent calls search_docs, then read_section when a passage is not enough. No language model runs on the server for this: the agent reads the passages and writes the answer itself.

search_docs works in four steps:

  1. It searches by meaning (embeddings) and by exact words (BM25) at the same time, so both "connect a tool server" and claude mcp add find the right page.

  2. It merges the two result lists by rank. Ties are kept in a fixed order, so the same question always gets the same results.

  3. A reranker (Cohere) reads the top 20 together with the question and scores how well each one matches.

  4. It keeps the best passage of each page and adds the page's one-line description and the headings of its other matching sections.

read_section reads from a stored copy of the page; no model is called. Searches are traced in Langfuse.

The REST endpoint /ask is for clients that are not agents. It also translates Russian and Polish questions into English, says "the documentation does not cover this" when even the best candidate scores below 0.30, picks 8 chunks (at most 2 from one section), and has gpt-6-luna write an answer that cites them.

Updated every day

Step through it at your own pace, or open the stills:

Every day at 06:00 UTC a GitHub Actions job reads each vendor's list of pages (llms.txt) and updates the index:

  • Changed pages are embedded again; unchanged ones are skipped.

  • New pages are checked first. A suspicious one waits in a GitHub issue until the owner ticks Index or Decline.

  • Pages that disappear from the list are deleted, unless too many disappear at once.

  • A short report of what changed in the products goes to reports/docs-changes/.

For programs: feed.json. The same run also keeps reports/docs-changes/feed.json: the pages added, removed and changed in the last 14 days, newest day first, for a program to read. It holds addresses, products and headings only: no summary (a model wrote it), no title and no page text. new_sections lists the headings a changed page gained outside its code blocks, and is empty when it gained none; a page re-embedded with the same text is left out. checked is the day of the last run that reached the end, also on a day with no change, so a reader can tell a quiet day from a stopped reindex. It moves on too when some pages failed to fetch (their indexed copy is kept) or the smoke test failed. So a long outage at one vendor reads as "nothing new" for that vendor; the workflow's "Open an issue on failure" step covers it (a vendor whose pages fail beyond the limit, or a failed smoke test, fails the run). A changed page lists at most 50 new headings, each cut to 200 characters, and the oldest days are dropped while the file is over 900 KB. Only the run on the production index writes it.

{"checked": "2026-11-14",
 "days": [{"day": "2026-11-14",
   "added": [{"url": "https://code.claude.com/docs/en/code-mode.md", "product": "claude-code"}],
   "removed": [{"url": "https://cursor.com/docs/context/rules.md", "product": "cursor"}],
   "changed": [{"url": "https://code.claude.com/docs/en/tools-reference.md",
                "product": "claude-code",
                "new_sections": ["Protect read-only files in Perforce"]}]}]}

Measured results

Each change was measured on labelled questions before it was kept. All experiments, including the ones that did not work: ARCHITECTURE.md.

Change

Measured effect

8 chunks instead of 5 for /ask

Multi-part questions fully covered: 25% → 75%

English copy of non-English questions

Hit@5: 0.958 → 1.000

10 candidates for the reranker, not 20

Fully covered: 75% vs 50% (the extra candidates pushed out the second topic)

gpt-6-luna instead of gpt-5.6-luna

Faithfulness: 0.975 → 0.994

Ties in a fixed order

The same question gets the same results (it did not before)

One passage per page in search_docs

Distinct pages in the top 5: 3.1 → 5.0; page hit@5: 0.936 → 0.979

Headings of a page's other matching sections (other_sections)

Labelled section visible: 0.667 → 0.867; with real agents, the same correctness and fewer failed section reads (11 → 1)

When an answer misses part of a question, the search has usually found the right text. It gets lost later, when the candidates are cut down to what the model sees.


Where it runs

Part

Service

Plan

API + MCP server

Render, service agent-docs at agent-docs-mcp.onrender.com

Free web service

Vector index

Qdrant Cloud

Free 1 GB cluster

Traces, eval datasets, prompts

Langfuse Cloud

Free Hobby

Daily re-index, CI

GitHub Actions

Free

Embeddings, answers

OpenAI (text-embedding-3-small, gpt-6-luna)

Pay per use

Rerank

Cohere (rerank-v5.0-fast)

Paid key for the owner's calls; callers bring their own; a trial key for the evals and the daily smoke check

Deploys run only after CI passes. The whole service is defined in render.yaml.

Deploy your own: Render → New → Blueprint → this repo. Fill the secrets it asks for (OPENAI_API_KEY, COHERE_API_KEY, optional COHERE_API_KEY_FALLBACK, QDRANT_URL, QDRANT_API_KEY, LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY); API_TOKEN is generated for you. If you change the host name, update API_ALLOWED_HOSTS (the MCP transport rejects unknown hosts). API_GUEST_TOKEN is optional and is not set on this server.

Cost

What

Cost

Hosting, database, tracing, CI

$0 / month (free tiers)

One answer (/ask)

≈ $0.0007 (OpenAI; rerank on the free trial)

One search (search_docs)

≈ $0 (one embedding + one rerank)

Daily re-index, nothing changed

$0

Daily re-index, a few pages changed

< $0.01 (embeddings + one short LLM check per new page)

Full rebuild of the index

≈ $0.10–0.30 one-off (embeddings ≈ $0.07 + one short LLM check per page)

Limits of the free setup: Cohere trial allows 1,000 reranks/month per key (two keys) and 10/minute; the API is capped at 60 paid requests/minute.


Develop

uv sync --locked                      # Python 3.14
cp .env.example .env                  # OpenAI, Cohere, Qdrant, Langfuse keys
docker compose up -d                  # local Qdrant + API on :8080
uv run python -m src.ask "How do skills work?"
uv run pytest -q && uv run ruff check src evals tests && uv run ruff format --check src evals tests && uv run mypy

Re-index locally: uv run python -m src.reindex --dry-run --out /tmp/r (no writes) — or run the Reindex workflow in GitHub Actions.

Folder

Contents

src/ingestion/

Page selection, chunking, junk gate, change report

src/rag/

Search, rerank, context selection, generation

src/service/

REST API and MCP server (one shared handler)

src/prompts/

Prompts, versioned in Langfuse

evals/

The eval gate: datasets, runners, scorers (guide)

reports/

Experiment results and daily change reports (index)

docs/

Diagrams, the animation, findings, publishing notes

data/manifests/

What each index holds, page by page

scripts/

Diagram rendering, Langfuse CLI with the project's keys

Diagrams: edit docs/diagrams/*.mmd, then uv run python scripts/render_diagrams.py. Animations: edit docs/flow/flows/ask.js (a question) or docs/flow/flows/reindex.js (the daily reindex), then docs/flow/render.sh.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides tools for AI agents to search, browse, and retrieve the full documentation for the mcp-framework. It enables agents to access documentation sections and page content directly within MCP-compatible environments like Claude Code and Cursor.
      3
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables users to search and retrieve up-to-date technical documentation for popular agent frameworks such as LangChain, LlamaIndex, AutoGen, Agno, OpenAI Agents SDK, MCP, Camel AI, and CrewAI. It does this by performing site-specific web searches and extracting page text through a standardized MCP interface over stdio or SSE.
      -