Skip to content

Context7 Platform -- Up-to-date docs for AI agents

feat: add Codex client documentation and update OAuth flow details for existing clients (#2742)

Enes Gulescc011a470743
diff --git a/docs/clients/claude-code.mdx b/docs/clients/claude-code.mdx
index 75995453..f8289582 100644
--- a/docs/clients/claude-code.mdx
+++ b/docs/clients/claude-code.mdx
@@ -13,17 +13,7 @@ Run the setup command to configure Context7 for Claude Code:
npx ctx7 setup --claude
```
-This flow authenticates via OAuth, generates an API key, and installs the appropriate skill. You can choose between CLI or MCP mode.
-
-<Tip>
-If you're setting up Claude Code on a remote server, headless VM, or over SSH, use an existing API key instead:
-
-```bash
-npx ctx7 setup --claude --api-key YOUR_API_KEY
-```
-
-The default OAuth flow redirects back to `localhost`, which only works when the browser can reach the same machine that's running `ctx7 setup`.
-</Tip>
+This flow authenticates via OAuth, generates an API key, and installs the appropriate skill. You can choose between CLI or MCP mode. Login uses the OAuth device flow — it shows a verification link and short code you open on any device, so it works the same locally or on a remote, headless, or SSH host.
Create or manage API keys in the [Context7 dashboard](https://context7.com/dashboard). For manual MCP installation or other configuration options, see [All MCP Clients](/resources/all-clients).
diff --git a/docs/clients/cli.mdx b/docs/clients/cli.mdx
index 06245363..9f3d1f80 100644
--- a/docs/clients/cli.mdx
+++ b/docs/clients/cli.mdx
@@ -148,7 +148,7 @@ ctx7 setup --api-key YOUR_API_KEY
ctx7 setup --oauth
```
-Without `--api-key` or `--oauth`, setup opens a browser for OAuth login. MCP mode additionally generates a new API key after login. `--oauth` is MCP-only — use it when an IDE handles the auth flow on your behalf.
+Without `--api-key` or `--oauth`, setup runs the OAuth device flow: it shows a verification link and short code that you open on any device to sign in, so it works the same locally or on a remote, headless, or SSH host. MCP mode additionally generates a new API key after login. `--oauth` is MCP-only — use it when an IDE handles the auth flow on your behalf.
**What gets written — MCP mode:**
diff --git a/docs/clients/codex.mdx b/docs/clients/codex.mdx
new file mode 100644
index 00000000..e3556340
--- /dev/null
+++ b/docs/clients/codex.mdx
@@ -0,0 +1,120 @@
+---
+title: Codex
+description: Using Context7 with OpenAI Codex
+---
+
+Context7 integrates with [OpenAI Codex](https://developers.openai.com/codex/) to provide current library documentation instead of relying on training data. Codex comes in three surfaces — the Codex CLI, Codex Desktop, and Codex Cloud — and Context7 works across all of them.
+
+<Info>
+MCP servers in Codex are configured once and shared everywhere. The Codex CLI, Codex Desktop, and the IDE extension all read the same `~/.codex/config.toml`, so adding Context7 in one place enables it in the others. See the [Codex MCP documentation](https://developers.openai.com/codex/mcp) for more details.
+</Info>
+
+## Installation
+
+Run the setup command to configure Context7 for Codex:
+
+```bash
+npx ctx7 setup --codex
+```
+
+This authenticates via OAuth, generates an API key, and writes the Context7 configuration to your `~/.codex/config.toml` and `AGENTS.md`. You can choose between CLI or MCP mode. Login uses the OAuth device flow — it shows a verification link and short code you open on any device, so it works the same locally or on a remote, headless, or SSH host.
+
+Create or manage API keys in the [Context7 dashboard](https://context7.com/dashboard). For manual configuration or other clients, see [All MCP Clients](/resources/all-clients).
+
+---
+
+## Codex surfaces
+
+<CardGroup cols={3}>
+<Card title="Codex CLI" icon="terminal">
+The local coding agent that runs in your terminal. Add Context7 with `codex mcp add` or by editing `config.toml`.
+</Card>
+<Card title="Codex Desktop" icon="desktop">
+The Codex app for macOS and Windows. Enable Context7 from the app's MCP settings, or rely on the shared `config.toml`.
+</Card>
+<Card title="Codex Cloud" icon="cloud">
+The web-based agent that runs tasks in cloud environments. Add Context7 to the tools for an environment from the Codex web app.
+</Card>
+</CardGroup>
+
+### Codex CLI
+
+Add Context7 from the terminal with the `codex mcp add` command:
+
+```bash
+codex mcp add context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
+```
+
+Or add it directly to `~/.codex/config.toml` (use a project-scoped `.codex/config.toml` for trusted projects):
+
+```toml
+[mcp_servers.context7]
+command = "npx"
+args = ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
+startup_timeout_ms = 20_000
+```
+
+Prefer the hosted server? Use the remote connection instead:
+
+```toml
+[mcp_servers.context7]
+url = "https://mcp.context7.com/mcp"
+http_headers = { "CONTEXT7_API_KEY" = "YOUR_API_KEY" }
+```
+
+### Codex Desktop
+
+The Codex app (macOS and Windows) shares the same MCP configuration as the CLI and IDE extension. Enable Context7 from the app's MCP settings, or add it to `~/.codex/config.toml` using the snippets above — it's picked up automatically.
+
+### Codex Cloud
+
+Codex Cloud delegates tasks to OpenAI's agent in managed cloud environments, so they can run in the background without your local machine. Each environment defines the repo, setup steps, and tools Codex uses — configure Context7 as part of an [environment](https://developers.openai.com/codex/cloud/environments) from the Codex web app. Cloud environments also have [configurable internet access](https://developers.openai.com/codex/cloud/internet-access), which Context7 needs to reach the documentation API.
+
+---
+
+## Using Context7
+
+With `ctx7 setup`, a skill is installed that triggers automatically when you ask about libraries. You can also invoke it explicitly:
+
+```
+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:
+
+```
+use context7 with /supabase/supabase for authentication docs
+use context7 with /vercel/next.js for app router setup
+```
+
+You can also add instructions to your `AGENTS.md` file:
+
+```markdown AGENTS.md
+When you need to search docs, use Context7.
+```
+
+---
+
+## Tips
+
+<AccordionGroup>
+<Accordion title="Getting Better Results">
+- Be specific about what you're trying to do, not just which library
+- Mention versions when they matter
+- If the first result isn't right, ask for a different part of the docs
+
+```
+# Good
+How do I handle file uploads with the Supabase Storage API?
+
+# Less specific
+How does Supabase storage work?
+```
+</Accordion>
+
+<Accordion title="Startup timed out or program not found">
+If you see a startup "request timed out" or "not found program" error, increase `startup_timeout_ms` to `40_000` and retry. On Windows, point `command` at the absolute `npx.cmd` path and set `SystemRoot` and `APPDATA` explicitly — `npx` requires them, but some Codex MCP clients don't set them by default.
+</Accordion>
+</AccordionGroup>
diff --git a/docs/clients/pi.mdx b/docs/clients/pi.mdx
new file mode 100644
index 00000000..29198cd0
--- /dev/null
+++ b/docs/clients/pi.mdx
@@ -0,0 +1,90 @@
+---
+title: Pi
+description: Using Context7 with the Pi coding agent
+---
+
+Context7 integrates with the [Pi coding agent](https://pi.dev) through the official [`@upstash/context7-pi`](https://github.com/upstash/context7/tree/master/packages/pi) extension. Instead of relying on training data, Pi gets current library documentation directly in your coding sessions.
+
+The extension is self-contained — it registers Context7's tools natively in Pi, so there's no separate MCP server to run.
+
+## Installation
+
+Install the extension with Pi's package command:
+
+```bash
+pi install npm:@upstash/context7-pi
+```
+
+## Authentication
+
+The extension works out of the box at IP-based rate limits — useful for trying it out. For higher quotas and access to private repositories, generate a free key at the [Context7 dashboard](https://context7.com/dashboard) and export it:
+
+```bash
+export CONTEXT7_API_KEY=ctx7sk_...
+```
+
+Set it in your shell profile so Pi picks it up on launch.
+
+---
+
+## What it adds
+
+<CardGroup cols={2}>
+<Card title="resolve-library-id" icon="magnifying-glass">
+Converts a package or product name to a Context7 library ID (e.g. `Next.js` → `/vercel/next.js`). The agent calls this first.
+</Card>
+<Card title="query-docs" icon="book">
+Fetches documentation and code examples for a resolved library ID.
+</Card>
+<Card title="context7-docs skill" icon="sparkles">
+Teaches the agent to reach for these tools whenever you ask about a library, framework, SDK, API, CLI tool, or cloud service.
+</Card>
+<Card title="/c7-docs command" icon="terminal">
+Runs the resolve + query flow in one shot for manual lookups.
+</Card>
+</CardGroup>
+
+---
+
+## Using Context7
+
+Once installed, the skill triggers automatically when you ask about libraries — just ask a docs question and the tools are invoked for you:
+
+```
+how do I configure caching in Next.js 16?
+use the Prisma syntax for relations
+what are the Supabase auth methods?
+```
+
+For a manual lookup, use the slash command:
+
+```
+/c7-docs <library> <question>
+```
+
+For example:
+
+```
+/c7-docs next.js Cache Components
+/c7-docs supabase row level security
+```
+
+---
+
+## Tips
+
+<AccordionGroup>
+<Accordion title="Getting Better Results">
+- Be specific about what you're trying to do, not just which library
+- Mention versions when they matter
+- If the first result isn't right, ask for a different part of the docs
+
+```
+# Good
+How do I handle file uploads with the Supabase Storage API?
+
+# Less specific
+How does Supabase storage work?
+```
+</Accordion>
+</AccordionGroup>
diff --git a/docs/docs.json b/docs/docs.json
index 903507b2..084eb2d4 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -93,8 +93,10 @@
"group": "Clients",
"pages": [
"clients/claude-code",
+ "clients/codex",
"clients/cursor",
"clients/opencode",
+ "clients/pi",
"resources/all-clients"
]
},
diff --git a/docs/resources/all-clients.mdx b/docs/resources/all-clients.mdx
index 450c6979..b56e9a51 100644
--- a/docs/resources/all-clients.mdx
+++ b/docs/resources/all-clients.mdx
@@ -34,7 +34,7 @@ OAuth is only available for remote HTTP connections. For local MCP connections u
<Accordion title="Claude Code">
-Run this command. See [Claude Code MCP docs](https://docs.anthropic.com/en/docs/claude-code/mcp) for more info.
+Run this command. See [Claude Code MCP docs](https://code.claude.com/docs/en/mcp) for more info.
#### Local Server Connection
@@ -52,9 +52,9 @@ claude mcp add --scope user --header "CONTEXT7_API_KEY: YOUR_API_KEY" --transpor
<Accordion title="Cursor">
-Go to: `Settings` -> `Cursor Settings` -> `MCP` -> `Add new global MCP server`
+Go to: `Cursor Settings` -> `Tools & MCP` -> `New MCP Server`
-Pasting the following configuration into your Cursor `~/.cursor/mcp.json` file is the recommended approach. You may also install in a specific project by creating `.cursor/mcp.json` in your project folder. See [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol) for more info.
+Pasting the following configuration into your Cursor `~/.cursor/mcp.json` file is the recommended approach. You may also install in a specific project by creating `.cursor/mcp.json` in your project folder. See [Cursor MCP docs](https://cursor.com/docs/context/mcp) for more info.
Since Cursor 1.0, you can click the install button below for instant one-click installation.
@@ -284,42 +284,51 @@ See the [API keys guide](/howto/api-keys) for how to create one.
<Accordion title="Kilo Code">
-You can configure the Context7 MCP server in **Kilo Code** using either the UI or by editing your project's MCP configuration file.
+You can configure the Context7 MCP server in **Kilo Code** using either the UI or by editing your config file. See [Kilo Code MCP docs](https://kilo.ai/docs/automate/mcp/using-in-kilo-code) for more info.
-Kilo Code supports two configuration levels:
+Kilo Code stores MCP servers in a `kilo.jsonc` file:
-- **Global MCP Configuration** — stored in `mcp_settings.json`
-- **Project-level MCP Configuration** — stored in `.kilocode/mcp.json` (recommended)
+- **Global** — `~/.config/kilo/kilo.jsonc`
+- **Project** — `kilo.jsonc` in your project root or `.kilo/kilo.jsonc` (takes precedence)
### Configure via Kilo Code UI
-1. Open **Kilo Code**.
-2. Click the **Settings** icon in the top-right corner.
-3. Navigate to **Settings → MCP Servers**.
-4. Click **Add Server**.
-5. Choose **HTTP Server** (Streamable HTTP Transport).
-6. Enter the details:
- - **URL**: `https://mcp.context7.com/mcp`
- - **Headers → Add Header**
- - **Key:** `Authorization`
- - **Value:** `Bearer YOUR_API_KEY`
-7. Click **Save**.
+1. Click the **Settings** icon in the sidebar toolbar.
+2. Navigate to the **Agent Behaviour** tab.
+3. Select the **MCP Servers** sub-tab.
+4. Click **Add Server** and choose **Remote (HTTP)** or **Local (stdio)**.
+5. Fill in the details and save.
### Manual Configuration
-Create `.kilocode/mcp.json`:
+Add Context7 under the `mcp` key in your `kilo.jsonc`.
+
+#### Remote Server Connection
```json
{
- "mcpServers": {
+ "mcp": {
"context7": {
- "type": "streamable-http",
+ "type": "remote",
"url": "https://mcp.context7.com/mcp",
"headers": {
- "Authorization": "Bearer YOUR_API_KEY"
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
},
- "alwaysAllow": [],
- "disabled": false
+ "enabled": true
+ }
+ }
+}
+```
+
+#### Local Server Connection
+
+```json
+{
+ "mcp": {
+ "context7": {
+ "type": "local",
+ "command": ["npx", "-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
+ "enabled": true
}
}
}
@@ -421,7 +430,7 @@ Open Claude Desktop developer settings and edit your `claude_desktop_config.json
<Accordion title="ChatGPT (Web)">
-ChatGPT supports MCP servers through remote connectors via [Developer Mode](https://platform.openai.com/docs/guides/developer-mode) (beta). Available for Pro, Plus, Team, Enterprise, and Edu plans.
+ChatGPT supports MCP servers through remote connectors via [Developer Mode](https://developers.openai.com/api/docs/guides/developer-mode) (beta). Available for Pro, Plus, Team, Enterprise, and Edu plans.
#### 1. Enable Developer Mode
@@ -447,7 +456,7 @@ Start a new chat → Click the plus icon → Hover over `More` → Select the `C
Alternatively, you can say `use context7` in your prompt and ChatGPT will automatically use the `Context7` app.
-See [OpenAI MCP docs](https://platform.openai.com/docs/mcp) for more info.
+See [OpenAI MCP docs](https://developers.openai.com/api/docs/mcp) for more info.
</Accordion>
@@ -479,7 +488,7 @@ Open the ChatGPT desktop app → Start a new chat → ChatGPT will automatically
Apps configured on the web are automatically available in the desktop app.
-See [OpenAI MCP docs](https://platform.openai.com/docs/mcp) for more info.
+See [OpenAI MCP docs](https://developers.openai.com/api/docs/mcp) for more info.
</Accordion>
@@ -539,7 +548,6 @@ Or you can directly edit MCP servers configuration:
"mcpServers": {
"context7": {
"url": "https://mcp.context7.com/mcp",
- "type": "streamableHttp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
@@ -552,39 +560,32 @@ Or you can directly edit MCP servers configuration:
<Accordion title="Augment Code">
-To configure Context7 MCP in Augment Code, you can use either the graphical interface or manual configuration.
+To configure Context7 MCP in Augment Code, you can use either the graphical interface or manual configuration. See [Augment Code MCP docs](https://docs.augmentcode.com/setup-augment/mcp) for more info.
### Using the Augment Code UI
-1. Click the hamburger menu.
+1. Open the options menu in the upper right of the Augment panel.
2. Select **Settings**.
-3. Navigate to the **Tools** section.
-4. Click the **+ Add MCP** button.
-5. Enter the following command:
+3. Navigate to the **MCP** section.
+4. Click the **+** button to add a new server.
+5. Enter the name **Context7** and the command:
```
npx -y @upstash/context7-mcp@latest
```
-6. Name the MCP: **Context7**.
-7. Click the **Add** button.
-
### Manual Configuration
-1. Press Cmd/Ctrl Shift P or go to the hamburger menu in the Augment panel
-2. Select Edit Settings
-3. Under Advanced, click Edit in settings.json
-4. Add the server configuration to the `mcpServers` array in the `augment.advanced` object
+In the **MCP** section, use **Import from JSON** and paste the following (a top-level `mcpServers` object keyed by server name):
```json
-"augment.advanced": {
- "mcpServers": [
- {
- "name": "context7",
+{
+ "mcpServers": {
+ "context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
}
- ]
+ }
}
```
@@ -711,7 +712,7 @@ Use these alternatives to run the local Context7 MCP server with other runtimes.
<Accordion title="Copilot Coding Agent">
-Add the following configuration to Repository->Settings->Copilot->Coding agent->MCP configuration:
+Add the following configuration to `Repository` -> `Settings` -> `Code & automation` -> `Copilot` -> `MCP servers`. Only secrets named with the `COPILOT_MCP_` prefix are exposed to the MCP config, so store your key as a `COPILOT_MCP_CONTEXT7_API_KEY` Actions secret and reference it:
```json
{
@@ -720,7 +721,7 @@ Add the following configuration to Repository->Settings->Copilot->Coding agent->
"type": "http",
"url": "https://mcp.context7.com/mcp",
"headers": {
- "CONTEXT7_API_KEY": "YOUR_API_KEY"
+ "CONTEXT7_API_KEY": "$COPILOT_MCP_CONTEXT7_API_KEY"
},
"tools": ["query-docs", "resolve-library-id"]
}
@@ -728,7 +729,7 @@ Add the following configuration to Repository->Settings->Copilot->Coding agent->
}
```
-See the [official GitHub documentation](https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/agents/copilot-coding-agent/extending-copilot-coding-agent-with-mcp) for more info.
+See the [official GitHub documentation](https://docs.github.com/en/copilot/how-tos/agents/copilot-coding-agent/extending-copilot-coding-agent-with-mcp) for more info.
</Accordion>
@@ -789,7 +790,7 @@ Add this to your Amazon Q Developer CLI configuration file. See [Amazon Q Develo
See [Warp Model Context Protocol Documentation](https://docs.warp.dev/knowledge-and-collaboration/mcp#adding-an-mcp-server) for details.
-1. Navigate `Settings` > `AI` > `Manage MCP servers`.
+1. Navigate `Settings` > `Agents` > `MCP servers`.
2. Add a new MCP server by clicking the `+ Add` button.
3. Paste the configuration:
@@ -829,7 +830,7 @@ amp mcp add context7 --header "CONTEXT7_API_KEY=YOUR_API_KEY" https://mcp.contex
<Accordion title="Zed">
-It can be installed via [Zed Extensions](https://zed.dev/extensions?query=Context7) or you can add this to your Zed `settings.json`. See [Zed Context Server docs](https://zed.dev/docs/assistant/context-servers) for more info.
+It can be installed via [Zed Extensions](https://zed.dev/extensions?query=Context7) or you can add this to your Zed `settings.json`. See [Zed MCP docs](https://zed.dev/docs/ai/mcp) for more info.
```json
{
@@ -847,13 +848,13 @@ It can be installed via [Zed Extensions](https://zed.dev/extensions?query=Contex
<Accordion title="Smithery">
-To install Context7 MCP Server for any client automatically via [Smithery](https://smithery.ai/server/@upstash/context7-mcp):
+To install Context7 MCP Server for any client automatically via [Smithery](https://smithery.ai/servers/@upstash/context7-mcp):
```bash
-npx -y @smithery/cli@latest install @upstash/context7-mcp --client <CLIENT_NAME> --key <YOUR_SMITHERY_KEY>
+npx -y @smithery/cli@latest install @upstash/context7-mcp --client <CLIENT_NAME>
```
-You can find your Smithery key in the [Smithery.ai webpage](https://smithery.ai/server/@upstash/context7-mcp).
+See the [Context7 server page on Smithery](https://smithery.ai/servers/@upstash/context7-mcp) for more details.
</Accordion>
@@ -912,7 +913,7 @@ qwen mcp add --transport http context7 https://mcp.context7.com/mcp \
#### Local Server Connection
```sh
-qwen mcp add context7 npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
+qwen mcp add context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
```
### Manual Configuration
@@ -956,7 +957,7 @@ qwen mcp add context7 npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
1. Create a `Dockerfile`:
```Dockerfile
-FROM node:18-alpine
+FROM node:22-alpine
WORKDIR /app
RUN npm install -g @upstash/context7-mcp
CMD ["context7-mcp"]
@@ -1005,7 +1006,7 @@ The configuration on Windows is slightly different. Use `cmd` to run npx:
<Accordion title="LM Studio">
-See [LM Studio MCP Support](https://lmstudio.ai/blog/lmstudio-v0.3.17) for more information.
+See [LM Studio MCP docs](https://lmstudio.ai/docs/app/plugins/mcp) for more information.
#### One-click install:
@@ -1054,13 +1055,11 @@ Or, for a local server:
```json
{
- "mcp": {
- "servers": {
- "context7": {
- "type": "stdio",
- "command": "npx",
- "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
- }
+ "servers": {
+ "context7": {
+ "type": "stdio",
+ "command": "npx",
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
}
}
}
@@ -1259,13 +1258,7 @@ droid mcp add context7 "npx -y @upstash/context7-mcp" --env CONTEXT7_API_KEY=YOU
[Emdash](https://github.com/generalaction/emdash) is an orchestration layer for running multiple coding agents in parallel.
-**What Emdash provides:**
-
-- Global toggle: Settings → MCP → "Enable Context7 MCP"
-- Per-workspace enable: The Context7 button in the ProviderBar
-
-**What you still need to do:**
-Configure your coding agent (Codex, Claude Code, Cursor, etc.) to connect to Context7 MCP. Emdash does not modify your agent's config.
+Context7 is available as a built-in entry in Emdash's MCP catalog. Enable it from the MCP view and provide your `CONTEXT7_API_KEY` (optional, for higher rate limits). Emdash adapts and writes the MCP config into your selected coding agent's config (Codex, Claude Code, Cursor, etc.) for you.
See the [Emdash repository](https://github.com/generalaction/emdash) for more information.
@@ -1273,7 +1266,7 @@ See the [Emdash repository](https://github.com/generalaction/emdash) for more in
<Accordion title="Desktop Extension">
-Install the [context7.mcpb](https://github.com/upstash/context7/tree/master/mcpb/context7.mcpb) file and add it to your client. See [MCP bundles docs](https://github.com/anthropics/mcpb#mcp-bundles-mcpb) for more info.
+Install the [context7.mcpb](https://github.com/upstash/context7/tree/master/packages/mcp/mcpb/context7.mcpb) file and add it to your client. See [MCP bundles docs](https://github.com/modelcontextprotocol/mcpb#mcp-bundles-mcpb) for more info.
</Accordion>