Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add upstash/context7 --skill context7-mcp -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/context7-mcp/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/context7-mcp/

From the same set3

The whole set →

Similar

composio ComposioHQ This skill routes Composio tasks for a personal agent or a product with user-connected accounts, from setup and integration to tool runs and troubleshooting. Claude Code CX Codex Cursor +1 8,000installs interface-design Dammyjay93 This skill guides product UI work for dashboards, admin panels, SaaS apps, and tools. Use it when hierarchy, states, visual direction, and design-system consistency matter. Claude Code CX Codex Cursor +1 30,700installs open-code-review alibaba Skill runs the ocr CLI to review Git changes with AI. Produces line-level comments and can apply fixes on request. Claude Code CX Codex Cursor +1 6,800installs orca-emulator-android stablyai Lets the agent drive an adb-connected Android emulator or phone from inside Orca: taps, swipes, APK install, logcat. Handy for running a flow on a real device. Claude Code CX Codex Cursor +1 5,600installs academic-pipeline Imbad0202 Coordinates academic research from source gathering and drafting through integrity checks, peer review, revisions, and finalization. Useful for a complete paper workflow. Claude Code CX Codex Cursor +1 7,200installs repo-intake-and-plan lllllllama Scans a repository through its README and project files, then builds a small reproduction plan. Use it before running experiments. Claude Code CX Codex Cursor +1 474,500installs setup-matt-pocock-skills Matt Pocock This skill configures a repository for Matt Pocock's engineering skills by setting its issue tracker, triage labels, and domain docs layout. Run it before using the other skills. Claude Code 1,052,851installs to-tickets Matt Pocock Turns a plan, spec, or conversation into small end-to-end tickets with explicit blockers. Use it to agree on the work breakdown before tickets go to a tracker. Claude Code 711,230installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor