---
name: context7
description: Get up-to-date documentation for libraries and frameworks via Context7 MCP. Use when you need current API references, not stale training data.
metadata:
  openclaw:
    emoji: "📚"
---

# Context7 - Live Documentation

Context7 provides real-time documentation for libraries and frameworks. Use this instead of relying on potentially outdated training data.

## When to Use

- Looking up current API syntax for a library
- Checking latest features/changes in a framework
- Verifying correct usage patterns
- Any time you're unsure if your knowledge is current

## How It Works

Context7 is configured as an MCP server. When Claude Code runs, it can query Context7 for live docs.

**For Claude Code sessions:**
The MCP is already configured globally. Claude Code will automatically have access to `resolve_library_id` and `get_library_docs` tools.

**For direct queries (via MCP client):**

```bash
# List available tools
npx -y @upstash/context7-mcp --api-key ctx7sk-13f7b82d-aadf-41e3-989a-08ac3283a95d
```

## Available Tools

| Tool | Purpose |
|------|---------|
| `resolve_library_id` | Find the Context7 ID for a library (e.g., "react" → "/facebook/react") |
| `get_library_docs` | Get documentation for a specific library by ID |

## Example Usage in Prompts

When spawning Claude Code for a task involving specific libraries:

```
Build a Next.js 14 app with the App Router.

Use Context7 to look up the latest Next.js documentation before implementing:
- resolve_library_id for "nextjs"
- get_library_docs for the resolved ID

Focus on: App Router patterns, Server Components, Server Actions.
```

## API Key

```
ctx7sk-13f7b82d-aadf-41e3-989a-08ac3283a95d
```

## Configuration Location

- **User config:** `~/.claude.json`
- **Project config:** `.claude.json` in project root

## Tips

1. **Be specific** - Ask for docs on specific features, not entire libraries
2. **Combine with task** - Include Context7 lookup as part of the build prompt
3. **Trust fresh docs** - Context7 data is more current than LLM training data
