context7
Fetches current, version specific documentation and code examples for a library, so the agent stops working from stale training data.
Claude Code
> /plugin marketplace add solanabr/ai-kit> /plugin install solana-ai-kit@stbr
Codex
$ codex mcp add context7 -- npx -y @upstash/context7-mcp@4.1.1
Cursor
{ "mcpServers": { "context7": { "command": "npx", "args": [ "-y", "@upstash/context7-mcp@4.1.1" ] } } }
Add it to mcp.json.
Gemini CLI
{ "mcpServers": { "context7": { "command": "npx", "args": [ "-y", "@upstash/context7-mcp@4.1.1" ] } } }
Add it to settings.json.
GitHub Copilot
$ copilot mcp add context7 -- npx -y @upstash/context7-mcp@4.1.1
OpenCode
{ "mcp": { "context7": { "type": "local", "command": [ "npx", "-y", "@upstash/context7-mcp@4.1.1" ] } } }
Add it to opencode.json.
Windsurf
{ "mcpServers": { "context7": { "command": "npx", "args": [ "-y", "@upstash/context7-mcp@4.1.1" ] } } }
Add it to mcp_config.json.
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
Low risk
Known flaws
None known
Signed build
No
No build provenance published
Maintained
Oct 27, 2026
Last push
Licence
MIT
Runs as
npx
On your machine
Deprecated
No
Signals from public registries, not an audit. Checked Nov 12, 2026.
context7 README

Context7 MCP - Up-to-date Docs for AI Agents
❌ 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 context7in 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 > Rulessection- For Claude Code, in
CLAUDE.mdfile- 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
{
"mcpServers": {
"context7": {
"url": "https://mcp.context7.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Cursor Local Server Connection
{
"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 userto 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
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:
- Open Cline.
- Click the hamburger menu icon (☰) to enter the MCP Servers section.
- Use the search bar within the Marketplace tab to find Context7.
- Click the Install button.
Or you can directly edit MCP servers configuration:
- Open Cline.
- Click the hamburger menu icon (☰) to enter the MCP Servers section.
- Choose Remote Servers tab.
- Click the Edit Configuration button.
- 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
-
Click the hamburger menu.
-
Select Settings.
-
Navigate to the Tools section.
-
Click the + Add MCP button.
-
Enter the following command:
npx -y @upstash/context7-mcp@latest -
Name the MCP: Context7.
-
Click the Add button.
Claude Code, set up to ship on Solana. Not programs alone — the whole lifecycle: validating the idea, building the program and the app around it, shipping it, and the launch and growth work that follows.
More MCP servers from other plugins.
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 these in order, one at a time. 1. In Claude Code: /plugin marketplace add solanabr/ai-kit 2. In Claude Code: /plugin install solana-ai-kit@stbr
- Is context7 safe to install?
- Low risk. Signals from public registries, not an audit.

