
MCP 服务器连接 Claude/Cursor 与 Codex CLI。通过 @ 文件引用、多回合对话、沙盒编辑和结构化修改模式实现代码分析。
概览
MCP 服务器连接 Claude/Cursor 与 Codex CLI。通过 @ 文件引用、多回合对话、沙盒编辑和结构化修改模式实现代码分析。 - — 带@src/、@package.json语法的引用文件 - — 带工作空间隔离的对话连续性 - — 使用codex resume进行上下文保存(CLI v0.36.0+) - — 通过localProvider与Ollama或LM Studio运行 - — 带搜索的研究功能:true—— 安全自动化,带有显式沙箱和批准策略 - — 结构化的旧/新补丁输出用于重构 - — SCAMPER、设计思维、横向思维框架 - CLI 版本、功能和会话监控 - Windows 、macOS、Linux 完全支持 Node.js 18+,Codex CLI 已安装并认证。 macOS:~/库/应用支持/Claude/claude_desktop_config.json |Windows:%APPDATA%\Claude\claude_desktop_config.json image-gen 驱动 Codex 内置的image_gen工具,因此只需你的 ChatGPT 登录,无需OPENAI_API_KEY。
概述(AI 翻译)
连接 Claude/Cursor 与 Codex CLI 的 MCP 服务器。通过 @ 文件引用、多回合对话、沙盒编辑和结构化变更模式实现代码分析。
特色
- 文件分析 — 具有
@src/、@package.json语法的引用文件 - 多轮流会话 — 对话连续性与工作空间隔离
- 原生恢复 — 使用
codex resume进行上下文保存(CLI v0.36.0+) - 本地OSS模型 — 通过Ollama或LM Studio通过[[T4]运行]
- 网页搜索 — 具备
search: true的研究功能。 - 沙盒模式 — 安全自动化,带有明确的沙盒和审批策略
- Change Mode — 结构化的OLD/NEW补丁输出用于重构
- 头脑风暴 — SCAMPER、设计思维、横向思维框架
- 健康诊断 — CLI 版本、功能和会话监控
- 跨平台 — Windows、macOS、Linux 均完全支持
快速启动
前置条件: Node.js 18+,Codex CLI已安装并认证。
配置
配置位置: macOS: ~/Library/Application Support/Claude/claude_desktop_config.json |Windows: %APPDATA%\Claude\claude_desktop_config.json
使用示例
工具
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Codex MCP Server
MCP server connecting Claude/Cursor to Codex CLI. Enables code analysis via @ file references, multi-turn conversations, sandboxed edits, and structured change mode.
Features
- File Analysis — Reference files with
@src/,@package.jsonsyntax - Multi-Turn Sessions — Conversation continuity with workspace isolation
- Native Resume — Uses
codex resumefor context preservation (CLI v0.36.0+) - Local OSS Models — Run with Ollama or LM Studio via
localProvider - Web Search — Research capabilities with
search: true - Sandbox Mode — Safe automation with explicit sandbox and approval policies
- Change Mode — Structured OLD/NEW patch output for refactoring
- Brainstorming — SCAMPER, design-thinking, lateral thinking frameworks
- Health Diagnostics — CLI version, features, and session monitoring
- Cross-Platform — Windows, macOS, Linux fully supported
Quick Start
claude mcp add codex-cli -- npx -y @trishchuk/codex-mcp-tool
Prerequisites: Node.js 18+, Codex CLI installed and authenticated.
Configuration
{
"mcpServers": {
"codex-cli": {
"command": "npx",
"args": ["-y", "@trishchuk/codex-mcp-tool"]
}
}
}
Config locations: macOS: ~/Library/Application Support/Claude/claude_desktop_config.json | Windows: %APPDATA%\Claude\claude_desktop_config.json
Usage Examples
// File analysis
'explain the architecture of @src/';
'analyze @package.json and list dependencies';
// With specific model
'use codex with model gpt-5.6-sol to analyze @algorithm.py';
// Multi-turn conversations (v1.4.0+)
'ask codex sessionId:"my-project" prompt:"explain @src/"';
'ask codex sessionId:"my-project" prompt:"now add error handling"';
// Brainstorming
'brainstorm ways to optimize CI/CD using SCAMPER method';
// Sandbox mode
'use codex sandbox:true to create and run a Python script';
// Web search
'ask codex search:true prompt:"latest TypeScript 5.7 features"';
// Local OSS model (Ollama)
'ask codex localProvider:"ollama" model:"qwen3:8b" prompt:"explain @src/"';
Tools
| Tool | Description |
|---|
安装
npx -y @trishchuk/codex-mcp-tool配置
{
"mcpServers": {
"codex-cli": {
"command": "npx",
"args": ["-y", "@trishchuk/codex-mcp-tool"]
}
}
}