Context7 MCP skill

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples.

by upstash·MIT license·GitHub ↗

★ 62,297 Stars on the repo·Checked

npx degit upstash/context7/skills/context7-mcp#master ~/.claude/skills/context7-mcp

SKILL.md · 2.7 KB · names 1 other file — download is this file only · installs the whole folder to ~/.claude/skills/context7-mcp

Files of Context7 MCP

Files 1 file
Show the full text57 lines

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 Next.js middleware?")
  • 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 15", "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
1---
2name: context7-mcp
3description: 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.
4---
5 
6When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data.
7 
8## When to Use This Skill
9 
10Activate this skill when the user:
11 
12- Asks setup or configuration questions ("How do I configure Next.js middleware?")
13- Requests code involving libraries ("Write a Prisma query for...")
14- Needs API references ("What are the Supabase auth methods?")
15- Mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)
16 
17## How to Fetch Documentation
18 
19### Step 1: Resolve the Library ID
20 
21Call `resolve-library-id` with:
22 
23- `libraryName`: The library name extracted from the user's question
24- `query`: What to look up in the library's documentation (improves relevance ranking)
25 
26### Step 2: Select the Best Match
27 
28From the resolution results, choose based on:
29 
30- Exact or closest name match to what the user asked for
31- Higher benchmark scores indicate better documentation quality
32- If the user mentioned a version (e.g., "React 19"), prefer version-specific IDs
33 
34### Step 3: Fetch the Documentation
35 
36Call `query-docs` with:
37 
38- `libraryId`: The selected Context7 library ID (e.g., `/vercel/next.js`)
39- `query`: What to look up in the library's documentation, scoped to a single concept
40 
41If 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.
42 
43### Step 4: Use the Documentation
44 
45Incorporate the fetched documentation into your response:
46 
47- Answer the user's question using current, accurate information
48- Include relevant code examples from the docs
49- Cite the library version when relevant
50 
51## Guidelines
52 
53- **Be specific**: Describe what to look up in the library's documentation, but keep each query to a single concept
54- **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
55- **Version awareness**: When users mention versions ("Next.js 15", "React 19"), use version-specific library IDs if available from the resolution step
56- **Prefer official sources**: When multiple matches exist, prefer official/primary packages over community forks
57 

Discussion

Alternatives

Also in Agents & MCPSee all 527 in Development →