Context7 MCP for Cursor
Supercharge Cursor's AI with accurate documentation
Why Use Context7 with Cursor?
Cursor is one of the most popular AI-powered code editors. By adding Context7 MCP Server, you dramatically improve the accuracy of AI-generated code by giving Cursor access to real-time documentation for over 9,000 libraries.
Key Benefits
- Accurate Code Generation based on current documentation
- Fewer Debugging Sessions fixing hallucinated code
- Learn Current Best Practices when exploring libraries
- Version-Aware Assistance matching your project
Quick Installation
npx @upstash/context7-mcp@latest init --cursor This command automatically configures Context7 for Cursor. After running it, restart Cursor.
Manual Installation
Edit your Cursor MCP configuration file at ~/.cursor/mcp.json (macOS/Linux) or %USERPROFILE%\.cursor\mcp.json (Windows).
Add Context7 to the mcpServers section with:
- Server name: context7
- Command: npx
- Args: -y @upstash/context7-mcp@latest
- Optional: Add CONTEXT7_API_KEY in env section
After saving, restart Cursor to apply changes.
Using Context7 in Cursor
Once configured, use Cursor normally. When you ask about libraries, Context7 automatically provides current documentation. Try asking:
- "How do I implement authentication in Next.js 15?"
- "Show me how to use React Query for data fetching"
- "How do I configure Tailwind CSS v4?"
Tips for Better Results
- Be Specific: Name the library explicitly
- Mention Versions: Specify version when relevant
- Ask About Features: Focus on specific functionality
Troubleshooting
If Context7 is not working: verify JSON syntax in config file, ensure Node.js is installed, restart Cursor after changes, and check for typos in configuration.
Ready to Enhance Cursor?
Install in one command and get accurate AI-generated code.
Get Started Free