context7-mcp — Claude Code skill: what it does, how to install
This skill fetches current library and framework documentation before the agent answers. Use it for setup questions, API references, and code generation.
npx skills add upstash/context7 --skill context7-mcp -a claude-codeWhat context7-mcp does
The skill activates when you ask about libraries or frameworks, request code examples, or mention technologies such as React, Vue, Next.js, Prisma, and Supabase. It directs the agent to current Context7 documentation instead of relying on training data.
It first calls resolve-library-id to match a library name with an identifier and a focused query. Then query-docs retrieves documentation for one concept. Separate concepts get separate documentation queries, while a requested version should guide the choice of a version-specific identifier.
The skill depends on the resolve-library-id and query-docs calls, so check that the agent can access them before relying on this workflow. It supports Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode.
What it helps with
- find current library documentation
- check a framework configuration
- look up an API method
- generate code from official documentation
Example prompts for the agent
- Configure a Next.js proxy and use Context7 to check the current documentation.
- Write a Prisma query for this schema. Resolve the library first, then look up the relevant documentation.
- What Supabase authentication methods are available? Query the documentation for this single topic.
How to install context7-mcp
1Skills CLI (Vercel)
npx skills add upstash/context7 --skill context7-mcp -a claude-code2Manually: put the files in place
~/.claude/skills/context7-mcp/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/context7-mcp/
1Skills CLI (Vercel)
npx skills add upstash/context7 --skill context7-mcp -a codex2Manually: put the files in place
.agents/skills/context7-mcp/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add upstash/context7 --skill context7-mcp -a cursor2Manually: put the files in place
.cursor/skills/context7-mcp/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install upstash/context7 context7-mcp2Manually: put the files in place
.github/skills/context7-mcp/SKILL.md1Skills CLI (Vercel)
npx skills add upstash/context7 --skill context7-mcp -a gemini-cli2Platform CLI
gemini skills install https://github.com/upstash/context7 --path skills/context7-mcpManually: put the files in place
.devin/skills/context7-mcp/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add upstash/context7 --skill context7-mcp -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set3
The whole set →Similar
Questions about context7-mcp
How do I install context7-mcp in Claude Code?
Run npx skills add upstash/context7 --skill context7-mcp -a claude-code, then run npx skills add upstash/context7 --skill context7-mcp -a claude-code again. The skill file is at ~/.claude/skills/context7-mcp/SKILL.md.
What does context7-mcp do?
The skill directs the agent to current library and framework documentation through resolve-library-id and query-docs for setup questions, API references, and code examples.
How does context7-mcp handle library versions?
When a user names a version, the skill recommends choosing a version-specific library identifier when one appears in the resolution results.
Source text
SKILL.md · MIT
---
name: context7-mcp
description: This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.
---
When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data.
## When to Use This Skill
Activate this skill when the user:
- Asks setup or configuration questions ("How do I configure a Next.js proxy?")
- Requests code involving libraries ("Write a Prisma query for...")
- Needs API references ("What are the Supabase auth methods?")
- Mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)
## How to Fetch Documentation
### Step 1: Resolve the Library ID
Call `resolve-library-id` with:
- `libraryName`: The library name extracted from the user's question
- `query`: What to look up in the library's documentation (improves relevance ranking)
### Step 2: Select the Best Match
From the resolution results, choose based on:
- Exact or closest name match to what the user asked for
- Higher benchmark scores indicate better documentation quality
- If the user mentioned a version (e.g., "React 19"), prefer version-specific IDs
### Step 3: Fetch the Documentation
Call `query-docs` with:
- `libraryId`: The selected Context7 library ID (e.g., `/vercel/next.js`)
- `query`: What to look up in the library's documentation, scoped to a single concept
If the user's question spans multiple distinct concepts (e.g. routing and auth and caching), make a separate `query-docs` call per concept with the same library ID, unless the question is about how the concepts interact — combined queries dilute ranking and return shallow results for each topic.
### Step 4: Use the Documentation
Incorporate the fetched documentation into your response:
- Answer the user's question using current, accurate information
- Include relevant code examples from the docs
- Cite the library version when relevant
## Guidelines
- **Be specific**: Describe what to look up in the library's documentation, but keep each query to a single concept
- **One topic per query**: Split multi-topic questions into separate `query-docs` calls — resolve the library ID once, then query per concept, unless the question is about how the concepts interact
- **Version awareness**: When users mention versions ("Next.js 16", "React 19"), use version-specific library IDs if available from the resolution step
- **Prefer official sources**: When multiple matches exist, prefer official/primary packages over community forks
© upstash · MIT · upstash/context7