mcpservers
Context7 MCP logo

Context7 MCP

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

Turn it on
“Context7 MCP fixed this — it pulls current docs straight into the prompt context.”
Blog · Dudarik

★ Hand-picked walkthrough

This MCP Server for AI Coding Assistants Will 10x Your Productivity

Cole Medin

  1. 1

    Turn on Context7 in your AI

    In Claude: open Settings → Connectors and add Context7. In ChatGPT: Settings → Apps & Connectors.

  2. 2

    Add it to your app once

    Copy the short config below into your app. It just tells your AI where to find Context7.

  3. 3

    Just ask

    Tell it what you want in plain words — no special commands.

    For example, say

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

Need the exact config? Show it +
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

Paste into your client's MCP configuration file.

Copy one, paste it to your AI, watch it work.

Version-Accurate Code Generation

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

API Reference Lookup

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

Migration Help

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

“The Context7 integration alone has saved me from countless "why doesn't this work?" moments where Claude gave me outdated syntax. Worth the five minutes of setup.”
Uses Context7 in Claude Code (VS Code) to get current library docs (e.g. React 19 useActionState) instead of stale training data.
Blog Shoaib Iqbal · 2026-02-06
“Context7 does not replace knowing Playwright. It gives the AI better context.”
Pairs Context7 MCP with Playwright MCP in Cursor to generate accurate Playwright tests against current docs and the real page.
Blog Muhammadjon Sanaev · 2026-05-23
  • · Not every library is indexed — less popular ones may fall back to the AI's memory
  • · Documentation freshness varies by project — active ones update fast, dormant ones lag
  • · You still need to verify generated code — Context7 reduces but doesn't eliminate hallucinations
  • 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

Imagine your AI always having the latest, accurate documentation for any library — so when you ask 'How do I use useSyncExternalStore in React 19?' it reads the real React 19 docs instead of making things up. This server connects your AI to Context7's always-current library documentation index.

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.

Claude Cursor Windsurf Cline
#documentation#libraries#context#code-accuracy
What does Context7 MCP do? +

Imagine your AI always having the latest, accurate documentation for any library — so when you ask 'How do I use useSyncExternalStore in React 19?' it reads the real React 19 docs instead of making things up. This server connects your AI to Context7's always-current library documentation index.

Do I need to know how to code? +

No. Turn it on in your AI's settings and ask in plain English — no terminal, no coding.

When should I use Context7 MCP? +

Reach for it when you need to: 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.

When should I avoid Context7 MCP? +

Skip it when: 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.

How do I install Context7 MCP? +

In Claude Code, run: claude mcp add context7 -- npx -y @upstash/context7-mcp. Copy-paste configs for Claude Desktop, Cursor, and Windsurf are at the top of this page.