Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计异常

codex-mcpCodex MCP 搜索

Agent Skill

codex-mcp 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

449

周安装

18

GitHub Stars

公开资料未说明

下载量

145
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:codex-mcp(Codex MCP 搜索)
来源仓库:https://github.com/krishamaze/skills
仓库路径:skills/codex-mcp
安装命令:
npx skills add https://github.com/krishamaze/skills --skill codex-mcp
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/krishamaze/skills --skill codex-mcp

简介

codex-mcp 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于关键词搜索、任务场景匹配或来源线索梳理等研究检索场景。
  • 通过 npx 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网或文件操作。
  • codex-mcp 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

The Iron Law

WHEN CODEX MCP TOOLS ARE AVAILABLE, YOU DO NOT EXECUTE WORK YOURSELF.

You are a controller — plan what to do, craft prompts, route to threads, report results. The reason: Codex maintains its own context per thread. When you read files or write code directly, that work is invisible to Codex's threads. Future Codex turns will contradict or overwrite your direct changes because they don't know about them. Delegation isn't a preference — it's how context stays consistent.

Common Rationalizations

RationalizationReality
"Codex returned empty so let me just do it"Empty = signal to report, not permission to execute. The user chose delegation for a reason.
"This is simpler to do directly"Simpler ≠ permitted. Every direct action breaks Codex's context chain.
"Codex timed out so I'll handle it"Timeout = break the task smaller or increase timeout, then re-dispatch.
"I'll just check this one file quickly"Explore mode exists for this. codex_run(mode=explore).
"The tool errored, I need to work around it"Report the error to the user and let them decide. Working around it silently defeats the pattern.
"I already know the answer from context"Your context may be stale. Verify through Codex — it reads the current file system.

Interpreting codex_run results

The wrapper returns a status field in structuredContent. Use this decision tree:

StatusHow to detectController action
DONEoutput has content, no errorsSummarize result, proceed to next step
EMPTYoutput blank/missing, no errorsReport to user: "codex returned no output on thread X." Do NOT do the work yourself.
ERRORerrors array non-emptySurface error to user. Do not retry yourself.
TIMEOUTerror contains "timeout"Break task smaller or pass higher timeout=, re-dispatch.
STALE_THREADthread resume failsStart fresh thread — omit thread_id on next call.

Mode routing

Pick the right mode for the task:

Controller doesCodex does (via tool)
Plan next stepcodex_run(mode=explore) — read/navigate codebase
Targeted read-only follow-upcodex_run(mode=inspect) — inspect files, config, injected context
Craft the build promptcodex_run(mode=build) — write, edit, execute code
Describe the bugcodex_run(mode=debug) — reproduce → diagnose → fix → verify
Request test coveragecodex_run(mode=test) — write and run tests
Need current informationcodex_run(mode=research) — web search, no file writes
Request independent evaluationcodex_review — code review in isolated thread

Tools

ToolModesThreadPurpose
codex_runexplorenew or resumeRead/navigate codebase — never modifies files
codex_runinspectnew or resumeTargeted read-only checks on files, config, or injected context
codex_runbuildnew or resumeWrite, edit, create, and run code
codex_rundebugnew or resumeReproduce → diagnose → fix → verify a bug
codex_runtestnew or resumeWrite or run tests, report pass/fail
codex_runresearchnew or resumeWeb search only — no file writes
codex_reviewisolatedIndependent code review with structured targets (e.g. uncommitted changes, branches)

Pass thread_id to resume an existing thread. Omit to start fresh. codex_review threads are namespace-isolated — never pass a review thread_id to codex_run or vice versa (the server enforces this with a hard error).

Use explore for broad discovery and mapping. Use inspect for narrow read-only checks, especially when driven by injected context or a specific file/config target.

Prompting Codex well

Every prompt should contain: what to do + where (file paths) + expected outcome + constraints. Pick the right mode — its baked-in role prefix handles the rest.

Incremental prompting: one focused task per call, pass thread_id to continue. Codex accumulates context across calls — the second call already knows what the first found. This gives better results than broad prompts and prevents inactivity timeouts on large scopes.

codex_run(explore, prompt="Map skills-lab/project-memory/")          → T1
codex_run(explore, thread_id=T1, prompt="Now map skills-lab/codex-mcp/")

Each mode's role prefix instructs Codex to use subagents for parallelism (file reading, multi-file edits, test execution). This produces a denser event stream that reduces timeout risk, but focused prompts still give higher quality results than broad ones.

If a single call is legitimately large, pass timeout=120 or timeout=180.

codex_run(explore): "List all exported functions in src/auth/ and their error handling patterns."
codex_run(inspect): "Use the injected `pwd` output and report the exact project root."
codex_run(build):   "Add null checks to all auth functions that access user.email."
codex_run(build, thread_id=T1): "Also add the same null checks in src/payment/."
codex_run(test):    "Write tests for the null-check cases in src/auth/. Cover: null, undefined, empty string."
codex_review:       "Read src/auth/. Requirement: every user.email access has a null check. List any gaps."
codex_run(debug):   "Login fails with TypeError on line 42 of src/auth.ts when email is null. Fix it."

Review pattern: after codex_run(mode=build) changes code, use codex_review with a structured target (target="uncommitted_changes") to automatically evaluate your local workspace diff against the original requirement in a fresh thread, completely isolated from self-review bias. Use target="base_branch", branch="main" for PR-level reviews.

Thread registry

The server tracks threads in memory/codex-threads.json — mapping thread IDs to topics so you route to the right thread by topic, not by recency. Threads persist across server restarts via thread/resume.

See references/thread-registry.md for the full schema, maintenance rules (when to add/update/close rows), and the routing decision tree (how to pick the right thread_id before each call).

Setup workflow

If the tools are NOT available, run this setup. Do not proceed with the user's actual task through direct local work.

npx skills add already places the server script at a stable project path: .agents/skills/codex-mcp/scripts/codex-mcp-server.mjs (symlinked into .claude/skills/). No global copy is needed. Setup just wires the MCP entry.

See references/setup.md for per-agent config snippets and Windows commands.

  1. Read-only preflight — gather facts without writing anything:

- Resolve the absolute path to .agents/skills/codex-mcp/scripts/codex-mcp-server.mjs - Check codex CLI is installed - Check .codex/config.toml has a model line - Config-drift check: read the args value for codex-mcp in the active agent config and compare it to the resolved project-local path. If they differ, flag as a required fix. - Identify which agent is invoking this skill

  1. Present findings and wait — report what exists, what's missing, what you intend to write. Stop and wait for explicit user approval before any writes.
  2. Configure the invoking agent only — add the MCP entry pointing to the resolved absolute path. Use resolved absolute paths (never ~ or $HOME). Do not copy the script elsewhere. Do not modify other agent configs unless the user explicitly asks.
  3. Add memory/codex-threads.json to project .gitignore — per project.
  4. Tell the user to restart — do not continue the original task in the same session unless MCP tools are already loaded.
  5. Post-restart health probe — in the new session, make one lightweight codex_run(mode=inspect, prompt="echo ok") call before starting real work. If this returns Transport closed or fails, setup is not done — go to the "On failure" section.

On failure

Tools visible but transport immediately closed:

  1. Do not retry blindly. The transport is dead, not slow.
  2. Check for config-path drift: does the registered args path match the actual project-local script path? Fix and restart.
  3. If the path is correct, verify wrapper and app-server independently:

- Windows: see references/troubleshooting-windows.md - Unix / macOS: run the wrapper directly (node "$(realpath.agents/skills/codex-mcp/scripts/codex-mcp-server.mjs)"); then run codex app-server standalone.

  1. Tell the user exactly which step failed.

General failure or timeout:

  1. Run a follow-up task to check status.
  2. If it fails again, report to the user — do not fall back to direct execution.

Troubleshooting

ProblemFix
"Codex CLI not found"npm install -g @openai/codex
Tools don't appear in agentCheck config path is absolute. Restart agent session.
Wrong project used for memory/Always pass project_dir explicitly.
Timeout errorsPass timeout=120 or 180. Break work into resumable thread_id steps.
"app-server exited"Check .codex/config.toml has a valid model.
Transport closed (any platform)Check config-path drift first. Then see references for platform-specific diagnosis.
Turn hangs then times outLikely an unhandled approval request. Update wrapper to latest version.
"Codex completed with no output"Check the errors field — rate limits and model errors surface there.
bwrap/sandbox errorsExpected in containers. Server uses danger-full-access sandbox mode.
Thread state lost after restartExpected — server state is in-memory. Registry handles this.
Wrong thread routedCheck memory/codex-threads.json. Topics are human-readable.
Cross-namespace thread_id errorYou passed a review thread_id to codex_run or vice versa.

Architecture

Agent (Claude Code / Gemini CLI / Cursor / Codex CLI / Antigravity / Augment)
  └─ MCP protocol (stdio)
      └─ codex-mcp-server.mjs  (.agents/skills/codex-mcp/scripts/)
          ├─ runServers map    (per projectDir, codex_run threads)
          ├─ reviewServers map (per projectDir, codex_review threads, isolated)
          └─ Codex app-server (JSON-RPC over stdio)
              └─ GPT model (reads, writes, executes)

<project-root>/memory/codex-threads.json
  └─ thread registry (topic-based routing, managed by the orchestrating agent)
     created automatically on first tool call, isolated per project

The MCP server spawns one app-server process per namespace per project directory and keeps it alive across tool calls. On shutdown (SIGINT/SIGTERM), all app-server processes are cleaned up.

The wrapper handles the core protocol surface: turn lifecycle, text output, diffs, file writes, command/file/permissions approvals, and token usage. Some newer methods (thread/fork, turn/steer, tool forwarding via item/tool/call) are not yet supported — unhandled server requests receive a JSON-RPC -32601 error to prevent silent hangs.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.04%
按下载量换算55

Claude

28.52%
按下载量换算41

Cursor

17.51%
按下载量换算25

Gemini CLI

9.17%
按下载量换算13

安全审计

Gen Agent Trust Hub

可疑

Socket

可疑

Snyk

未通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills