
How to add Context7 MCP Server to Claude Desktop
Up-to-date, version-specific library documentation injected into your coding agent. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 15, 2026 ยท 28kโ ยท stdio ยท apikey ยท official
Claude Desktop config for Context7 MCP Server
npx -y @upstash/context7-mcp{
"mcpServers": {
"context7-mcp-server": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp"
],
"env": {
"CONTEXT7_API_KEY": "<optional-your-context7-api-key>"
}
}
}
}Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the Context7 MCP Server config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm Context7 MCP Server's tools appear under the ๐ tools menu.
Before you start
- Node.js 18 or newer (for the local stdio server via npx)
- An MCP-capable client (Cursor, Claude Code, Claude Desktop, VS Code, Windsurf, OpenCode, and 30+ others)
- A free Context7 API key from https://context7.com/dashboard for higher rate limits (optional but recommended; passed via the CONTEXT7_API_KEY header or --api-key)
What Context7 MCP Server can do in Claude Desktop
resolve-library-idResolves a plain library name into a Context7-compatible ID (e.g. next.js -> /vercel/next.js), ranking matches by trust score and doc coverage.
query-docsFetches up-to-date, version-specific documentation and code examples for a given Context7 library ID and topic/query (current upstream tool name; some clients/mirrors expose it as get-library-docs).
Security
Basic use needs no credentials; an optional CONTEXT7_API_KEY only raises rate limits and should be kept secret. The server fetches third-party documentation, so treat returned content as untrusted input.
Context7 MCP Server + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the Context7 MCP Server config there under the "mcpServers" key and restart the client.
Is Context7 MCP Server safe to use with Claude Desktop?
Basic use needs no credentials; an optional CONTEXT7_API_KEY only raises rate limits and should be kept secret. The server fetches third-party documentation, so treat returned content as untrusted input.
Do I need an API key?
You can use Context7 without one, but a free key from context7.com/dashboard raises rate limits and is recommended; pass it via the CONTEXT7_API_KEY header or --api-key flag.
Can I run it remotely instead of installing it?
Yes. Point your client at the hosted endpoint https://mcp.context7.com/mcp and supply your API key in the header, no local Node required.
What's the resolve-library-id step for?
It maps a human library name to a precise Context7 ID. You must call it before fetching docs unless you already pass an ID in /org/project or /org/project/version form.