# Table of Contents - [Claude Code - Context7 MCP](#claude-code-context7-mcp) --- # Claude Code - Context7 MCP [Skip to main content](https://context7.com/docs/clients/claude-code#content-area) [Context7 MCP home page![light logo](https://mintcdn.com/context7/U6tImExBAiuicuew/public/logo/logo.svg?fit=max&auto=format&n=U6tImExBAiuicuew&q=85&s=34753285ee1ce27ba8e58f105be9400d)![dark logo](https://mintcdn.com/context7/U6tImExBAiuicuew/public/logo/logo-dark.svg?fit=max&auto=format&n=U6tImExBAiuicuew&q=85&s=af940971c0a07546d58498f92f080237)](https://context7.com/) Search... Ctrl KAsk AI Search... Navigation Clients Claude Code On this page * [Installation](https://context7.com/docs/clients/claude-code#installation) * [Using Context7](https://context7.com/docs/clients/claude-code#using-context7) * [The Context7 Plugin](https://context7.com/docs/clients/claude-code#the-context7-plugin) * [Installing the Plugin](https://context7.com/docs/clients/claude-code#installing-the-plugin) * [Skills](https://context7.com/docs/clients/claude-code#skills) * [Documentation Lookup Skill](https://context7.com/docs/clients/claude-code#documentation-lookup-skill) * [Agents](https://context7.com/docs/clients/claude-code#agents) * [docs-researcher Agent](https://context7.com/docs/clients/claude-code#docs-researcher-agent) * [When to Use Agents vs Inline Tools](https://context7.com/docs/clients/claude-code#when-to-use-agents-vs-inline-tools) * [Commands](https://context7.com/docs/clients/claude-code#commands) * [/context7:docs](https://context7.com/docs/clients/claude-code#%2Fcontext7docs) Context7 integrates with Claude Code to provide current library documentation instead of relying on training data. Claude Code supports skills, agents, and commands that make documentation lookups more powerful. [​](https://context7.com/docs/clients/claude-code#installation) Installation ------------------------------------------------------------------------------- Run the setup command to configure Context7 for Claude Code: Copy Ask AI npx ctx7 setup --claude Authenticates via OAuth, generates an API key, and installs the appropriate skill. You can choose between CLI or MCP mode. For manual MCP installation or other configuration options, see [All MCP Clients](https://context7.com/docs/resources/all-clients) . * * * [​](https://context7.com/docs/clients/claude-code#using-context7) Using Context7 ----------------------------------------------------------------------------------- With `ctx7 setup`, a skill is installed that triggers automatically when you ask about libraries — no need to say “use context7”. You can also invoke it explicitly: Copy Ask AI use context7 to show me how to set up middleware in Next.js 15 use context7 for Prisma query examples with relations use context7 for the Supabase syntax for row-level security If you know the library ID, use it directly to skip resolution: Copy Ask AI use context7 with /supabase/supabase for authentication docs use context7 with /vercel/next.js for app router setup With the [Context7 plugin](https://context7.com/docs/clients/claude-code#the-context7-plugin) installed, you get additional agents and commands on top of the skill. * * * [​](https://context7.com/docs/clients/claude-code#the-context7-plugin) The Context7 Plugin --------------------------------------------------------------------------------------------- The full Context7 plugin for Claude Code includes more than just the MCP server: MCP Server ---------- The tools for fetching documentation (`resolve-library-id`, `query-docs`) Skills ------ Auto-triggers documentation lookups when you ask about libraries Agents ------ A `docs-researcher` agent for focused lookups that keep context lean Commands -------- `/context7:docs` for manual documentation queries ### [​](https://context7.com/docs/clients/claude-code#installing-the-plugin) Installing the Plugin The plugin is available from the Context7 marketplace. Run these commands in Claude Code: Copy Ask AI /plugin marketplace add upstash/context7 /plugin install context7-plugin@context7-marketplace This adds the Context7 marketplace and installs the plugin with skills, agents, and commands. ### [​](https://context7.com/docs/clients/claude-code#skills) Skills #### [​](https://context7.com/docs/clients/claude-code#documentation-lookup-skill) Documentation Lookup Skill This skill triggers automatically when you ask about libraries, frameworks, or need code examples. You don’t need to type “use context7” — the skill recognizes when documentation would help. What triggers the skill * Setup questions: “How do I configure Next.js middleware?” * Code generation: “Write a Prisma query for user relations” * API references: “What are the Supabase auth methods?” * Framework mentions: React, Vue, Svelte, Express, Tailwind, etc. How it works 1. **Resolve**: Finds the library ID using `resolve-library-id` with your question as context 2. **Select**: Picks the best match based on name accuracy and quality scores 3. **Fetch**: Calls `query-docs` with the library ID and your specific question 4. **Return**: Provides code examples and explanations from current documentation ### [​](https://context7.com/docs/clients/claude-code#agents) Agents #### [​](https://context7.com/docs/clients/claude-code#docs-researcher-agent) docs-researcher Agent When you’re in the middle of a long task and don’t want documentation tool calls cluttering your context, spawn the `docs-researcher` agent. It runs in a separate context and returns just the answer. * When to Use * Examples * You need docs but want to keep your main context clean * You’re working on something complex and context is getting long * You want a focused answer without side effects Copy Ask AI spawn docs-researcher to look up React hooks documentation spawn docs-researcher: how do I set up Prisma with PostgreSQL? spawn docs-researcher to find Tailwind CSS grid utilities The agent uses the same tools (`resolve-library-id` and `query-docs`) but runs on a lighter model (Sonnet) to keep things fast. #### [​](https://context7.com/docs/clients/claude-code#when-to-use-agents-vs-inline-tools) When to Use Agents vs Inline Tools | Scenario | Use | | --- | --- | | Deep into a task with long context | Agent | | Want to avoid context bloat | Agent | | Context is short | Inline tools | | Want docs visible in conversation | Inline tools | ### [​](https://context7.com/docs/clients/claude-code#commands) Commands #### [​](https://context7.com/docs/clients/claude-code#/context7docs) /context7:docs Manual command for documentation lookups. **Format:** Copy Ask AI /context7:docs [query] **Examples:** * Basic * With Library ID Copy Ask AI /context7:docs react hooks /context7:docs next.js authentication /context7:docs prisma relations Copy Ask AI /context7:docs /vercel/next.js app router /context7:docs /supabase/supabase row level security Using a library ID directly skips the resolution step. **When to use:** * You know exactly which library and topic you need * You want a quick lookup without explaining your full context * You’re testing what documentation is available Was this page helpful? YesNo [Suggest edits](https://github.com/upstash/context7/edit/master/docs/clients/claude-code.mdx) [Raise issue](https://github.com/upstash/context7/issues/new?title=Issue%20on%20docs&body=Path:%20/clients/claude-code) [Security](https://context7.com/docs/resources/security) [Cursor](https://context7.com/docs/clients/cursor) Ctrl+I Assistant Responses are generated using AI and may contain mistakes. ---