Context7 MCP
MCP server that injects up-to-date, version-specific library documentation and code snippets into an LLM's context.
Context7 MCP
Context7 pulls current, version-specific documentation and working code examples for thousands of libraries directly into your LLM's context. It targets a common failure mode of coding assistants — stale training data producing hallucinated or outdated APIs — by fetching real docs on demand as an MCP server.
Add "use context7" to a prompt and the model retrieves relevant, pinned documentation before it writes code.
Key features
- Up-to-date, version-pinned docs and snippets for popular frameworks and libraries
resolve-library-idandget-library-docsMCP tools- Reduces API hallucinations by grounding generation in real documentation
- Works with Claude Code / Desktop, Cursor, VS Code, Windsurf, Zed, and other MCP clients
- Simple
npxinstall, no local index to maintain
Usage note: add the Context7 server to your MCP client config, then reference it in prompts (or let the client auto-invoke it) when generating or debugging library code.
Curated mirror of the open-source Context7 MCP (MIT). Get it from the source.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/context7-code-docs-mcp/check). Click a policy:
Consume Context7 MCP programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/context7-code-docs-mcp
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/context7-code-docs-mcp/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add context7-code-docs-mcp
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/context7-code-docs-mcp/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "context7-code-docs-mcp" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.