
Context7 provides an MCP server that delivers up-to-date, version-specific documentation and code examples directly into LLM prompts by fetching current information from source repositories. The server solves the problem of LLMs generating outdated code examples, hallucinated APIs, and generic answers based on old training data by injecting real-time documentation context for libraries and frameworks. It enables developers to request code examples and API information for specific tools (like Next.js, Cloudflare Workers, and Supabase) with the assurance of receiving current, accurate guidance.
$ npx add-mcp https://mcp.context7.com/mcp --name context7 --header 'Authorization: Bearer ${API_TOKEN}'Run in your terminal. add-mcp asks which agents to add it to, then asks for each value it needs. Add -g to install it for every project.
Review the command, arguments and environment values before installing. MCP servers run with your local permissions.
Claude Code
$ claude mcp add --transport http context7 https://mcp.context7.com/mcp --header 'Authorization: YOUR_AUTHORIZATION'Run in your terminal. Add --scope user to make it available in every project.
Verified live against the running server on Nov 6, 2026.
resolve-library-idResolves a package/product name to a Context7-compatible library ID and returns matching libraries. You MUST call this function before 'Query Documentation' tool to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/o...2 paramsResolves a package/product name to a Context7-compatible library ID and returns matching libraries. You MUST call this function before 'Query Documentation' tool to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/o...
libraryName*stringquery*stringquery-docsRetrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework. You must call 'Resolve Context7 Library ID' tool first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explici...3 paramsRetrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework. You must call 'Resolve Context7 Library ID' tool first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explici...
languagestringlibraryId*stringquery*stringSponsors
CONTEXT7_API_KEYsecretAPI key for authentication
@upstash/context7-mcp