Fetch up-to-date, version-specific documentation and code examples for any library or framework to eliminate hallucinations and outdated code generation
Automatically fetch up-to-date, version-specific documentation and code examples for any library or framework directly into your AI coding assistant's context. Eliminate hallucinated APIs, outdated examples, and generic answers.
This skill integrates the Context7 MCP server into your AI coding workflow, enabling your assistant to:
1. Pull current documentation from the actual source of libraries and frameworks
2. Retrieve version-specific API references and code examples
3. Provide accurate, non-hallucinated code generation based on real documentation
4. Access private repository documentation (with API key)
5. Work with 1000+ supported libraries and frameworks
**Without Context7:**
**With Context7:**
The Context7 MCP server must be installed in your AI coding client. Follow the installation instructions for your specific client:
**For Cursor:**
Add to `~/.cursor/mcp.json`:
```json
{
"mcpServers": {
"context7": {
"url": "https://mcp.context7.com/mcp",
"headers": {
"CONTEXT7_API_KEY": "YOUR_API_KEY"
}
}
}
}
```
**For Claude Code:**
```bash
claude mcp add --header "CONTEXT7_API_KEY: YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp
```
**For VS Code:**
Add to MCP config:
```json
"mcp": {
"servers": {
"context7": {
"type": "http",
"url": "https://mcp.context7.com/mcp",
"headers": {
"CONTEXT7_API_KEY": "YOUR_API_KEY"
}
}
}
}
```
**For Windsurf, Cline, Zed, and other clients:** Refer to the full installation guide at https://context7.com/docs
While Context7 works without an API key, getting one provides:
Get your API key at: https://context7.com/dashboard
To avoid typing "use context7" in every prompt, add a rule to your client's configuration:
**For Cursor:** `Cursor Settings > Rules`
**For Windsurf:** `.windsurfrules` file
**For Claude Code:** `CLAUDE.md` file
**Example Rule:**
```
Always use context7 when I need code generation, setup or configuration steps, or library/API documentation. This means you should automatically use the Context7 MCP tools to resolve library id and get library docs without me having to explicitly ask.
```
Simply include "use context7" in your prompt when asking code-related questions:
```
Create a Next.js middleware that checks for a valid JWT in cookies and redirects unauthenticated users to /login. use context7
```
```
Configure a Cloudflare Worker script to cache JSON API responses for five minutes. use context7
```
```
Show me how to set up a Redis connection with Upstash in a Node.js app. use context7
```
Once you've configured the auto-invocation rule, Context7 will automatically activate for relevant queries:
```
How do I implement authentication with NextAuth.js v5?
```
```
Write a React component using shadcn/ui that displays a data table with sorting
```
```
Set up a Drizzle ORM connection to Postgres with connection pooling
```
1. **Be Specific About Versions:** If you need a specific version, mention it in your prompt
- "Show me how to use React Query v5 for data fetching"
2. **Mention Multiple Libraries:** Context7 can fetch docs for multiple libraries in one query
- "Create an API route using Next.js 14 App Router with Prisma and Zod validation. use context7"
3. **Ask for Setup Instructions:** Context7 excels at providing accurate setup steps
- "Walk me through setting up Tailwind CSS with Next.js 15. use context7"
4. **Request Code Examples:** Get working code based on current documentation
- "Show me a complete example of using tRPC with Next.js. use context7"
Context7 supports 1000+ libraries and frameworks, including:
View the complete list at: https://context7.com/libraries
**Context7 not activating:**
**Rate limit errors:**
**Library not found:**
**Documentation seems outdated:**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/context7-documentation-fetcher/raw