Documentation Index
Fetch the complete documentation index at: https://mintlify.com/upstash/context7/llms.txt
Use this file to discover all available pages before exploring further.
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
-
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
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
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
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
- 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
- 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
- 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
-
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
-
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
- 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
-
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
-
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
-
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
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
-
Ensure SDK types are installed:
-
Check SDK version (update to latest):
-
Use proper types:
- Check TypeScript version compatibility
SDK timeout errors
SDK timeout errors
-
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
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
-
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
-
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