Context7 MCP Server + Cursor IDE Setup (2026)
Add Context7 MCP to Cursor IDE for real-time library docs in AI chat. Full setup guide with mcp.json config, troubleshooting tips, and verification steps.
Context7 MCP Server: Cursor IDE Setup Guide (2026)
Context7 is one of the most useful MCP servers for developers. It gives Cursor IDE access to up-to-date, version-specific documentation for thousands of libraries — so your AI stops hallucinating outdated APIs and starts giving you accurate code.
Why Context7?
Without Context7, Cursor's AI uses its training data to answer questions about libraries. That data has a cutoff date, so it often suggests deprecated methods or APIs that no longer exist.
With Context7, Cursor pulls real, live docs on demand:
Prerequisites
Setup (Under 2 Minutes)
Open Cursor → Settings (Cmd/Ctrl + ,) → Search "MCP" → Edit MCP Settings
Add this:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp@latest"]
}
}
}
That's it. No API key, no account, no configuration. Restart Cursor and it's live.
How to Use It
In the Cursor AI chat, just ask naturally. Context7 activates automatically when you ask about libraries:
"use context7 - how do I set up middleware in Next.js 15?"
"use context7 - what's the correct syntax for drizzle-orm joins?"
"use context7 - show me how to use Zod v3 schema inference"
Adding "use context7" as a hint helps Cursor know to reach for the MCP server, but it often triggers automatically for library questions.
Supported Libraries
Context7 covers thousands of popular libraries including:
Combining With Other Servers
Context7 pairs perfectly with a filesystem or GitHub server:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp@latest"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}
Now Cursor can look at your actual code AND get accurate library docs at the same time.
Troubleshooting
Cursor doesn't seem to use Context7 — Try explicitly adding "use context7" in your prompt.
Slow responses — Context7 fetches docs in real time, so the first response for a library may take a few seconds.