context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
claude mcp add --transport stdio upstash-context7 npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
How to use
Context7 MCP is designed to provide up-to-date, version-specific documentation and code examples for libraries directly into your prompts. To utilize its capabilities, simply add 'use context7' to your prompt when asking for code generation or library documentation. For example, you can ask for a Next.js middleware implementation or a Cloudflare Worker script, and Context7 will fetch the relevant information without any need for tab-switching or outdated references. Additionally, you can set up rules in your MCP client to automatically invoke Context7 for code-related queries, streamlining your workflow.
How to install
To install Context7, ensure you have Node.js installed as a prerequisite. You can then use the following commands to set up the MCP server:
-
For Cursor:
- Go to
Settings->Cursor Settings->MCP->Add new global MCP server. - Paste the following configuration into your
~/.cursor/mcp.json:
{ "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"] } } } - Go to
-
For Claude Code:
- Run the command:
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY -
For Opencode:
- Add to your configuration file:
"mcp": { "context7": { "type": "local", "command": ["npx", "-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"], "enabled": true } }
Additional notes
It's recommended to obtain a free API key from context7.com/dashboard for higher rate limits. If you want to avoid typing 'use context7' in every prompt, consider adding a rule in your MCP client settings to automatically invoke Context7 for relevant queries. Additionally, you can specify a library ID or version in your prompt to get the most accurate documentation for your needs. If you encounter issues, ensure your API key is correctly configured and that you are using the appropriate endpoint for OAuth if needed.
Related MCP Servers
mcp-router
A Unified MCP Server Management App (MCP Manager).
mcp-graphql
Model Context Protocol server for GraphQL
mcp-echarts
🧬 Generate visual charts using ECharts with AI MCP dynamically, used for chart generation and data analysis.
Matryoshka
MCP server for token-efficient large document analysis via the use of REPL state
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)