Skip to content
Automation
MCP

context7

Fetches current, version specific documentation and code examples for a library, so the agent stops working from stale training data.

From plugin
ralph-loop
3423 MCP

Claude Code

$ claude mcp add context7 -- npx -y @upstash/context7-mcp

From the README

What can you do with context7?

  • resolve-library-id

    Resolves a general library name into a Context7-compatible library ID.

  • query-docs

    Queries up-to-date documentation and code examples for a Context7-compatible library ID.

  • query-code (research preview)

    Searches and reads a library's source code at the version its docs describe, like ripgrep and go-to-definition on a checkout of that version.

Security report

Found

Low risk

  • Known flaws

    None known

  • Signed build

    No

    No build provenance published

  • Maintained

    Aug 31, 2026

    Last push

  • Licence

    MIT

  • Runs as

    npx

    On your machine

  • Deprecated

    No

Signals from public registries, not an audit. Checked Nov 15, 2026.

context7 README

Cover

Install MCP Server Install in VS Code (npx)

Context7 MCP - Up-to-date Docs for AI Agents

Website NPM Version MIT licensed

繁體中文 简体中文 日本語 한국어 문서 Documentación en Español Documentation en Français Documentação em Português (Brasil) Documentazione in italiano Dokumentasi Bahasa Indonesia Dokumentation auf Deutsch Документация на русском языке Українська документація Türkçe Doküman Arabic Documentation Tiếng Việt

❌ Without Context7

LLMs rely on outdated or generic information about the libraries you use. You get:

  • ❌ Code examples are outdated and based on year-old training data
  • ❌ Hallucinated APIs that don't even exist
  • ❌ Generic answers for old package versions

✅ With Context7

Context7 MCP pulls up-to-date, version-specific documentation and code examples straight from the source — and gives them to your coding agent.

Add use context7 to your prompt (or set up a rule to auto-invoke):

Create a Next.js proxy that checks for a valid JWT in cookies
and redirects unauthenticated users to `/login`. use context7
Configure a Cloudflare Worker script to cache
JSON API responses for five minutes. use context7

Context7 fetches up-to-date code examples and documentation right into your coding agent's context.

  • 1️⃣ Write your prompt naturally
  • 2️⃣ Tell the LLM to use context7 (or set up a rule once)
  • 3️⃣ Get working code answers

No tab-switching, no hallucinated APIs that don't exist, no outdated code generation.

Note This repository hosts the source code of Context7 MCP server. The supporting components — API backend, parsing engine, and crawling engine — are private and not part of this release.

📚 Adding Projects

Check out our project addition guide to learn how to add (or update) your favorite libraries to Context7.

🛠️ Installation

Requirements

  • Node.js >= v20.18.1
  • Cursor, Claude Code, VSCode, Devin Desktop or another MCP Client
  • Context7 API Key (Optional) for higher rate limits and private repositories (Get yours by creating an account at context7.com/dashboard)

Tip Recommended Post-Setup: Add a Rule to Auto-Invoke Context7

After installing Context7 (see instructions below), enhance your workflow by adding a rule so you don't have to type use context7 in every prompt. Define a simple rule in your MCP client's rule section to automatically invoke Context7 on any code question:

  • For Devin Desktop, in .devin/rules/ directory
  • For Cursor, from Cursor Settings > Rules section
  • For Claude Code, in CLAUDE.md file
  • Or the equivalent in your MCP client

Example Rule:

Always use context7 when I need code generation, setup or configuration steps, or
library/API documentation. This means you should automatically use the Context7 MCP
tools to resolve library id and get library docs without me having to explicitly ask.

From then on, you'll get Context7's docs in any related conversation without typing anything extra. You can alter the rule to match your use cases.

Installing via Smithery

To install Context7 MCP Server for any client automatically via Smithery:

npx -y @smithery/cli@latest install @upstash/context7-mcp --client <CLIENT_NAME> --key <YOUR_SMITHERY_KEY>

You can find your Smithery key in the Smithery.ai webpage.

Install in Cursor

Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server

Pasting the following configuration into your Cursor ~/.cursor/mcp.json file is the recommended approach. You may also install in a specific project by creating .cursor/mcp.json in your project folder. See Cursor MCP docs for more info.

Since Cursor 1.0, you can click the install button below for instant one-click installation.

Cursor Remote Server Connection

Install MCP Server

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
Cursor Local Server Connection

Install MCP Server

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Install in Claude Code

Run this command. See Claude Code MCP docs for more info.

Claude Code Local Server Connection
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
Claude Code Remote Server Connection
claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp

Remove --scope user to install for the current project only.

Install in Amp

Run this command in your terminal. See Amp MCP docs for more info.

With OAuth
amp mcp add context7 https://mcp.context7.com/mcp/oauth
With API Key (Higher Rate Limits & Private Repos)
amp mcp add context7 --header "Authorization=Bearer YOUR_API_KEY" https://mcp.context7.com/mcp

Install in Devin Desktop

Add this to your Devin Desktop MCP config file. See Devin Desktop MCP docs for more info.

Devin Desktop Remote Server Connection
{
  "mcpServers": {
    "context7": {
      "serverUrl": "https://mcp.context7.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
Devin Desktop Local Server Connection
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Install in VS Code

Install in VS Code (npx)

Install in VS Code Insiders (npx)

Add this to your VS Code MCP config file. See VS Code MCP docs for more info.

VS Code Remote Server Connection
"mcp": {
  "servers": {
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
VS Code Local Server Connection
"mcp": {
  "servers": {
    "context7": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Install in Cline

You can easily install Context7 through the Cline MCP Server Marketplace by following these instructions:

  1. Open Cline.
  2. Click the hamburger menu icon (☰) to enter the MCP Servers section.
  3. Use the search bar within the Marketplace tab to find Context7.
  4. Click the Install button.

Or you can directly edit MCP servers configuration:

  1. Open Cline.
  2. Click the hamburger menu icon (☰) to enter the MCP Servers section.
  3. Choose Remote Servers tab.
  4. Click the Edit Configuration button.
  5. Add context7 to mcpServers:
{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp",
      "type": "streamableHttp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Install in Zed

It can be installed via Zed Extensions or you can add this to your Zed settings.json. See Zed Context Server docs for more info.

{
  "context_servers": {
    "Context7": {
      "source": "custom",
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
    }
  }
}

Install in Augment Code

To configure Context7 MCP in Augment Code, you can use either the graphical interface or manual configuration.

A. Using the Augment Code UI

  1. Click the hamburger menu.

  2. Select Settings.

  3. Navigate to the Tools section.

  4. Click the + Add MCP button.

  5. Enter the following command:

    npx -y @upstash/context7-mcp@latest
    
  6. Name the MCP: Context7.

  7. Click the Add button.

@pageai-pro
Ships withralph-loop

📚 Full docs: ralphloop.sh Ralph is a long-running AI agent loop. Ralph automates software development tasks by iteratively working through a task list until completion.

Stars on GitHub

Momentum

stars in total
342
Star history of PageAI-Pro/ralph-loop on GitHub, a chart by star-history.com

More MCP servers from other plugins.

playwright

playwright

MCP

Drives a real browser so the agent can open pages, click, fill forms and read what actually rendered.

@windmill-labs@windmill-labsInstall MCP
pinchtab

pinchtab

MCP

Ships with pinchtab: High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection…

@pinchtab@pinchtabInstall MCP
open-computer-use

open-computer-use

MCP

Ships with open-computer-use: open-computer-use is an open-source Computer Use service wrapped as MCP. Any AI agent or MCP client…

@ifuryst@ifurystInstall MCP
atlas

atlas

MCP

Ships with babysitter: Enforce obedience on agentic workforces. Manage extremely complex workflows through deterministic,…

babysitter13d1.9k
@a5c-ai@a5c-aiInstall MCP

Questions about context7.

Which coding agents can use context7?
context7 works in any agent that reads an MCP config file: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf. Each agent reads it from its own file; this page names the file for each one.
How do I add context7 to Claude Code?
Run this in your terminal: claude mcp add context7 -- npx -y @upstash/context7-mcp
Is context7 safe to install?
Low risk. Signals from public registries, not an audit.