context7-mcp
upstash/context7
Fetch current library and framework documentation to answer setup, API, and code generation questions.
What is context7-mcp?
Context7 is a documentation lookup skill that retrieves current docs for libraries, frameworks, and APIs instead of relying on training data. Use it when users ask about setup, configuration, code examples, or API references for specific frameworks like React, Next.js, Prisma, Supabase, Vue, and others.
- Resolve library names to Context7 library IDs with relevance ranking
- Fetch current documentation for libraries and frameworks
- Return version-specific documentation when users mention versions
- Provide accurate API references and code examples from official sources
- Support setup and configuration questions with up-to-date information
How to install context7-mcp
npx skills add https://github.com/upstash/context7 --skill context7-mcpHow to use context7-mcp
- 1.When user mentions a library or framework, call resolve-library-id with the library name and user's full question
- 2.Review the resolution results and select the best match based on name accuracy and benchmark scores
- 3.Call query-docs with the selected library ID and the user's specific question
- 4.Incorporate the fetched documentation into your response with code examples and version citations
Use cases
- User asks 'How do I configure Next.js middleware?' – fetch Next.js docs for middleware setup
- User requests 'Write a Prisma query for...' – retrieve Prisma API docs with current query syntax
- User needs 'What are the Supabase auth methods?' – query Supabase auth documentation
- User mentions 'React 19' – resolve and fetch React 19-specific documentation
- User asks about framework setup like 'How do I set up Tailwind CSS?' – get current installation and config docs
- Developers writing code with specific libraries or frameworks
- Engineers setting up or configuring frameworks
- Teams needing current API references without relying on outdated training data
- Anyone building with React, Vue, Next.js, Prisma, Supabase, Express, Tailwind, or similar tools
context7-mcp FAQ
Context7 supports major libraries including React, Vue, Svelte, Next.js, Express, Prisma, Supabase, Tailwind CSS, and many others. Use resolve-library-id to check if a specific library is available.
When users mention a version (e.g., 'React 19' or 'Next.js 15'), the resolution step returns version-specific library IDs. Select the version-specific ID to fetch accurate docs for that version.
Use Context7 when the question involves specific libraries, frameworks, or APIs. For general programming questions without library context, your training data may be sufficient.
Choose based on exact or closest name match to what the user asked, higher benchmark scores (indicating better documentation quality), and preference for official/primary packages over community forks.
Yes, if Context7 has documentation for that version. The resolution step will return available versions; select the one matching the user's request.
Full instructions (SKILL.md)
Source of truth, from upstash/context7.
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 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 questionquery: The user's full question (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: The user's specific question
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: Pass the user's full question as the query for better results
- 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
Related skills
More from upstash/context7 and the wider catalog.

find-docs
Retrieve current documentation, API references, and code examples for any developer technology.

context7-cli
CLI for fetching library docs, managing AI coding skills, and configuring Context7 MCP.

documentation-lookup
Fetch current documentation for libraries and frameworks instead of relying on training data.