2026-01-14 19:03:43 +03:00
# Context7 Plugin for Claude Code
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
Context7 solves a common problem with AI coding assistants: outdated training data and hallucinated APIs. Instead of relying on stale knowledge, Context7 fetches current documentation directly from source repositories.
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
## What's Included
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
This plugin provides:
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
- **MCP Server** - Connects Claude Code to Context7's documentation service
- **Skills** - Auto-triggers documentation lookups when you ask about libraries
- **Agents** - A dedicated `docs-researcher` agent for focused lookups
- **Commands** - `/context7:docs` for manual documentation queries
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
## Installation
2026-01-14 19:08:42 +03:00
Install the plugin from the official marketplace:
2026-01-14 19:03:43 +03:00
```bash
2026-01-14 19:08:42 +03:00
claude plugin install context7@claude -plugins-official
2026-01-14 19:03:43 +03:00
```
2025-12-30 13:57:12 +01:00
## Available Tools
2026-01-14 19:03:43 +03:00
### resolve-library-id
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
Searches for libraries and returns Context7-compatible identifiers.
2025-12-30 13:57:12 +01:00
```
2026-01-14 19:03:43 +03:00
Input: "next.js"
Output: { id: "/vercel/next.js", name: "Next.js", versions: ["v15.1.8", "v14.2.0", ...] }
2025-12-30 13:57:12 +01:00
```
2026-01-14 19:03:43 +03:00
### query-docs
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
Fetches documentation for a specific library, ranked by relevance to your question.
2025-12-30 13:57:12 +01:00
```
2026-01-14 19:03:43 +03:00
Input: { libraryId: "/vercel/next.js", query: "app router middleware" }
Output: Relevant documentation snippets with code examples
2025-12-30 13:57:12 +01:00
```
2026-01-14 19:03:43 +03:00
## Usage Examples
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
The plugin works automatically when you ask about libraries:
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
- "How do I set up authentication in Next.js 15?"
- "Show me React Server Components examples"
- "What's the Prisma syntax for relations?"
2025-12-30 13:57:12 +01:00
2026-01-14 19:03:43 +03:00
For manual lookups, use the command:
2025-12-30 13:57:12 +01:00
```
2026-01-14 19:03:43 +03:00
/context7:docs next.js app router
/context7:docs /vercel/next.js/v15.1.8 middleware
2025-12-30 13:57:12 +01:00
```
2026-01-14 19:03:43 +03:00
Or spawn the docs-researcher agent when you want to keep your main context clean:
2025-12-30 13:57:12 +01:00
```
2026-01-14 19:03:43 +03:00
spawn docs-researcher to look up Supabase auth methods
2025-12-30 13:57:12 +01:00
```
## Version Pinning
2026-01-14 19:03:43 +03:00
To get documentation for a specific version, include the version in the library ID:
2025-12-30 13:57:12 +01:00
```
/vercel/next.js/v15.1.8
2026-01-14 19:03:43 +03:00
/supabase/supabase/v2.45.0
2025-12-30 13:57:12 +01:00
```
2026-01-14 19:03:43 +03:00
The `resolve-library-id` tool returns available versions, so you can pick the one that matches your project.