Skip to content
Context7 logo

Context7

Verified

Delivers up-to-date library docs directly into LLM prompts.

MCP ServerAI & KnowledgeLocal (stdio) 57.4k
View on GitHub
Updated 2026-06-15

What is the Context7 MCP server?

Context7 solves the problem of stale or hallucinated code suggestions by fetching current documentation for libraries like Next.js, Supabase, and Cloudflare Workers. Users trigger retrieval simply by including 'use context7' or a library ID in their prompt, after which relevant snippets and API references are added to the context window.

The platform works in MCP mode for native tool calls or CLI + Skills mode that guides agents without requiring an MCP connection. An optional API key from context7.com improves rate limits while the core service remains accessible for basic usage.

Install & connect

Add this to your MCP client config. Pick your client below and copy.

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "ctx7"
      ]
    }
  }
}

Package: ctx7 (npm)

Other ways to install

npx

npx
npx -y ctx7

Example prompts

Once connected, try asking your AI client:

Create a Next.js middleware that checks for a valid JWT in cookies and redirects unauthenticated users to /login. use context7
Show me the Supabase auth API for email/password sign-up.
Configure a Cloudflare Worker script to cache JSON API responses for five minutes. use context7
Implement basic authentication with Supabase. use library /supabase/supabase for API and docs.

Security & permissions

Stdio transport runs locally after ctx7 setup; remote MCP mode at mcp.context7.com requires an optional CONTEXT7_API_KEY header for authentication.

What you can do with Context7

Generate current API usage

Ask for Supabase email/password sign-up code and receive the latest method signatures instead of outdated examples.

Configure modern middleware

Request a Next.js JWT-checking middleware and obtain version-specific patterns that match the installed release.

Cache worker responses

Describe a Cloudflare Worker caching requirement and receive accurate, up-to-date script examples.

How to use Context7

  1. 1Install Node.js 18 or newer.
  2. 2Run npx ctx7 setup and follow OAuth prompts.
  3. 3Choose MCP mode during setup or configure the URL https://mcp.context7.com/mcp manually.
  4. 4Add 'use context7' or a library ID to prompts when documentation is needed.
  5. 5Optionally set rules in Cursor or Claude to auto-trigger Context7.

Context7: pros & cons

Pros

  • +Always supplies current, source-verified code examples
  • +Works across many languages and popular libraries
  • +Simple trigger phrase integrates into existing workflows
  • +Free tier available with optional paid rate-limit increases

Cons

  • Requires explicit trigger words or rules for best results
  • Library matching step can be skipped only when ID is known
  • Remote usage depends on network availability and rate limits
Did you find this helpful?

Frequently asked questions

No, but obtaining a free key from context7.com/dashboard raises rate limits.

User reviews

Verified reviews from the community shape this listing's rating.

Loading reviews…

Sign in to review

Promote Context7

Add this badge to your website, or share the tool.

DFeatured on DhanasviContext7 2