mcpservers.md

Context7 MCP

Context7 documentation server — inject up-to-date library documentation directly into AI context for accurate, version-specific code.

TRUSTED · Security verified
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

Paste into your client's MCP configuration file.

"Look up the current Next.js App Router documentation for server actions and explain it"

Easy Setup

API key or simple config

Light usage
  • You want your AI to write code against the actual latest API of a library
  • You keep hitting hallucinated function names or outdated patterns
  • You're using a library that changed significantly between versions
  • You're learning a new library and want your AI to reference real docs
  • You're using a proprietary or private library not indexed by Context7
  • You're offline — this needs network access to Context7's index
  • You already have exhaustive docs in your codebase — use a local RAG instead
1

Version-Accurate Code Generation

Generate code using the actual current API of a library, not a hallucinated one.

"Write a Next.js 15 Server Component that fetches data using the latest recommended pattern"

2

API Reference Lookup

Answer questions about specific functions or hooks with verified documentation.

"What's the correct signature and usage for useActionState in React 19?"

3

Migration Help

Help migrate code between versions using real release notes and docs.

"Help me migrate this Prisma 4 schema to Prisma 6 — use the real migration guide"

AI assistants are great at writing code — until the library you're using has changed since the AI was trained. Then you start getting answers that look right but reference functions that no longer exist, or use old patterns the docs say not to use anymore. It's confusing and slow. This server fixes that by giving your AI a live library card. Whenever you mention a tool — React, Next.js, Prisma, Tailwind, hundreds more — Context7 looks up the actual current documentation for that library and slides it into the conversation before the AI writes any code. The result: code generated against the real, current API, not a hazy memory of how things used to work two years ago. For someone learning a new framework, this means examples that match the tutorials you read on the official site. For someone migrating between versions, the AI reads the real migration guide instead of guessing. It won't fix every wrong answer — you still review the code — but it cuts down on the most frustrating kind of mistake: confidently wrong API calls.

The Context7 MCP server resolves library names to current documentation and injects relevant code examples directly into your AI's context. Eliminates hallucinated API calls by providing accurate, version-specific documentation.

Particularly valuable for working with rapidly evolving libraries where LLM training data may be outdated. Supports thousands of popular libraries.

GitHub 4.2kUpdated Feb 15, 2025MIT
Claude Cursor Windsurf Cline
#documentation#libraries#context#code-accuracy