Skip to content

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

feat: add Context7 Codex plugin with installation instructions and documentation (#2748)

Enes Gulesc10f1167659e
diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json
new file mode 100644
index 00000000..a017b9b9
--- /dev/null
+++ b/.agents/plugins/marketplace.json
@@ -0,0 +1,20 @@
+{
+ "name": "context7-marketplace",
+ "interface": {
+ "displayName": "Context7 Marketplace"
+ },
+ "plugins": [
+ {
+ "name": "context7",
+ "source": {
+ "source": "local",
+ "path": "./plugins/codex/context7"
+ },
+ "policy": {
+ "installation": "AVAILABLE",
+ "authentication": "ON_USE"
+ },
+ "category": "Developer Tools"
+ }
+ ]
+}
diff --git a/.gitignore b/.gitignore
index 285bbde0..cec4734d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -175,7 +175,6 @@ dist
!plugins/cursor/context7/.cursor
.opencode
.claude
-.agents
# Finder (MacOS) folder config
.DS_Store
diff --git a/docs/clients/codex.mdx b/docs/clients/codex.mdx
index e3556340..58383db9 100644
--- a/docs/clients/codex.mdx
+++ b/docs/clients/codex.mdx
@@ -17,7 +17,16 @@ Run the setup command to configure Context7 for Codex:
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.
+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, which shows a verification link and short code you open on any device, so it works locally, on SSH hosts, and in headless environments.
+
+You can also install Context7 as a Codex plugin. It connects to the hosted MCP server and includes a skill that looks up documentation when you ask about libraries:
+
+```bash
+codex plugin marketplace add upstash/context7
+codex plugin add context7@context7-marketplace
+```
+
+After adding the plugin, a browser window opens so you can log in to Context7 via OAuth — plugin installs use your account's authenticated rate limits too. Start a new Codex thread after installation so Codex can load the plugin's skill and MCP tools.
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).
@@ -39,7 +48,7 @@ The web-based agent that runs tasks in cloud environments. Add Context7 to the t
### Codex CLI
-Add Context7 from the terminal with the `codex mcp add` command:
+If you only want the MCP server, 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
@@ -74,7 +83,7 @@ Codex Cloud delegates tasks to OpenAI's agent in managed cloud environments, so
## Using Context7
-With `ctx7 setup`, a skill is installed that triggers automatically when you ask about libraries. You can also invoke it explicitly:
+With `ctx7 setup` or the plugin, a skill 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
diff --git a/docs/resources/all-clients.mdx b/docs/resources/all-clients.mdx
index 29bae380..40368c9c 100644
--- a/docs/resources/all-clients.mdx
+++ b/docs/resources/all-clients.mdx
@@ -131,6 +131,17 @@ Add this to your Opencode configuration file. See [Opencode MCP docs](https://op
See [OpenAI Codex MCP docs](https://developers.openai.com/codex/mcp) for more info.
+#### Context7 Plugin
+
+You can also install Context7 as a Codex plugin. It connects to the hosted MCP server and includes a documentation lookup skill. After installation, a browser window opens so you can log in via OAuth.
+
+```sh
+codex plugin marketplace add upstash/context7
+codex plugin add context7@context7-marketplace
+```
+
+Start a new Codex thread after installation so Codex can load the plugin.
+
#### Using CLI
```sh
diff --git a/plugins/codex/context7/.codex-plugin/plugin.json b/plugins/codex/context7/.codex-plugin/plugin.json
new file mode 100644
index 00000000..f4c63bef
--- /dev/null
+++ b/plugins/codex/context7/.codex-plugin/plugin.json
@@ -0,0 +1,32 @@
+{
+ "name": "context7",
+ "version": "1.0.1",
+ "description": "Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.",
+ "author": {
+ "name": "Upstash",
+ "email": "[email protected]",
+ "url": "https://upstash.com"
+ },
+ "homepage": "https://context7.com",
+ "repository": "https://github.com/upstash/context7",
+ "license": "MIT",
+ "keywords": ["documentation", "context", "mcp", "library-docs"],
+ "skills": "./skills/",
+ "mcpServers": "./.mcp.json",
+ "interface": {
+ "displayName": "Context7",
+ "shortDescription": "Fetch current library documentation in Codex",
+ "longDescription": "Context7 adds current, version-aware library documentation and code examples to Codex through the Context7 MCP server.",
+ "developerName": "Upstash",
+ "category": "Developer Tools",
+ "capabilities": ["Read"],
+ "websiteURL": "https://context7.com",
+ "privacyPolicyURL": "https://upstash.com/privacy",
+ "termsOfServiceURL": "https://upstash.com/terms",
+ "defaultPrompt": [
+ "Use Context7 for Next.js middleware docs.",
+ "Find current Prisma relation query examples."
+ ],
+ "brandColor": "#059669"
+ }
+}
diff --git a/plugins/codex/context7/.mcp.json b/plugins/codex/context7/.mcp.json
new file mode 100644
index 00000000..c5280c5f
--- /dev/null
+++ b/plugins/codex/context7/.mcp.json
@@ -0,0 +1,8 @@
+{
+ "mcpServers": {
+ "context7": {
+ "type": "http",
+ "url": "https://mcp.context7.com/mcp"
+ }
+ }
+}
diff --git a/plugins/codex/context7/README.md b/plugins/codex/context7/README.md
new file mode 100644
index 00000000..0eaa4123
--- /dev/null
+++ b/plugins/codex/context7/README.md
@@ -0,0 +1,77 @@
+# Context7 Plugin for Codex
+
+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.
+
+## Installation
+
+Add the Context7 marketplace and install the plugin:
+
+```bash
+codex plugin marketplace add upstash/context7
+codex plugin add context7@context7-marketplace
+```
+
+After adding the plugin, a browser window opens so you can log in to Context7 via OAuth. Start a new Codex thread after installation so Codex can load the plugin's skill and MCP tools.
+
+## What's Included
+
+This plugin provides:
+
+- **MCP Server** - Connects Codex to Context7's documentation service
+- **Skills** - Auto-triggers documentation lookups when you ask about libraries
+
+## Authentication
+
+The plugin connects to the hosted Context7 MCP server:
+
+```json
+{
+ "type": "http",
+ "url": "https://mcp.context7.com/mcp"
+}
+```
+
+When you add the plugin, a browser window opens to log in to Context7 via OAuth, so your requests use your account's authenticated rate limits. On remote or headless machines where a browser can't open, run `npx ctx7 setup --codex` instead — it uses the OAuth device flow and writes an API-key-backed configuration to `~/.codex/config.toml`. Create or manage API keys in the [Context7 dashboard](https://context7.com/dashboard).
+
+## Available Tools
+
+### resolve-library-id
+
+Searches for libraries and returns Context7-compatible identifiers.
+
+```text
+Input: "next.js"
+Output: { id: "/vercel/next.js", name: "Next.js", versions: ["v15.1.8", "v14.2.0", ...] }
+```
+
+### query-docs
+
+Fetches documentation for a specific library, ranked by relevance to your question.
+
+```text
+Input: { libraryId: "/vercel/next.js", query: "app router middleware" }
+Output: Relevant documentation snippets with code examples
+```
+
+## Usage Examples
+
+The bundled skill works automatically when you ask about libraries:
+
+- "How do I set up authentication in Next.js 15?"
+- "Show me React Server Components examples"
+- "What's the Prisma syntax for relations?"
+
+You can also invoke it explicitly:
+
+```text
+use context7 for Next.js middleware docs
+use context7 for Prisma query examples with relations
+use context7 for the Supabase syntax for row-level security
+```
+
+To get documentation for a specific version, include the version in the library ID:
+
+```text
+/vercel/next.js/v15.1.8
+/supabase/supabase/v2.45.0
+```
diff --git a/plugins/codex/context7/skills/context7-mcp/SKILL.md b/plugins/codex/context7/skills/context7-mcp/SKILL.md
new file mode 100644
index 00000000..234659d9
--- /dev/null
+++ b/plugins/codex/context7/skills/context7-mcp/SKILL.md
@@ -0,0 +1,53 @@
+---
+name: context7-mcp
+description: This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.
+---
+
+When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data.
+
+## When to Use This Skill
+
+Activate this skill when the user:
+
+- Asks setup or configuration questions ("How do I configure Next.js middleware?")
+- Requests code involving libraries ("Write a Prisma query for...")
+- Needs API references ("What are the Supabase auth methods?")
+- Mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)
+
+## How to Fetch Documentation
+
+### Step 1: Resolve the Library ID
+
+Call `resolve-library-id` with:
+
+- `libraryName`: The library name extracted from the user's question
+- `query`: The user's full question (improves relevance ranking)
+
+### Step 2: Select the Best Match
+
+From the resolution results, choose based on:
+
+- Exact or closest name match to what the user asked for
+- Higher benchmark scores indicate better documentation quality
+- If the user mentioned a version (e.g., "React 19"), prefer version-specific IDs
+
+### Step 3: Fetch the Documentation
+
+Call `query-docs` with:
+
+- `libraryId`: The selected Context7 library ID (e.g., `/vercel/next.js`)
+- `query`: The user's specific question
+
+### Step 4: Use the Documentation
+
+Incorporate the fetched documentation into your response:
+
+- Answer the user's question using current, accurate information
+- Include relevant code examples from the docs
+- Cite the library version when relevant
+
+## Guidelines
+
+- **Be specific**: Pass the user's full question as the query for better results
+- **Version awareness**: When users mention versions ("Next.js 15", "React 19"), use version-specific library IDs if available from the resolution step
+- **Prefer official sources**: When multiple matches exist, prefer official/primary packages over community forks