Context7
Up-to-date docs for AI agents
作者提供的说明(英文原文)
Delegate coding tasks to the OpenAI Codex CLI, installed separately, with explicit model and effort.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR, CODEX_SUBAGENT_MAX_BACKGROUND_JOBS, CODEX_SUBAGENT_USAGE_LOG, CODEX_SUBAGENT_DEFAULT_MODEL, CODEX_SUBAGENT_DEFAULT_EFFORT, CODEX_SUBAGENT_ALLOWED_MODELS, CODEX_SUBAGENT_DEFAULT_SANDBOX, CODEX_SUBAGENT_MAX_SANDBOX, CODEX_SUBAGENT_MAX_EFFORT, CODEX_SUBAGENT_MCP_SERVERS, CODEX_SUBAGENT_PLUGINS, CODEX_SUBAGENT_APPS, CODEX_BIN你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"codex-subagent": {
"command": "npx",
"args": [
"-y",
"codex-subagent-mcp"
],
"env": {
"CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "your-value",
"CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "your-value",
"CODEX_SUBAGENT_USAGE_LOG": "your-value",
"CODEX_SUBAGENT_DEFAULT_MODEL": "your-value",
"CODEX_SUBAGENT_DEFAULT_EFFORT": "your-value",
"CODEX_SUBAGENT_ALLOWED_MODELS": "your-value",
"CODEX_SUBAGENT_DEFAULT_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_EFFORT": "your-value",
"CODEX_SUBAGENT_MCP_SERVERS": "your-value",
"CODEX_SUBAGENT_PLUGINS": "your-value",
"CODEX_SUBAGENT_APPS": "your-value",
"CODEX_BIN": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add codex-subagent --env CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR=your-value --env CODEX_SUBAGENT_MAX_BACKGROUND_JOBS=your-value --env CODEX_SUBAGENT_USAGE_LOG=your-value --env CODEX_SUBAGENT_DEFAULT_MODEL=your-value --env CODEX_SUBAGENT_DEFAULT_EFFORT=your-value --env CODEX_SUBAGENT_ALLOWED_MODELS=your-value --env CODEX_SUBAGENT_DEFAULT_SANDBOX=your-value --env CODEX_SUBAGENT_MAX_SANDBOX=your-value --env CODEX_SUBAGENT_MAX_EFFORT=your-value --env CODEX_SUBAGENT_MCP_SERVERS=your-value --env CODEX_SUBAGENT_PLUGINS=your-value --env CODEX_SUBAGENT_APPS=your-value --env CODEX_BIN=your-value -- npx -y codex-subagent-mcp运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"codex-subagent": {
"command": "npx",
"args": [
"-y",
"codex-subagent-mcp"
],
"env": {
"CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "your-value",
"CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "your-value",
"CODEX_SUBAGENT_USAGE_LOG": "your-value",
"CODEX_SUBAGENT_DEFAULT_MODEL": "your-value",
"CODEX_SUBAGENT_DEFAULT_EFFORT": "your-value",
"CODEX_SUBAGENT_ALLOWED_MODELS": "your-value",
"CODEX_SUBAGENT_DEFAULT_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_EFFORT": "your-value",
"CODEX_SUBAGENT_MCP_SERVERS": "your-value",
"CODEX_SUBAGENT_PLUGINS": "your-value",
"CODEX_SUBAGENT_APPS": "your-value",
"CODEX_BIN": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"codex-subagent": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"codex-subagent-mcp"
],
"env": {
"CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "your-value",
"CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "your-value",
"CODEX_SUBAGENT_USAGE_LOG": "your-value",
"CODEX_SUBAGENT_DEFAULT_MODEL": "your-value",
"CODEX_SUBAGENT_DEFAULT_EFFORT": "your-value",
"CODEX_SUBAGENT_ALLOWED_MODELS": "your-value",
"CODEX_SUBAGENT_DEFAULT_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_EFFORT": "your-value",
"CODEX_SUBAGENT_MCP_SERVERS": "your-value",
"CODEX_SUBAGENT_PLUGINS": "your-value",
"CODEX_SUBAGENT_APPS": "your-value",
"CODEX_BIN": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR envCODEX_SUBAGENT_MAX_BACKGROUND_JOBS envCODEX_SUBAGENT_USAGE_LOG envCODEX_SUBAGENT_DEFAULT_MODEL envCODEX_SUBAGENT_DEFAULT_EFFORT envCODEX_SUBAGENT_ALLOWED_MODELS envCODEX_SUBAGENT_DEFAULT_SANDBOX envCODEX_SUBAGENT_MAX_SANDBOX envCODEX_SUBAGENT_MAX_EFFORT envCODEX_SUBAGENT_MCP_SERVERS envCODEX_SUBAGENT_PLUGINS envCODEX_SUBAGENT_APPS envCODEX_BIN env这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日
注册名称已通过 GitHub 账户 parisbs 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.6.0)于17天前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
同一分类中有:Context7, Codebase Memory, Exa
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
An MCP server that lets Claude Code delegate coding tasks to OpenAI's Codex CLI running on the same machine, with the model and reasoning depth chosen per task. Claude stays the orchestrator. Codex becomes a subagent it can call.
An independent project. Not affiliated with, endorsed by, or supported by OpenAI or Anthropic.
Requires Node.js 22+ and the [Codex CLI](https://developers.openai.com/codex/cli) installed, on PATH, and signed in.
claude mcp add codex-subagent -- npx -y codex-subagent-mcp
Ask Claude to run codex_doctor if anything is missing. See [docs/INSTALL.md](docs/INSTALL.md) for platform setup, Claude Desktop and other installation options, and Safety before enabling writes.
output_schema returns JSON that matches your schema, for results Claude can act on directly.A real read-only delegation asking for the package name, captured 2026-09-30:
codex-subagent-mcp
Commands run (1 total):
model=gpt-5.6-luna | effort=low | sandbox=read-only | working_dir=/Users/you/project | applied=confirmed | duration=8s | tokens=in 35701 (cached 28160, uncached 7541) / out 88 (reasoning 9) | thread_id=01a0f419-9fd2-79e2-8248-91436f04e297
A single model doing everything has three recurring problems, and delegation solves each one:
Your context window is finite. Having Claude read forty files to answer one question spends context you need for the actual work. Delegating the investigation returns the answer instead of the forty files.
One model has one set of blind spots. A second opinion is worth most when it comes from a different model family — different training, different failure modes. Asking the same model twice mostly gets you the same answer twice.
Not every task deserves the same reasoning budget. Renaming a variable and diagnosing a race condition are not the same job. Here they are separate dials: the *model* sets raw capability, the *reasoning effort* sets how long it deliberates. Cheap work goes to a fast model; a hard problem gets the capable one thinking for as long as it needs.
The server runs on your machine and drives the Codex CLI you already have installed; it holds no credentials of its own. Prompts reach OpenAI through Codex, exactly as when you run codex yourself.
See How it compares for a versioned comparison with other Codex MCP servers.
A delegation gets expensive when repeated commands keep adding output to the context carried into later requests. Name the exact question, likely files, stopping condition and evidence the answer must contain; choose higher effort for ambiguity rather than by habit. [Writing a delegation](docs/DELEGATING.md) gives the measured cost model, ranked rules and weak-versus-strong examples using the real tool parameters. Background goes in context and a persona or extra rules in system_instructions, both layered on the built-in quality contract; see the tool reference.
The value here is not a second run — it is a different set of blind spots.
Ask Codex to review
src/server.tsfor correctness problems, focusing on error paths. Use a high
reasoning effort and tell it to report each finding with the line and why it matters.
A delegated review like this found the terminate() defect in this repository's own runner: two code paths could each arm a timer while only one was ever cleared.
Forty files go into the delegation; one answer comes back. Codex runs its own searches and reads whatever it needs; your conversation receives the conclusion.
Have Codex trace how a reasoning effort travels from the MCP tool call down to the arguments
handed to the Codex CLI, and report just the call chain.
Kick off a Codex run in the background that writes unit tests for
src/jobs.ts, then keep helping
me with the API layer.
You get a job_id immediately. Ask for the status whenever you want, and read the result when it is done. Up to eight can run at once; CODEX_SUBAGENT_MAX_BACKGROUND_JOBS can lower that cap. A background request cancelled before its job is created starts nothing.
Raising the reasoning effort for the whole conversation is expensive. Raising it for one delegation is not.
This intermittent test failure has beaten me twice. Ask Codex to work out the root cause at
maximum reasoning effort, give it
test/runner.test.tsand the CI log, and tell it not to change
anything — I want the diagnosis first.
Ask Codex to expand on its second finding.
Follow-ups reuse Codex's context, so they cost a fraction of the original. The server restates the same model, effort and directory on every follow-up because Codex itself does not keep them on resume.
Have Codex apply its first two suggestions. Let it edit files, but keep it inside a git worktree
so my working tree stays clean.
use_worktree sends the run's edits to ~/.codex/worktrees/; results list the file changes Codex reported and where each landed, up to a thousand distinct entries, then report the omitted count, and a line names the worktree and the commit it was made from. Codex is told beforehand that uncommitted changes, untracked files and ignored files such as installed dependencies are not in it. The server does not clean worktrees up: they may hold unapplied work. The experimental feature is enabled only for that invocation; your Codex configuration is unchanged. A follow-up continues in the same worktree; when Codex's session file could not confirm where that was, the follow-up asks for working_dir rather than resume in your working tree. See Safety for the write boundary.
Whatever the sandbox, a delegation that writes reports the file changes Codex recorded. It is Codex's account, not a diff of the disk:
Files changed (2):
This server runs another program on your machine, so it is worth two minutes before you enable writes.
Delegations are read-only by default. Writing requires an explicit sandbox: "workspace-write" or a user-set default. use_worktree sends edits to a managed git worktree instead of your checkout; the sandbox and add_dirs bound where it can write at all. Unsandboxed runs are unavailable unless you explicitly opt into that ceiling.
The confinement is the operating system's own sandbox: Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native sandbox on Windows. The table was measured on macOS; SECURITY.md records the measurement details. Linux and Windows have not been measured here, and OpenAI's Windows documentation notes that sandboxed commands can fail to read some directories, so reads may be stricter there:
read-only | workspace-write | danger-full-access | |
|---|---|---|---|
| Write inside the working directory | no | yes | yes |
| Write outside it (your home) | no | no | yes |
| Network access | no | no | yes |
| Read outside the working directory | yes | yes | yes |
The server chooses the sandbox mode on every run; Codex's own sandbox_workspace_write settings, such as network access or extra writable roots, are not overridden and still apply under workspace-write. The table reflects Codex's defaults.
The sandbox confines the commands Codex runs in its shell. It does not confine MCP or plugin tools: those run as their own processes with your account's full permissions, network included, and under read-only a tool that declares itself read-only runs without approval (measured on codex-cli 0.159.2; ADR 16). So a delegation inherits no MCP server, plugin or app from your Codex setup unless you allow it in the server configuration, and every delegation result includes a line saying what the run was allowed.
There is no shell in the server's invocation path: the CLI is spawned with an argv array and the prompt is written to its stdin, never interpolated into a command string. Shell metacharacters in a prompt are inert.
Reads are not confined. Codex can read anything your user account can, in every mode — your SSH keys, your cloud credentials. That was measured on macOS, and it is the safe assumption on every platform. Sandboxed network access is blocked so it cannot send them anywhere, but its report comes back to you, and that is a channel.
A prompt is untrusted input, and Codex acts on it. Content you did not write — an issue body, a web page, a log, a file from someone else's repository — can carry instructions. With workspace-write it can direct Codex to modify your repository; even read-only it can direct Codex to read something sensitive and put it in the answer. The sandbox bounds *where* Codex can write. It does not judge *what* it should write, or why it was asked. This is prompt injection, and it is the risk that matters here.
The result is not sanitised. What comes back is text from a model that just read your files. Treat it as data, not as instructions; review what a delegation did rather than assuming it did what you asked.
CODEX_SUBAGENT_MAX_SANDBOX=read-only. No conversation can argue past a ceiling. Register it outside the repository (Claude Code's default local scope, --scope user, or Claude Desktop's config), not in a project .mcp.json that a write-enabled delegation could edit. See Configuration.use_worktree so changes land somewhere you can inspect before they touch your branch.auto_approve its tools need no approval at all.SECURITY.md has the full threat model, what a deny_read policy could add, and how to report a vulnerability.
Everything is optional, and set through environment variables on the MCP server:
| Variable | Values | Default | Effect |
|---|
| `CODEX_SUBAGENT_DEFAULT_MO
只显示了开头部分;其余内容请在仓库中阅读