Overview
This guide covers common issues you might encounter with Context7 MCP server and SDK, along with solutions.Installation Issues
MCP server not appearing in Cursor
MCP server not appearing in Cursor
Symptoms: Context7 doesn’t show up in Cursor’s MCP server list.Solutions:
-
Verify your
~/.cursor/mcp.jsonconfiguration: - Check for JSON syntax errors (trailing commas, missing quotes)
- Restart Cursor completely
-
Try the local server connection instead:
- Check Cursor’s MCP logs in Settings > Output > Model Context Protocol
Context7 not working in Claude Code
Context7 not working in Claude Code
Symptoms:
claude mcp add command fails or Context7 doesn’t work.Solutions:-
Verify the command syntax:
- Check Claude Code version (requires Claude Code 1.0+)
-
Try the remote server connection:
-
List MCP servers to verify installation:
-
Check logs:
npm/npx errors during installation
npm/npx errors during installation
Symptoms:
npx @upstash/context7-mcp fails with errors.Solutions:-
Update npm:
-
Clear npm cache:
-
Try installing globally first:
-
Check Node.js version (requires Node 18+):
- Use the remote server connection to avoid npm issues
Using ctx7 setup command fails
Using ctx7 setup command fails
Symptoms:
npx ctx7 setup fails or doesn’t configure properly.Solutions:-
Ensure you’re running the latest version:
-
Try targeting a specific client:
-
Use an existing API key instead of OAuth:
- Check file permissions on config directories
- Run with verbose output to see detailed errors
API Key Issues
Invalid API key error
Invalid API key error
Symptoms: “Invalid API key” or “Unauthorized” errors.Solutions:
- Verify your API key format (should start with
ctx7sk-) - Check for extra spaces or quotes around the key
- Get a new API key from context7.com/dashboard
- Ensure the key is in the correct configuration field:
- Remote:
headers.CONTEXT7_API_KEY - Local:
--api-keyargument
- Remote:
- Try regenerating your API key on the dashboard
Rate limit exceeded
Rate limit exceeded
Symptoms: “Rate limit exceeded” errors.Solutions:
- Get an API key if you’re using Context7 without one
- Upgrade your plan at context7.com/dashboard
- Reduce the frequency of requests
- Implement caching in SDK usage:
- Wait a few minutes before retrying
API key not being used
API key not being used
Symptoms: Context7 works but shows free tier limits.Solutions:
- Verify the key is in the correct location in your config
- Restart your MCP client after adding the key
- Check that the header name is exactly
CONTEXT7_API_KEY - For local connections, ensure
--api-keyflag is present - Check MCP server logs to see if the key is being sent
Query and Response Issues
Context7 returns wrong library
Context7 returns wrong library
Symptoms: Getting documentation for a different library than requested.Solutions:
-
Use the library ID syntax:
-
Be more specific in your prompt:
- Check if the library exists on context7.com
-
Verify the library ID format:
- Correct:
/facebook/react - Incorrect:
facebook/react,/react,React
- Correct:
Getting outdated documentation
Getting outdated documentation
Symptoms: Documentation doesn’t match current library version.Solutions:
-
Specify the version in your prompt:
-
Request latest version explicitly:
- Report the issue on context7.com to trigger a re-crawl
- Check when the library was last updated on Context7
No results or empty response
No results or empty response
Symptoms: Context7 returns no documentation.Solutions:
- Check if the library is indexed on context7.com
-
Try a broader search:
-
Search for the library first:
- Submit the library if it’s not indexed: See Adding Libraries guide
Context7 not being invoked automatically
Context7 not being invoked automatically
Symptoms: Rule is set up but Context7 doesn’t activate.Solutions:
-
Verify your rule configuration:
- Cursor:
Settings > Rules - Claude Code: Check
CLAUDE.mdexists
- Cursor:
-
Make the rule more explicit:
- Restart your MCP client
-
Temporarily add
use context7manually while debugging - Check if other rules are conflicting
Slow response times
Slow response times
Symptoms: Context7 takes a long time to respond.Solutions:
-
Use library IDs to skip search step:
-
Switch to remote server if using local:
- Check your internet connection
- Verify API key is being used (authenticated requests are faster)
- Try during off-peak hours if experiencing widespread slowness
SDK Issues
SDK import errors
SDK import errors
Symptoms: Cannot import Context7 SDK.Solutions:
-
Verify installation:
-
Reinstall the SDK:
-
Check import syntax:
- Ensure TypeScript/Node version compatibility
-
Clear node_modules and reinstall:
Environment variable not loading
Environment variable not loading
Symptoms:
CONTEXT7_API_KEY env var not found.Solutions:-
Verify
.envfile location (should be in project root) -
Load env vars in your code:
-
Check env var name (must be exactly
CONTEXT7_API_KEY) - Restart your development server after adding env vars
-
Pass API key directly if env vars aren’t working:
TypeScript type errors
TypeScript type errors
Symptoms: Type errors when using the SDK.Solutions:
-
Ensure SDK types are installed:
-
Check SDK version (update to latest):
-
Use proper types:
- Check TypeScript version compatibility
SDK timeout errors
SDK timeout errors
Symptoms: Requests timing out.Solutions:
-
Increase timeout (SDK default is usually sufficient):
- Check network connectivity
- Verify Context7 API status
- Try with a simpler query to isolate the issue
- Use library IDs to speed up queries
Connection Issues
Remote server connection fails
Remote server connection fails
Symptoms: Cannot connect to
https://mcp.context7.com/mcp.Solutions:- Check internet connectivity
- Verify the URL is correct (no typos)
-
Try the OAuth endpoint:
- Check if your firewall is blocking the connection
-
Try local server connection as fallback:
Local server connection fails
Local server connection fails
Symptoms: Local MCP server won’t start.Solutions:
-
Verify Node.js is installed:
-
Check npm can access the package:
-
Clear npx cache:
-
Try installing globally:
Then use:
- Switch to remote server connection
OAuth authentication issues
OAuth authentication issues
Symptoms: OAuth flow fails or doesn’t complete.Solutions:
-
Ensure your MCP client supports OAuth:
- Check MCP OAuth specification
-
Verify OAuth endpoint URL:
- Clear browser cookies and try again
-
Use API key authentication instead:
- Contact Context7 support if OAuth is required for your use case
Getting Help
If you’re still experiencing issues:Check Documentation
Browse the full Context7 documentation.
Join Discord
Get help from the community.
GitHub Issues
Report bugs or request features.
Contact Support
Reach out to the Context7 team.
Diagnostic Checklist
Before reporting an issue, gather this information:Next Steps
Best Practices
Learn how to use Context7 effectively.
Using Rules
Set up automatic Context7 invocation.