upstash avatar

Context7

upstash/context7Official

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.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
180
GitHub stars
64.7K
tools
2
auth
Secret needed
transport
STDIO, HTTP
env var
1
last updated
Nov 12, 2026

Install

From registry metadata
$ 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.

Other ways

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.

Tools

Verified live · 2 tools

Verified live against the running server on Nov 13, 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 params

Resolves 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...

Parameters* required
libraryName*string
Library name to search for and retrieve a Context7-compatible library ID. Use the official library name with proper punctuation — e.g., 'Next.js' instead of 'nextjs', 'Customer.io' instead of 'cust...
query*string
What to look up in the library's documentation. This is used to rank library results by relevance to what the user is trying to accomplish. The query is sent to the Context7 API for processing. Do...
query-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 params

Retrieves 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...

Parameters* required
languagestring
Programming language the user is writing code in, such as 'Python', 'TypeScript', 'Go', or 'C#'. Ranks code examples in that language first. Leave it out when the language is unknown or does not ap...
libraryId*string
Exact Context7-compatible library ID (e.g., '/mongodb/docs', '/vercel/next.js', '/supabase/supabase', '/vercel/next.js/v16.2.9') retrieved from 'resolve-library-id' or directly from user query in t...
query*string
What to look up in the library's documentation, scoped to a single concept. Be specific and include relevant details, but keep each query to one topic — if the user's question spans multiple distin...

Sponsors

Configuration

CONTEXT7_API_KEYsecret

API key for authentication

Readme

Details

Repository
github.com/upstash/context7
Website
context7.com
Package
@upstash/context7-mcp
Transport
STDIO, HTTP
Auth
Required
Registry
MCP registry, active
Tools verified
Nov 13, 2026