Context7 MCP Server
Context7 by Upstash injects up-to-date, version-specific documentation and code examples for thousands of libraries directly into an LLM's context at query time, eliminating hallucinated or outdated APIs. Agents resolve a library name to a Context7 ID and then pull current docs scoped to the task at hand.
Install Context7
- Published by
- Official (vendor)
- Transport
- Remote (HTTP)
- Authentication
- API key
- Package
- ctx7
Claude Desktop, Claude Code and Cursor
Add this to the mcpServers object in your client's
config file, then restart the client.
{
"mcpServers": {
"context7": {
"type": "http",
"url": "https://mcp.context7.com/mcp"
}
}
}
VS Code uses a different key — show that config
Identical entry, filed under servers rather than
mcpServers. Put it in
.vscode/mcp.json for one workspace.
{
"servers": {
"context7": {
"type": "http",
"url": "https://mcp.context7.com/mcp"
}
}
}
Before it will answer
Works without a key at a lower rate limit; a free key from context7.com/dashboard raises it, sent as `Authorization: Bearer <key>`. `npx ctx7 setup` will configure your clients and walk the OAuth flow rather than making you paste the key.
Tools
get-library-docs
Fetch up-to-date, version-specific documentation for a resolved library ID.
resolve-library-id
Resolve a plain library name to a Context7-compatible library ID.