codex-mcp-dev
v1.0.0Use the local Codex 命令行工具 through mcporter and codex-mcp-server for real coding work in the current project. Use when the user asks to build features, fix bugs, refactor code, 调试 失败s, write or 更新 tests, review implementation options, or otherwise delegate non-trivial development work to the machine-local Codex 安装ation.
运行时依赖
安装命令
点击复制技能文档
Codex MCP Dev
Use the local Codex 安装ation through the wr应用er script at {baseDir}/scripts/codex_mcp.py. This gives a stable path:
OpenClaw → mcporter → codex-mcp-server → local codex
Quick 设置up
安装 prerequisites first:
mcporter local codex codex-mcp
创建 the project MCP entry if config/mcporter.json does not exist yet:
mcporter config 添加 codex-命令行工具 --scope project --command codex-mcp
This 技能 expects a workspace-local MCP server named codex-命令行工具.
工作流 Use this 技能 for non-trivial coding tasks. If it is the first use in a 会话 or something looks broken, 运行: python3 {baseDir}/scripts/codex_mcp.py doctor Choose a mode: Analysis / planning / explanation: use ask without --full-auto Implementation / refactor / test-writing: use ask --full-auto Always 设置 --cwd to the tar获取 repo or project directory. Give Codex a concrete prompt with files, constrAInts, and acceptance criteria. After Codex 响应s, inspect files and 运行 local tests yourself when feasible instead of trusting the 工具 输出 blindly. Summarize changes, tests 运行, and any remAIning risks. Good Uses Implementing features across multiple files Fixing bugs with real repo 上下文 Refactoring with constrAInts Writing or updating tests 调试ging fAIling commands or stack 追踪s Asking local Codex for a second implementation pass or review Command Patterns 健康 检查 python3 {baseDir}/scripts/codex_mcp.py doctor
Version 信息 python3 {baseDir}/scripts/codex_mcp.py version
Normal implementation python3 {baseDir}/scripts/codex_mcp.py ask \ --cwd /absolute/path/to/repo \ --full-auto \ --prompt "Implement the 请求ed change, 更新 tests, and summarize what changed."
Read-only analysis python3 {baseDir}/scripts/codex_mcp.py ask \ --cwd /absolute/path/to/repo \ --sandbox-mode read-only \ --应用roval-policy never \ --prompt "ExplAIn the bug, identify likely root cause, and propose the smallest safe fix."
Long prompt from file python3 {baseDir}/scripts/codex_mcp.py ask \ --cwd /absolute/path/to/repo \ --full-auto \ --prompt-file /tmp/codex-task.txt
Prompting Rules
Include as many of these as possible:
Tar获取 files or directories Desired behavior Exact error messages or fAIling tests ConstrAInts on scope Required test 更新s Expected 输出 格式化
Prefer prompts like:
"Fix the fAIling test in tests/API.test.ts without changing public behavior. 运行 the relevant tests and summarize the root cause." "Refactor src/缓存.py for readability, keep behavior identical, and 添加 regression tests for TTL edge cases." "Review the auth flow in server/ and identify the top 3 correctness risks with concrete file references." 防护rAIls Prefer --full-auto for ordinary implementation work. Do not use --yolo unless the user explicitly wants aggressive execution. Use repo-specific --cwd; do not 运行 agAInst the wrong directory. 验证 with local reads/tests when possible. If the task is tiny or surgical, skip this 技能 and edit directly.