---
name: context7-get-started
description: Set up Context7 in your coding agent, so it reads up-to-date library docs before it writes code.
title: 'Add Context7 to your agent'
url: https://context7.com/get-started.md
---

# Set up Context7

Run the commands yourself. The user only signs in, in the browser. Write the user's global configuration, keep their other MCP entries, and do not wait on a command that needs the user.

## 1. Install

```sh
npx ctx7@latest setup --<client> --mcp --oauth --yes
```

Clients: `--claude`, `--cursor`, `--vscode`, `--codex`, `--opencode`, `--devin`, `--copilot`, `--antigravity`, `--gemini`. It needs Node.js 22.13 or later and finishes in a few seconds. It adds the `context7` MCP server, a rule and a skill.

Other clients: add the MCP server `https://mcp.context7.com/mcp/oauth` (streamable HTTP). Steps per client: https://context7.com/docs/resources/all-clients

## 2. Sign in

Give the user the sign-in step for their client. Do not run it yourself: it waits for the browser. Do not ask for an API key.

- Claude Code: restart, then `/mcp`, select `context7`, Authenticate
- Codex: `codex mcp login context7`
- OpenCode: `opencode mcp auth context7`
- Cursor, VS Code and others: reload the client and approve the sign-in when it opens

## 3. Verify

If the new `context7` server is loaded, call `resolve-library-id` for `next.js`, then `query-docs` with the result. A Context7 connector of the user's account does not count. If the server is not loaded yet, do not wait: report it as pending.

## 4. Report

Always end with this block, with only what you checked:

```text
Context7: <ready|waiting for sign-in|waiting for reload|blocked: reason>
Client: <client>
Docs check: <library ID|pending|blocked: reason>
Next step for the user: <what to do>
```

To let the agent also manage the Context7 dashboard, follow https://context7.com/admin-mcp/get-started.md next.
