Give your coding agent up-to-date library docs over MCP (Context7, GitMCP, DeepWiki, Microsoft Learn)
Stop your coding agent from guessing at APIs that changed after its training cutoff. Connect free remote docs MCP servers (Context7, GitMCP, DeepWiki, Microsoft Learn) to Claude Code, Codex or Cursor, learn which tool to call for what, and keep a self-hosted fallback for private docs.
Prerequisites
- A coding agent that supports remote (Streamable HTTP) MCP servers, such as Claude Code, Codex CLI or Cursor
- Internet access; none of the four hosted servers needs an account (Context7 accepts an optional API key)
Models learn libraries at training time. When a library ships a breaking change afterwards, a coding agent writes code for the old API, and it does so confidently. The fix is to let the agent read current documentation while it works. Several free remote MCP servers do exactly that, and connecting one takes a single command.
Pick the right server
| Server | Best for | Endpoint | Tools (as returned on 2026-10-23) |
|---|---|---|---|
| Context7 | Popular libraries and frameworks: curated, versioned snippets | https://mcp.context7.com/mcp | resolve-library-id(libraryName, query), then query-docs(libraryId, query, language) |
| GitMCP | Any public GitHub repo, including niche or brand-new ones | https://gitmcp.io/{owner}/{repo} or https://gitmcp.io/docs | Per repo: fetch_<repo>_documentation, search_<repo>_documentation(query), search_<repo>_code(query, page), fetch_generic_url_content(url). Generic /docs: the same with owner/repo arguments plus match_common_libs_owner_repo_mapping(library) |
| DeepWiki MCP | Understanding how a repository works internally | https://mcp.deepwiki.com/mcp | read_wiki_structure(repoName), read_wiki_contents(repoName), ask_wiki_question(repoName, question) |
| Microsoft Learn MCP | Azure, .NET, Microsoft 365 and other Microsoft docs | https://learn.microsoft.com/api/mcp | microsoft_docs_search(query), microsoft_code_sample_search(query, language), microsoft_docs_fetch(url) |
They differ in where the text comes from:
- Context7 serves an indexed library catalog, and one library can have several IDs. For Pipecat,
resolve-library-idreturned/pipecat-ai/docs(20,214 snippets),/pipecat-ai/pipecat(1,721) and an llms.txt-based ID. Let the agent pick the ID that matches the question. - GitMCP reads the repository itself. It prefers the project's llms.txt, then falls back to
README.mdand other pages, and its code search uses the GitHub search API (exact match). A per-repo URL keeps the agent on one project. The generic/docsURL lets the agent choose the repo for each request, which is more flexible but easier to point at the wrong repo. - DeepWiki answers from an AI-generated wiki of the repo.
ask_wiki_questionreturns a written answer, and in our test it explained Pipecat'sMCPClient.tools()flow with a code sample. Treat that answer as a summary and check it against the source.
Connect them
Claude Code (remote HTTP servers, user scope so they work in every project):
claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp
claude mcp add --scope user --transport http deepwiki https://mcp.deepwiki.com/mcp
claude mcp add --scope user --transport http mslearn https://learn.microsoft.com/api/mcp
# one GitMCP server per repo you depend on, or the generic one:
claude mcp add --scope user --transport http gitmcp-pipecat https://gitmcp.io/pipecat-ai/pipecat
claude mcp list
Codex CLI:
codex mcp add context7 --url https://mcp.context7.com/mcp
codex mcp add deepwiki --url https://mcp.deepwiki.com/mcp
codex mcp add gitmcp --url https://gitmcp.io/docs
Cursor (~/.cursor/mcp.json or .cursor/mcp.json in the project):
{
"mcpServers": {
"context7": { "url": "https://mcp.context7.com/mcp" },
"deepwiki": { "url": "https://mcp.deepwiki.com/mcp" },
"gitmcp-pipecat": { "url": "https://gitmcp.io/pipecat-ai/pipecat" }
}
}
Context7 works without a key. Its entry notes that an optional API key (sent as Authorization: Bearer ...) raises rate limits. Keep that key in an environment variable, not in a committed .mcp.json. For more on scopes, headers and OAuth, see Connect an agent to a remote MCP server and Add MCP servers to Claude Code.
Make the agent actually use them
Agents often skip tools they aren't told about. Add a short rule to the project's AGENTS.md (or CLAUDE.md):
## Library docs
Before writing or changing code that uses a third-party library, look up the current API:
- Popular libraries: Context7 (resolve-library-id, then query-docs).
- A specific GitHub repo or a very new library: the gitmcp-* server for that repo.
- How a repo works internally: DeepWiki ask_wiki_question, then confirm in the source.
Quote the version you looked up in the PR description.
Check that it works by asking something that changed recently. For example, ask how to add MCP tools to a Pipecat bot. The agent should call a docs tool before it writes code.
Keep the context budget in check
Each server adds tool definitions to every request, and documentation pages are long. In our test, one GitMCP search_generic_documentation call returned about 17,000 characters. So:
- Connect only the servers you use, and prefer per-repo GitMCP URLs to many generic ones.
- Ask narrow questions (
query-docswith a specificquery, not the whole manual). - If your harness supports per-server tool filters, hide tools you don't need, such as
fetch_generic_url_content.
Safety and privacy
- Docs are untrusted input. A README or doc page can contain text that tries to steer the agent. That is indirect prompt injection, the same risk covered in Test an agent for prompt injection. Don't give a docs-reading session permission to push code or reach secrets without review.
- Your questions leave your machine. Queries go to the hosted service and can include code identifiers. GitMCP states that it doesn't store queries or collect personal information. Check each provider's policy before you use it on confidential code.
- Public repos only. The hosted servers read public sources. For private repos or internal docs, run a server locally (next section).
Private or offline docs
- Grounded Docs MCP Server scrapes and indexes documentation sites, files and code on your machine (
npx @arabold/docs-mcp-server@latest) and serves them at a local MCP endpoint. It describes itself as an open-source alternative to Context7. - SeekStorm MCP Server (new in October 2026) is a single Rust binary over stdio that indexes your own documents and PDFs. It supports lexical, vector and hybrid search, with no network or separate search server.
- If you publish a library, add an
llms.txtto your docs. GitMCP and many agents look for it first.
Browse more servers in the directory under MCP servers, or use the pick-an-mcp-server skill to have your agent choose.
Directory entries in this guide
- Context7: Upstash's MCP server and platform that pulls up-to-date, version-specific library documentation and code examples into AI coding tools.
- GitMCP: Free, open-source remote MCP server that turns any public GitHub repo or GitHub Pages site into a docs/code source for agents, no install or signup.
- DeepWiki MCP: Official DeepWiki MCP server: programmatic access to DeepWiki's public repository documentation and search (Ask Devin).
- Microsoft Learn MCP Server: Official remote MCP server giving agents real-time, trusted Microsoft documentation and code samples from Microsoft Learn.
- Grounded Docs MCP Server: Self-hosted documentation index for coding agents: scrapes official docs from websites, GitHub, npm, PyPI and local files so agents query the exact library version in use.
- SeekStorm MCP Server: Local single-binary MCP server (stdio) that embeds the SeekStorm Rust search library: lexical, vector and hybrid search over your own documents and PDFs.
- llms.txt: Proposal to standardize a /llms.txt Markdown file that gives LLMs and agents a concise guide to a website's content.
- Claude Code: Anthropic's agentic coding tool that reads your codebase, edits files, runs commands and integrates with dev tools; available in terminal, IDE, desktop and browser.
- OpenAI Codex CLI: OpenAI's lightweight open-source coding agent that runs in your terminal.
- Cursor: AI code editor and coding agent with Agent mode, Rules, Skills, MCP servers and a CLI.
- AGENTS.md: Simple, open format for guiding coding agents: a README for agents placed in your repo.
- Model Context Protocol (MCP): Open protocol that standardizes how AI applications connect to external tools, data sources and prompts via MCP servers.
Related
- Connect an agent to a remote MCP server (Guide)
- Add MCP servers to Claude Code (Guide)
- Pick an MCP server (Skill)
- Test a tool-using agent for prompt injection with AgentDojo (Guide)
- Terminal coding agents compared (Comparison)
- LiveKit Agents vs Pipecat vs OpenAI Realtime vs ElevenAgents vs Vapi: building voice agents (Comparison)
Sources
- Context7, accessed
- GitMCP README, accessed
- DeepWiki MCP (Devin docs), accessed
- Microsoft Learn MCP Server, accessed
- Grounded Docs MCP Server, accessed
- SeekStorm MCP server README, accessed
- Claude Code docs: Connect Claude Code to tools via MCP, accessed
- Cursor docs: Model Context Protocol, accessed
- The /llms.txt file proposal, accessed