Last month, we introduced Context7 - a way to stop Cursor, Claude or any LLM from generating broken, outdated code.
The idea: feed your LLM the latest documentation for the libraries you're using — so it doesn't rely on old training data.
Today, we're launching our biggest update yet: The Context7 MCP - a direct integration with Cursor, Windsurf, or any LLM client that supports the Model Context Protocol (MCP).
Why Context7 Exists
LLMs rely on outdated training data. When you're using newer versions of libraries or frameworks, they often hallucinate:
- ❌ Broken code from outdated versions
- ❌ Made-up APIs that never existed
- ❌ Vague answers that aren't helpful
For fast-moving libraries or frameworks like Next.js, Zod, Tailwind, or React Query, using LLMs by themselves doesn't work well.
Introducing: The Context7 MCP
In the first version of Context7, you had to copy a link from our site and paste it into your prompt. Now, just say “use context7” in Cursor — and you're done.
Examples:
- "How does the new Next.js
after()
function work? use context7" - "How do I invalidate a query in React Query? use context7"
- "Protect this route with NextAuth, use context7"
We fetch the latest docs and code examples straight from the official documentation and inject them into the model's context.
Just:
- 1️⃣ Write your prompt normally
- 2️⃣ Tell the LLM to use context7
- 3️⃣ Get working code in official-documentation quality
How It Works: Model Context Protocol (MCP)
The Context7 MCP uses the Model Context Protocol, Anthropic's Model Context Protocol, an open standard that lets LLMs talk to external tools like Context7.
When you add “use context7” (or something similar, like "get the docs using context7") to a prompt, we:
- Detect the library or framework you're asking about
- Pull the latest documentation & code examples
- Filter the documentation by topic (e.g. “routing”, “validation”, “middleware”)
- Inject it straight into the LLM's input
Getting Started
Requirements
- Node.js >= v18.0.0
- Cursor, Windsurf, Claude Desktop, or another MCP Client
Install in Cursor
Go to: Settings
-> Cursor Settings
-> MCP
-> Add new global MCP server
Or paste this into your Cursor ~/.cursor/mcp.json
file:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}
Install in Windsurf
Add this to your Windsurf MCP config file:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}
Try Context7 Today - It's Free
Context7 is built & maintained by the Upstash team and completely free to use. Try it out and we'd love to hear your feedback - we're working hard to improve it.
Have feedback or questions about the project? Let me know at josh@upstash.com or create an issue on GitHub.