MCP ConfigsApr 6, 2026·2 min read

Context7 — Live Library Docs for LLMs, 51K Stars

MCP server fetching up-to-date, version-specific library documentation into LLM context. Eliminates hallucinated APIs across 30+ AI coding tools.

TO
TokRepo精选 · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

Run the automated setup:

npx ctx7 setup

Or add to your .mcp.json manually:

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

Restart your AI tool and ask: "Using context7, look up the Next.js 14 App Router docs."


Intro

Context7 is an MCP server that fetches live, version-specific library documentation directly into your LLM's context window, with 51,700+ GitHub stars. It eliminates hallucinated or outdated APIs by pulling real-time docs from library sources. Works with 30+ coding clients including Claude Code, Cursor, GitHub Copilot, and Windsurf.

Best for: developers tired of AI hallucinating outdated API methods. Works with: Claude Code, Cursor, Copilot, Windsurf, 30+ tools. Setup time: under 1 minute.


Context7 — Real-Time Docs for AI

The Problem

LLMs frequently hallucinate API methods or reference outdated library versions. This leads to broken code and debugging time wasted on non-existent functions.

The Solution

Context7 fetches current documentation from the actual library source and injects it into your AI's context window, ensuring every code suggestion uses real, up-to-date APIs.

Two Operation Modes

  1. CLI + Skills — Use ctx7 commands directly
  2. MCP Server — Native integration into your coding agent

MCP Tools

Tool Description
resolve-library-id Match library names to Context7 identifiers
query-docs Fetch relevant documentation using a library ID

CLI Commands

# Find a library
ctx7 library nextjs "app router"

# Get specific docs
ctx7 docs nextjs-14 "server components"

Key Benefits

  • Version-specific: Request docs for Next.js 14, React 19, etc.
  • Real-time: Always fetches current documentation
  • Token-efficient: Only retrieves relevant sections, not entire docs
  • 30+ integrations: Works with practically any AI coding tool

FAQ

Q: What is Context7? A: Context7 is an MCP server that injects up-to-date, version-specific library documentation into AI coding tools, preventing hallucinated API suggestions.

Q: Is Context7 free? A: Yes, Context7 is open source under the MIT license.

Q: How do I add Context7 to Claude Code? A: Run npx ctx7 setup or add {"url": "https://mcp.context7.com/mcp"} to your .mcp.json under mcpServers.


🙏

Source & Thanks

Created by Upstash. Licensed under MIT.

context7 — ⭐ 51,700+

Thank you for solving the hallucinated API problem.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets