context7
БесплатноБез исполняемых скриптовНе проверенContext7 fetches current, version-specific documentation and code examples for software libraries and hands them to an AI coding agent, so generated code…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Context7 — Current library documentation for AI coding agents
Overview
Context7 is a hosted index of library documentation built from public repositories and documentation sites. An agent reaches it in two ways: the ctx7 command-line tool, or an MCP server (hosted at https://mcp.context7.com/mcp, or run locally from the @upstash/context7-mcp package). A lookup always has two steps: resolve a library name to a Context7 library ID, then ask a question against that ID. The answer is a set of code snippets and short explanations, each with a link to the source file it came from.
Instructions
Installation
One command configures an agent. It signs in through a device-code flow (a link and a short code, so it also works over SSH), creates an API key, and writes the configuration.
# Interactive: choose MCP or CLI + Skills, then the agent
npx ctx7 setup
# CLI + Skills mode: installs a docs skill that calls the ctx7 CLI
npx ctx7 setup --cli --claude
npx ctx7 setup --cli --codex
# MCP mode: registers the MCP server in the agent's config
npx ctx7 setup --mcp --cursor
# Current project only (the default is global), no confirmation prompts
npx ctx7 setup --mcp --claude --project --yes
# Optional: install the CLI globally to drop the npx prefix
npm install -g ctx7
setup accepts an agent flag: --claude, --cursor, --codex, --gemini, --copilot, --vscode, --opencode, --antigravity or --devin. In MCP mode it registers the hosted server; add --stdio to run the server as a local process instead.
To reuse an existing key instead of signing in, create one at https://context7.com/dashboard, export it as CONTEXT7_API_KEY, and pass it:
npx ctx7 setup --mcp --claude --api-key "$CONTEXT7_API_KEY"
Undo with npx ctx7 remove (add --claude, --cursor, --mcp or --cli to narrow it).
Look up documentation from the terminal
# Step 1: find the library ID. The query ranks the candidates.
ctx7 library next.js "redirect unauthenticated users to the login page"
# Step 2: ask the question against the ID
ctx7 docs /vercel/next.js "redirect unauthenticated users to the login page"
# A specific version, taken from the Versions column of step 1
ctx7 docs /vercel/next.js/v15.1.8 "redirect unauthenticated users to the login page"
# JSON for scripts (the first row is the top-ranked match, not necessarily the official repository)
ctx7 library next.js "redirect unauthenticated users to the login page" --json | jq '.[0].id'
ctx7 docs /vercel/next.js "redirect unauthenticated users to the login page" --json
Each row of ctx7 library shows the Library ID, the number of indexed code snippets, a source reputation (High, Medium, Low, Unknown), a benchmark score from 0 to 100, and the available version IDs. When several rows match, take the one whose name is closest, with the most snippets and the best reputation. Official repositories usually appear as /owner/repo; documentation sites appear as /websites/name.
Write the query as a full question about the task. "How to verify a JWT in Express middleware" returns better snippets than "auth".
Connect the MCP server manually
# Claude Code, hosted server (no local Node.js process)
claude mcp add --scope user --transport http \
--header "Authorization: Bearer $CONTEXT7_API_KEY" \
context7 https://mcp.context7.com/mcp
# Claude Code, local stdio server
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key "$CONTEXT7_API_KEY"
# OpenAI Codex
codex mcp add context7 -- npx -y @upstash/context7-mcp --api-key "$CONTEXT7_API_KEY"
Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project) and most other clients take a JSON entry. The hosted server works without a key at a low rate limit:
{
"mcpServers": {
"context7": {
"url": "https://mcp.context7.com/mcp"
}
}
}
For the higher limit, either add a headers object with Authorization set to Bearer plus the key (user-level file only, never a committed one), or change the URL to https://mcp.context7.com/mcp/oauth and sign in through the client. Gemini CLI uses the key httpUrl instead of url in ~/.gemini/settings.json.
MCP tools
| Tool | Arguments (all required) | Returns |
|---|---|---|
resolve-library-id |
libraryName, query |
Matching libraries with their IDs |
query-docs |
libraryId, query |
Snippets and explanations for the question |
{
"name": "resolve-library-id",
"arguments": {
"libraryName": "supabase",
"query": "sign up a user with email and password"
}
}
{
"name": "query-docs",
"arguments": {
"libraryId": "/supabase/supabase",
"query": "sign up a user with email and password"
}
}
Skip resolve-library-id when the ID is already known.
Prompt patterns
How do I enable row-level security on a Supabase table? use context7
Implement password sign-in. use library /supabase
Установить context7 в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл context7?
Context7 fetches current, version-specific documentation and code examples for software libraries and hands them to an AI coding agent, so generated code matches the library version in use instead of stale training data. Use when someone says "use context7", "get the latest docs for this library", "look up the current API", "the agent keeps using a deprecated method", "set up Context7 in Claude Code or Cursor", or asks how to call a framework whose API changed recently. Covers the ctx7 CLI, the MCP server and its two tools, library IDs and version pinning, API keys and rate limits, and the REST API.
Как установить скилл context7?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл context7 запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic