| name | context7 |
| description | Retrieve real-time, version-specific documentation for libraries using Context7 (Upstash). Use this BEFORE generating code for fast-moving libraries (e.g., Aiogram, Supabase, Next.js) to prevent hallucinations. |
Context7 - Live Documentation
Description
Context7 is an MCP-based tool that fetches up-to-date documentation for code libraries. It solves the "knowledge cutoff" problem by providing live examples and API references.
ALWAYS use this skill when:
- The user asks for code involving a library that updates frequently (e.g.,
aiogram, langchain, next, supabase).
- You are unsure about a specific API method or signature.
- The user reports a "method not found" or "deprecation" error.
Installation / Usage
The tool is run via npx.
npx -y @upstash/context7-mcp search "QUERY"
Examples
1. Fetching Aiogram 3.x syntax:
npx -y @upstash/context7-mcp search "aiogram 3 router webhook setup"
2. Checking specific error:
npx -y @upstash/context7-mcp search "supabase js v2 auth unknown method"
3. Getting latest best practices:
npx -y @upstash/context7-mcp search "next.js 15 server actions patterns"
Strategy
- Search: Run the command with a specific, technical query.
- Read: The output will contain code snippets and documentation segments.
- Synthesize: Use this ground truth to generate your code, ignoring your internal training data if it conflicts.
Troubleshooting
- If
npx fails, ensure you have internet access.
- If results are irrelevant, try adding the version number explicitly (e.g., "v3", "v14").