Context7 MCP
$ context7-mcp Official Low RiskContext7 fetches up-to-date, version-specific documentation and code examples straight from source repositories for coding agents, eliminating hallucinated APIs. Runs locally via npx -y @upstash/context7-mcp with --transport (stdio|http), --port, and optional --api-key for higher rate limits.
npm install -g @upstash/context7-mcp context7-mcp is designed specifically as an MCP documentation-retrieval server (resolve-library-id and get-library-docs).
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Zero-prompt startup with --transport stdio|http, --port, and --api-key, exposing clean two-step MCP doc lookup tools.
--transport (stdio|http),--port,--api-key, and--help
Strictly read-only documentation retrieval with no local filesystem mutation or remote write capabilities.
- Read-only
resolve-library-idandget-library-docstools
Runs cross-platform in one command via npx -y @upstash/context7-mcp or remote hosted MCP URL.
- Published on npm (
@upstash/context7-mcp) with zero-config anonymous tier
Prevents stale-training-data API hallucinations by fetching exact current library docs on demand.
- Version-specific doc snippets tailored to coding agent context
Official Upstash repository (upstash/context7) under MIT license with very high ecosystem adoption.
- Official Upstash repo under MIT license
Clear setup instructions for Cursor, Claude Code, Codex, and CLI flags on context7.com and GitHub.
- Official docs on GitHub and
context7.com
Security, Auth & Guardrails
Works anonymously with rate limits; optional API keys are passed via --api-key or MCP host env config (CONTEXT7_API_KEY).
MIT open-source MCP server; free public tier with optional paid/API-key plans for higher rate limits.
# Context7 MCP Agent Rules - Read-only documentation server: safe to query library IDs and versioned docs freely. - Pass Context7 API keys via environment variables or host config rather than committing `--api-key` flags.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx -y @upstash/context7-mcp --help
Displays --transport, --port, and --api-key flags without starting the server.
npx -y @upstash/context7-mcp --transport http --port 8080
Serves read-only library documentation lookup tools over local HTTP on port 8080.
Strengths for Agents
- + Strictly read-only toolset eliminates accidental side effects during coding sessions.
- + Works out-of-the-box with
npx -y @upstash/context7-mcpeven without an API key. - + Dramatically cuts API version hallucinations for fast-moving frameworks.
Caveats & Pitfalls
- ! Requires internet access to Upstash's Context7 index.
- ! Acts as an MCP server daemon (
stdio/http) rather than a one-shot CLI returning--jsonto stdout.