MCP server, by Upstash
Context7 MCP Server
Context7 pulls up-to-date, version-specific documentation and code examples from the source and places them directly into the prompt for LLMs and AI code editors.
Quick facts
What it does
Context7 Platform provides up-to-date code documentation for LLMs and AI code editors. Without Context7, LLMs rely on outdated or generic information, producing outdated examples, hallucinated APIs, and generic answers for old package versions. With Context7, it fetches up-to-date code examples and documentation into the LLM context, with no tab-switching and no outdated code generation, per the README.
It works in two modes: CLI plus Skills, which installs a skill that guides the agent to fetch docs using ctx7 CLI commands with no MCP required, and MCP, which registers a Context7 MCP server so the agent can call documentation tools natively. An API key is recommended for higher rate limits, obtained free at context7.com/dashboard.
Configuration
Set up with npx ctx7 setup (Node.js 18 or newer), which authenticates via OAuth, generates an API key, and installs the skill, choosing CLI plus Skills or MCP mode. To configure manually, use the server URL https://mcp.context7.com/mcp with your MCP client and pass the API key via the Authorization: Bearer YOUR_API_KEY header, per README.
{"mcpServers":{"context7":{"type":"streamable-http","url":"https://mcp.context7.com/mcp","headers":{"Authorization":"Bearer YOUR_API_KEY"}}}}Source: https://github.com/upstash/context7. Placeholders only. Replace them in your own environment, and never commit real keys to a repository.
No environment variables are required per the official documentation.
Verified tools and features
resolve-library-id Config checked
MCP tool that resolves a general library name into a Context7-compatible library ID, with required query and libraryName inputs, per README MCP Tools.
query-docs Config checked
MCP tool that retrieves documentation for a library using a Context7-compatible library ID such as /mongodb/docs or /vercel/next.js, with required libraryId and query inputs, per README MCP Tools.
ctx7 library Config checked
CLI command that searches the Context7 index by library name and returns matching libraries with their IDs, per README CLI Commands.
ctx7 docs Config checked
CLI command that retrieves documentation for a library using a Context7-compatible library ID, per README CLI Commands.
Security notes
- README disclaimer: Context7 projects are community-contributed and accuracy, completeness, or security of all library documentation cannot be guaranteed. Projects are maintained by their respective owners, not Context7. Use at your own discretion and risk.
- API key is passed via the Authorization Bearer header in manual MCP configuration, per README. No env var name for the API key is stated in the fetched README, so none is listed.
An MCP server runs with the permissions of the process you start it from. Scope credentials to the narrowest access the job needs, and review what the client will send before connecting anything sensitive.
Stacks featuring this server
Sources and freshness
Last checked 2026-10-07. Verification label: config checked, which means the configuration and feature list trace to the official source above. It does not mean AgentsUse ran the server. Spotted an error? Send a correction. Back to the MCP server index.