Borrowing it
Nothing to install: this file belongs to RS-Nocsi/codex-cua-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/RS-Nocsi/codex-cua-mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/RS-Nocsi/codex-cua-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/rs-nocsi/codex-cua-mcp/claude-md)<a href="https://agentmods.dev/instructions/rs-nocsi/codex-cua-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/rs-nocsi/codex-cua-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/rs-nocsi/codex-cua-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/rs-nocsi/codex-cua-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00928 | $0.00928 |
| Opus 5 | $0.00464 | $0.00464 |
| Sonnet 5 | $0.00186 | $0.00186 |
| Haiku 4.5 | $0.00093 | $0.00093 |
Grade A, and why
codex-cua-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 55 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
本文档为 Claude Code(claude.ai/code)在此仓库中工作时提供指导。
项目概述
Codex CUA MCP 将 Codex 的 codex-computer-use.exe 封装为标准 MCP 服务器,使任何支持 MCP 的智能体(Claude Code、Cursor、Windsurf 等)能够通过截图、点击、打字和键盘输入来控制 Windows 桌面应用程序。
命令
npm run build # 将 TypeScript 编译到 dist/
npm start # 启动 MCP 服务器(需要 dist/ 已存在)
架构
智能体(Claude Code、Cursor 等)
↓ MCP 协议(stdio)
src/index.ts # MCP 服务器入口,stdio 传输层,读取 clientInfo
↓
src/server.ts # CodexCuaServer - 定义 13 个工具,懒启动 exe
↓
src/agent-name.ts # 解析调用方显示名(env > 映射表 > Title Case > 兜底)
src/runtime-config.ts # 为每个 Agent 渲染独立 config 到 config-runtime/<slug>/
↓
src/transport/sky.ts # SkyTransport - 启动 exe,通过 stdin/stdout 进行 JSON-RPC 通信
↓
bin/codex-computer-use.exe # 原生 Windows 二进制文件(SendInput、UI Automation)
关键流程:MCP 握手完成 → 首次工具调用时 server.ts 解析 Agent 名、渲染运行时 config、懒启动 exe → sky.ts 发送 JSON-RPC → exe 在 Windows 上执行 → 返回响应。多个 Agent 各自启动独立 exe 进程与 CODEX_HOME,互不冲突。
通信协议
exe 通过 stdin/stdout 使用换行分隔的 JSON-RPC 协议:
- 请求:
{"id": N, "method": "...", "params": {...}} - 成功:
{"id": N, "ok": true, "result": {...}} - 需要审批:
{"id": N, "ok": false, "approvalRequest": {"app": "...", "displayName": "...", "riskLevel": "low"}} - 审批响应:重新发送原始请求并附带
meta: {"x-oai-cua-approved-app": "<app>"}
重要实现细节
- 懒启动:exe 在首次工具调用时才 spawn(
CodexCuaServer.ensureStarted()),握手阶段不启动。index.ts通过getClientInfo回调把server.getClientVersion()传入,供名字解析使用。 - 动态 Agent 名:
agent-name.ts按优先级解析调用方显示名——CUA_AGENT_NAME环境变量 > MCPclientInfo.name映射表 > Title Case 兜底 >"AI Agent"。名字写入桌面操作浮层文案。 - 审批处理:每个操作(launch_app、get_window_state、click、type_text 等)在首次使用某个应用时会触发审批请求。
SkyTransport默认自动审批,并重新发送带有审批元数据的请求。 - 窗口状态要求:输入操作(click、type、press_key、scroll、drag)需要先对目标窗口调用
get_window_state。 - 配置隔离:
runtime-config.ts把config/computer-use/config.json模板(含{{AGENT_NAME}}占位符)渲染到config-runtime/<slug>/computer-use/config.json,CODEX_HOME指向该目录。每个 Agent 独立目录,多 Agent 互不冲突。 - exe 搜索顺序:
SKY_EXE_PATH环境变量 → 捆绑的bin/codex-computer-use.exe→ Codex 安装目录。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 55 lines · 928 tokens per session scan A 7f06bafbe3c0
codex-cua-mcp CLAUDE.md is an instructions file published in the GitHub repository RS-Nocsi/codex-cua-mcp (10 stars, last pushed 2mo ago), licensed MIT. It adds 928 tokens to every session, about $0.0046 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.