How to Install Context7 MCP Server
Complete installation guide for all supported AI coding assistants
Installation Overview
Installing Context7 MCP Server is a straightforward process that typically takes less than five minutes. Context7 supports all major MCP-compatible AI coding assistants including Cursor, VS Code, Claude Desktop, and Windsurf.
Before installing, make sure you have Node.js version 18 or higher installed on your system.
Automatic Installation (Recommended)
The fastest and easiest way to install Context7 is using the automatic installer:
npx @upstash/context7-mcp@latest init Client-Specific Installation
# For Cursor
npx @upstash/context7-mcp@latest init --cursor
# For Claude Desktop
npx @upstash/context7-mcp@latest init --claude
# For VS Code
npx @upstash/context7-mcp@latest init --vscode
# For Windsurf
npx @upstash/context7-mcp@latest init --windsurf Manual Installation for Cursor
Step 1: Locate the Configuration File
Cursor stores its MCP configuration in a JSON file:
- macOS: ~/.cursor/mcp.json
- Windows: %USERPROFILE%\.cursor\mcp.json
- Linux: ~/.cursor/mcp.json
Step 2: Add Context7 Configuration
Open the mcp.json file and add Context7 to the mcpServers object. The configuration should include:
- Server name:
context7 - Command:
npx - Args:
["-y", "@upstash/context7-mcp@latest"]
Step 3: Add API Key (Optional but Recommended)
For better rate limits, add an env section with your CONTEXT7_API_KEY from the Context7 dashboard.
Step 4: Restart Cursor
After saving your configuration, restart Cursor to apply the changes.
Manual Installation for VS Code
Step 1: Install MCP Extension
Install an MCP client extension for VS Code from the marketplace by searching for "MCP" or "Model Context Protocol".
Step 2: Configure Context7
Add Context7 to your VS Code settings.json under mcp.servers with the same configuration as Cursor.
Step 3: Reload VS Code
Use Command Palette (Ctrl+Shift+P) and select "Developer: Reload Window".
Manual Installation for Claude Desktop
Step 1: Locate Claude Configuration
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%\Claude\claude_desktop_config.json
Step 2: Add Context7 Server
Add Context7 to the mcpServers object in the configuration file.
Step 3: Restart Claude Desktop
Quit and restart Claude Desktop to load the new configuration.
Manual Installation for Windsurf
Windsurf uses a similar configuration approach. Check Windsurf documentation for the exact configuration file location, then add Context7 to the mcpServers object.
Getting Your API Key
While Context7 works without an API key, we recommend getting one:
- Visit context7.com/dashboard
- Create a free account or sign in
- Copy your API key from the dashboard
- Add it to your MCP configuration in the env section
Benefits of Using an API Key
- Higher Rate Limits: Significantly more requests allowed
- Usage Analytics: Track your documentation requests
- Priority Access: During high-traffic periods
- Support: Access to support channels
Verifying Your Installation
After installing Context7, verify it is working by asking your AI assistant a question about a specific library, such as "How do I set up server actions in Next.js 15?" If Context7 is working, the response should be accurate and up-to-date.
Troubleshooting
Context7 Not Loading
- Verify Node.js is installed (run node --version)
- Check that your configuration file has valid JSON syntax
- Ensure you restarted your AI client after configuration
- Check for typos in the configuration
Rate Limit Errors
Get a free API key from the Context7 dashboard for higher limits.
Updating Context7
Because Context7 uses npx with the @latest tag, it automatically uses the latest version each time. No manual updates needed.