context7-usage
Patterns for using Context7 MCP for library documentation (v2.25)
Best use case
context7-usage is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Patterns for using Context7 MCP for library documentation (v2.25)
Teams using context7-usage should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/context7-usage-majiayu000/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How context7-usage Compares
| Feature / Agent | context7-usage | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Patterns for using Context7 MCP for library documentation (v2.25)
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Context7 MCP Usage Patterns ## v2.88 Key Changes (MODEL-AGNOSTIC) - **Model-agnostic**: Uses model configured in `~/.claude/settings.json` or CLI/env vars - **No flags required**: Works with the configured default model - **Flexible**: Works with GLM-5, Claude, Minimax, or any configured model - **Settings-driven**: Model selection via `ANTHROPIC_DEFAULT_*_MODEL` env vars **ultrathink** - Take a deep breath. We're not here to write code. We're here to make a dent in the universe. ## The Vision Documentation retrieval should be precise, fast, and authoritative. ## Your Work, Step by Step 1. **Identify library**: Extract from the user’s request. 2. **Resolve ID**: Use Context7 to find the exact source. 3. **Query**: Ask for targeted, actionable guidance. 4. **Fallback**: Use MiniMax when Context7 lacks coverage. ## Ultrathink Principles in Practice - **Think Different**: Prefer indexed docs over scraping. - **Obsess Over Details**: Ensure the right library ID. - **Plan Like Da Vinci**: Define the query before running it. - **Craft, Don't Code**: Return only relevant excerpts. - **Iterate Relentlessly**: Re-query for clarity. - **Simplify Ruthlessly**: Avoid unnecessary searches. # Context7 MCP Usage Patterns ## Overview Context7 MCP provides indexed documentation for popular libraries and frameworks. It's more efficient than web scraping because it uses pre-indexed, structured documentation. ## Available Tools | Tool | Purpose | Parameters | |------|---------|------------| | `mcp__plugin_context7_context7__resolve-library-id` | Find Context7 library ID | `libraryName`, `query` | | `mcp__plugin_context7_context7__query-docs` | Query documentation | `libraryId`, `query` | ## Usage Pattern ```yaml # Step 1: Resolve library ID mcp__plugin_context7_context7__resolve-library-id: libraryName: "React" # Extract from user query query: "useTransition hook usage" # Full query for ranking # Step 2: Query docs with resolved ID mcp__plugin_context7_context7__query-docs: libraryId: "/vercel/next.js" # From step 1 query: "How to use useTransition hook" ``` ## Decision Tree ``` Is this about a library/framework? | +-- YES --> Is it in Context7? | | | +-- YES --> Use Context7 MCP | | 1. resolve-library-id | | 2. query-docs | | | +-- NO --> Fallback to MiniMax MCP | +-- NO --> Use WebSearch (native) or MiniMax MCP ``` ## Supported Libraries (Examples) ### Frontend - React (`/facebook/react`) - Next.js (`/vercel/next.js`) - Vue.js (`/vuejs/vue`) - Angular (`/angular/angular`) - Svelte (`/sveltejs/svelte`) ### Languages - TypeScript (`/microsoft/TypeScript`) - JavaScript (MDN) ### Backend - Node.js (`/nodejs/node`) - Express (`/expressjs/express`) - Fastify (`/fastify/fastify`) ### CSS/UI - Tailwind CSS (`/tailwindlabs/tailwindcss`) - Chakra UI (`/chakra-ui/chakra-ui`) ### Databases - PostgreSQL - MongoDB (`/mongodb/docs`) - Redis ## Cost Optimization | Approach | Token Usage | Quality | |----------|-------------|---------| | Context7 | ~50% less | High (official docs) | | Web Search | Baseline | Variable | | MiniMax | Baseline | High | **Why Context7 saves tokens:** - Pre-indexed documentation - Structured responses - No web scraping overhead - Focused, relevant content ## Integration with Ralph Loop ```bash # CLI usage ralph library "React 19 useTransition" ralph lib "Next.js 15 app router" ralph docs "TypeScript generics" # Slash command /library-docs React hooks best practices ``` ## Fallback Strategy If Context7 doesn't have the library: 1. Log warning: "Library not found in Context7" 2. Fallback to `mcp__MiniMax__web_search` 3. Return results from MiniMax ## Best Practices 1. **Extract library name first** - Parse user query to identify the library 2. **Use full query for ranking** - Pass complete query to resolve-library-id 3. **Handle not-found gracefully** - Always have MiniMax fallback ready 4. **Combine with code examples** - Request code snippets in your prompt
Related Skills
context7
Fetch up-to-date library documentation via Context7 REST API. Use when needing current API docs, framework patterns, or code examples for any library. Use when user asks about React, Next.js, Prisma, Express, Vue, Angular, Svelte, or any npm/PyPI package. Use when user says 'how do I use X library', 'what's the API for Y', or needs official documentation. Lightweight alternative to Context7 MCP with no persistent context overhead.
context7-efficient
Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.
context7-docs
Fetch official library docs via Context7 MCP. Use for Tailwind CSS docs (grid, responsive variants), React, Next.js, Vue, MCP, OpenCode, or any npm library. Always use before external web search.
context7-auto-research
Automatically fetch latest library/framework documentation for Claude Code via Context7 API
comment-usage
This rule dictates how comments should be used within the codebase to enhance understanding and avoid clutter.
awesome-copilot-root-context7
Expert in latest library versions, best practices, and correct syntax using up-to-date documentation Use when: the task directly matches context7 responsibilities within plugin awesome-copilot-root. Do not use when: a more specific framework or task-focused skill is clearly a better match.
anthropic-usage
Check Anthropic API usage and costs for any time period. Use when the user asks about API costs, usage, spending, or billing for their Anthropic account. Supports natural language periods like "last week", "yesterday", "january 2025", specific dates, or date ranges.
alpine-js-usage-rules
Guidelines for using Alpine.js for declarative JavaScript functionality.
virtual-environment-usage
Mandates the use of virtual environments for isolating project dependencies and ensuring reproducibility.
ai-usage-coach
Help users get more value from AI assistants by suggesting better prompting techniques, surfacing underused features, and identifying workflow improvements. Use when users ask things like "how can I use Claude better?", "what features am I missing?", "give me tips for prompting", "what can you do?", "I feel like I'm not getting the most out of this", or when they explicitly ask for help improving their AI usage. Also use when users seem frustrated with results or are clearly using suboptimal patterns.
ffmpeg-usage
ffmpeg recipes and best practices: convert, concatenate, merge, resize, compress, GIF creation, audio extraction, subtitles, optimize for social platforms.
context7-skills
Use when a user asks to search, install, list, or remove skills with the Context7 ctx7 skills CLI (including npx ctx7) and needs correct subcommands or client flags.