MCP servers / Context7
Context7 MCP server: setup for Claude Code, Claude Desktop and Cursor
Context7 gives your AI current documentation and code examples for libraries and frameworks, so it stops guessing at APIs from memory. It has two tools: one finds the right library, the other pulls the relevant docs.
The server also tells the AI when to use it. Its built-in instructions say to reach for it whenever you ask about a library, framework, SDK, API or CLI tool, and to prefer it over a web search for library docs.
- Runs with
- npx (Node.js)
- Package
- @upstash/context7-mcp on npm
- Needs
- Node.js (for npx). No account needed to start.
- Tools
- 2 (2 read-only)
- Source
- upstash/context7
- Last checked
- 2026-09-20 (server reported version 4.1.1)
Config for Context7
Generated by the same code as the free builder, so it matches what you get there. Pick your client, then copy.
Works without a key. A free API key from context7.com raises the rate limits.
Claude Code
Save as .mcp.json in your project root. Claude Code asks you to approve it the first time.
{
"mcpServers": {
"context7": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp"
]
}
}
}
Or add it from a terminal instead (single quotes work in bash, zsh and PowerShell; more on this command):
claude mcp add context7 -- npx -y @upstash/context7-mcp
Claude Desktop
Merge into claude_desktop_config.json (Settings → Developer → Edit Config), then fully quit and restart Claude Desktop.
{
"mcpServers": {
"context7": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp"
]
}
}
}
Cursor
Save as .cursor/mcp.json in your project, or ~/.cursor/mcp.json for all projects.
{
"mcpServers": {
"context7": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp"
]
}
}
}
What it can do
These are all 2 tools the server reported when we started it and asked on 2026-09-20. The labels come from the hints each tool declares about itself.
resolve-library-idread-only
Resolves a package/product name to a Context7-compatible library ID and returns matching libraries.query-docsread-only
Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework.
Watch out for
- It works without a key. A free API key from context7.com raises the rate limits. The README's way to use a key with this setup is a
--api-keyargument, which puts the key in your config file, so keep that file private and out of git. - Your questions go to Context7's service to fetch the docs. Ask about libraries, and keep private code and secrets out of what you ask it to look up.
- Both tools only read, so it is one of the lower-risk servers to install.
Try asking
- “Using Context7, show me how to set up middleware in the current version of Next.js.”
- “Look up the migration guide from Prisma 5 to the latest version and list the breaking changes.”
- “What is the recommended way to handle form validation in this library? Check the docs first.”
Related servers
- Playwright: Drive a real browser to test pages and take screenshots.
- Fetch: Download a web page and convert it to readable text.
Building a full setup? Combine this with other servers in the config builder. Trouble connecting? See fixing connection errors.