context7
netresearch/context7-skill
Fetch current library docs and API references via Context7 REST API when MCP server is unavailable.
What is context7?
A fallback documentation lookup skill that retrieves current library documentation, API references, and code examples for any framework or library (React, Django, Laravel, etc.) directly via the Context7 REST API. Use it when you need to look up framework patterns, API usage, or version-specific behavior.
- Search for library documentation by name and retrieve the most relevant official source
- Fetch focused API references and code examples for specific topics within a library
- Retrieve conceptual guides and framework patterns (e.g., hooks, routing, middleware, ORM queries)
- Support both code-focused and info-focused documentation modes
- Work as a fallback when Context7 MCP server is unavailable or not configured
How to install context7
npx skills add https://github.com/netresearch/context7-skill --skill context7- curl or fetch command available
- jq for JSON parsing
- Optional: CONTEXT7_API_KEY environment variable for higher rate limits
How to use context7
- 1.Run `scripts/context7.sh search "library-name"` to find the library ID
- 2.Review search results and select the highest-scoring official source (format: `/vendor/library`)
- 3.Extract a specific topic from the user's question (e.g., 'hooks', 'routing', 'validation')
- 4.Run `scripts/context7.sh docs "<library-id>" "<topic>" "<mode>"` where mode is 'code' for API or 'info' for conceptual guides
- 5.Review the returned documentation and code examples in your response
Use cases
- Looking up React hooks API or Next.js App Router patterns
- Finding Django ORM query syntax or Laravel Eloquent relationship examples
- Retrieving framework-specific middleware or routing documentation
- Getting version-current API reference for any major library
- Answering library-specific questions when MCP server is down
- Backend developers using Django, Laravel, or similar frameworks
- Frontend developers working with React, Vue, Next.js, or other libraries
- Full-stack developers needing quick API reference lookups
- Teams without a configured Context7 MCP server
context7 FAQ
'code' mode returns API references and code examples; 'info' mode returns conceptual guides and framework patterns.
Pick the result with the highest score and most relevant description. Prefer official sources (e.g., `/vercel/next.js` over community forks).
Don't use it for general programming concepts, code review, debugging business logic, or writing scripts from scratch without library-specific questions.
The skill works without CONTEXT7_API_KEY, but you'll have standard rate limits. Set the environment variable for higher limits.
Yes, it supports any library available in the Context7 database, including React, Next.js, Vue, Django, Laravel, and many others.
Full instructions (SKILL.md)
Source of truth, from netresearch/context7-skill.
name: context7 description: "Use when looking up library documentation, API references, framework patterns, or code examples for ANY library (React, Next.js, Vue, Django, Laravel, etc.) and the Context7 MCP server is unavailable or not configured. Fetches the same current docs directly via the Context7 REST API as a fallback. Triggers on: how to use library, API docs, framework pattern, import usage, library example." license: "(MIT AND CC-BY-SA-4.0)" compatibility: "Requires curl or fetch, jq." metadata: version: "1.7.2" repository: "https://github.com/netresearch/context7-skill" author: "Netresearch DTT GmbH" allowed-tools:
- "Bash(curl:*)"
- "Bash(jq:*)"
- "Read"
Context7 Documentation Lookup Skill
Fetch current library documentation, API references, and code examples via the Context7 REST API.
When to Use
Use this skill when the user asks about library APIs, framework patterns, or version-specific behavior. Trigger on:
- Library questions: "How do I use [library]?", "[library] API docs", "[library] patterns"
- Import statements:
import,require,fromfollowed by a library name - Framework-specific topics: hooks, routing, middleware, ORM queries, schema definitions
When NOT to Use
Do NOT use this skill for:
- General programming concepts (closures, recursion, design patterns)
- Code review or refactoring tasks
- Debugging business logic
- Writing scripts from scratch without library-specific questions
Core Workflow
-
Search for the library ID:
scripts/context7.sh search "library-name" -
Pick the best result: Choose the ID with the highest score and most relevant description. Prefer official sources (e.g.,
/vercel/next.jsover community forks). -
Fetch documentation with a focused topic:
scripts/context7.sh docs "<library-id>" "<topic>" "<mode>"
Always extract a specific topic from the user's question. For "How does React Suspense work with server components?", use topic suspense server components.
Parameters
| Parameter | Required | Description |
|---|---|---|
library-id | Yes | From search results, format /vendor/library |
topic | No | Focus area extracted from user query (e.g., hooks, routing, validation) |
mode | No | code (default) for API references; info for conceptual guides |
Examples
# React hooks API
scripts/context7.sh search "react"
scripts/context7.sh docs "/facebook/react" "hooks" "code"
# Next.js App Router conceptual guide
scripts/context7.sh search "nextjs"
scripts/context7.sh docs "/vercel/next.js" "app router" "info"
# Django ORM queries
scripts/context7.sh search "django"
scripts/context7.sh docs "/django/django" "queryset filter" "code"
# Laravel Eloquent relationships
scripts/context7.sh search "laravel"
scripts/context7.sh docs "/laravel/framework" "eloquent relationships" "code"
Environment Configuration
Set CONTEXT7_API_KEY for higher rate limits (optional):
export CONTEXT7_API_KEY="your-api-key"
Contributing: https://github.com/netresearch/context7-skill
Related skills
More from netresearch/context7-skill and the wider catalog.

android-testing
Comprehensive testing strategy involving Unit, Integration, Hilt, and Screenshot tests.

multi-search
智能多引擎搜索,自动检测网络环境并按优先级切换:DuckDuckGo -> Tavily -> Bing API -> Bing爬虫。支持自动配额管理和网络缓存。Invoke when user needs web search with automatic engine selection and network adaptation.

amazon-keyword-research
Free Amazon keyword research and market analysis across 12 marketplaces—no API key required.

amazon-listing-optimization
Build and optimize Amazon listings with keyword-driven copy and competitive analysis—no API key required.

amazon-ppc-campaign
Build and optimize Amazon PPC campaigns with data-driven bid strategies and keyword funnels.

amazon-product-research
Comprehensive product research and opportunity analysis for Amazon sellers with demand, competition, and profitability scoring.