Cursor Setup
Install Context7 MCP Server in Cursor to get up-to-date documentation and code examples directly in your AI prompts.Prerequisites
- Cursor IDE version 1.0 or higher
- (Recommended) Free API key from context7.com/dashboard
While Context7 works without an API key, we recommend getting a free API key for higher rate limits.
Installation Methods
Cursor supports both remote and local MCP server connections. Choose the method that best fits your workflow:- Remote Server (Recommended)
- Local Server
- Project-Specific
Remote connection uses the hosted Context7 MCP server. No local installation required.
One-Click Install
Click the button below for instant installation:Manual Configuration
Add Configuration
Add the following to your
~/.cursor/mcp.json file:Replace
YOUR_API_KEY with your actual API key from context7.com/dashboardBenefits
- No local installation or dependencies
- Always running the latest version
- Reduced system resource usage
- Perfect for teams (consistent configuration)
Automated Setup
Use the Context7 CLI for automated setup:- Authenticates via OAuth
- Generates an API key
- Configures the MCP server
- Sets up recommended rules
Verify Installation
To verify Context7 MCP is working:Add a Rule (Recommended)
To avoid typinguse context7 in every prompt, add an automatic invocation rule:
Now Context7 will automatically activate for code-related questions.
Troubleshooting
MCP server not appearing in Cursor
MCP server not appearing in Cursor
- Verify the JSON syntax in your
mcp.jsonfile - Check that the file is in the correct location (
~/.cursor/mcp.json) - Restart Cursor completely
- Check Cursor’s output panel for error messages
Authentication errors
Authentication errors
- Verify your API key is correct (should start with
ctx7sk) - Ensure the API key is not expired
- Try regenerating your API key at context7.com/dashboard
Local server fails to start
Local server fails to start
- Ensure Node.js is installed (
node --version) - Clear npx cache:
npx clear-npx-cache - Try running manually:
npx -y @upstash/context7-mcp - Check for firewall or antivirus blocking npx
Rate limit errors
Rate limit errors
- Get a free API key at context7.com/dashboard
- Check your usage and quota
- Consider upgrading to a paid plan at context7.com/plans
Next Steps
Configuration
Learn about advanced configuration options
Tools Reference
Explore available MCP tools