Skip to main content
Glama

🤖 Codex MCP Server

TypeScript MCP Standard License

连接您的 AI 助手与本地强大的 Codex 引擎

这是一个符合 Model Context Protocol (MCP) 标准的服务器,旨在充当桥梁,让 Claude CodeCursorTraeGemini CLI 等现代 AI 客户端能够安全地调用本地环境中的 Codex Agent 进行代码审查与修复。


🌟 核心价值

通过本项目,您的 AI 助手将获得“第二大脑”,实现:

  • 🔍 全项目深度审查:不再局限于单个文件,而是理解整个代码库的上下文。

  • 🛠️ 自动化智能重构:基于项目架构进行安全的、系统级的代码修改。

  • 🐛 上下文感知修复:精准定位 Bug 根源,而非仅修复表面错误。


Related MCP server: LSP-MCP

💻 客户端支持

完美适配支持 MCP 协议的主流 AI 编程工具:

客户端

支持情况

备注

💎 Gemini CLI

✅ 完美支持

需配置 .gemini/settings.json

🟣 Claude Desktop

✅ 完美支持

支持 Claude 4.5 Sonnet / Opus

🖱️ Cursor

✅ 完美支持

在 Features > MCP 中配置

🚀 Trae

✅ 完美支持

兼容标准 MCP 协议

🆚 VS Code

✅ 支持

需配合 MCP 扩展使用


✨ 功能特性

  • 🛡️ 企业级安全 (Secure Local Execution) 封装本地 codex 二进制文件,严格遵循您系统的权限和沙盒设置,确保代码安全。

  • 🧠 记忆增强 (Continuous Context) 通过智能的 session_id 管理,维护多轮对话的历史上下文,支持迭代式的代码改进。

  • 📂 全局视野 (Project-Level Awareness) 提供专用工具 review_project,轻松处理跨文件夹、跨模块的复杂架构变更。

  • ⚡ 极速响应 (High Performance) 专为 Agent 通信优化的低延迟架构,让审查过程行云流水。


🚀 快速开始

1. 环境准备

  • Node.js: v16 或更高版本

  • Codex CLI: 确保你已安装 codex 并启用过codex CLI完成了认证。

2. 安装与构建

# 1. 克隆仓库
git clone <your-repo-url>
cd Coagent

# 2. 安装依赖
npm install

# 3. 编译项目
npm run build

💡 提示: 编译后的产物将位于 dist/ 目录下。


⚙️ 配置指南

为了获得最佳体验,我们强烈建议将此 MCP 服务器配置为项目级别

标准配置 (JSON)

无论您使用哪种客户端,请参考以下配置结构:

{
  "mcpServers": {
    "codex-reviewer": {
      "command": "node",
      "args": ["<您的项目绝对路径>/dist/index.js"],
      "description": "Codex Project Reviewer"
    }
  }
}

⚠️ 注意: 请将 <您的项目绝对路径> 替换为本仓库实际的完整路径(例如:E:\Project\Codex_Reviewer)。Windows 路径请注意转义\\反斜杠。

常见客户端配置文件路径

  • Gemini CLI: [项目根目录]/.gemini/settings.json

  • VS Code: [项目根目录]/.vscode/mcp.json

  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json (MacOS)

  • 其余客户端: 自行查找文档查看相应的项目级mcp和rules的配置规范


🤖 最佳实践:自动化审查流

想让 AI 自动帮您检查代码? 将以下规则写入您的项目规则文件(如 .cursorrules, .gemini/GEMINI.md, 或 Claude Projects Instructions),即可实现全自动化的代码质量守护

📋 推荐规则模板

# Code Review Workflow

## Mandatory Review Process
After modifying code (using `write_file`, `replace`, `edit_file`, etc.), you **MUST** immediately call the Codex MCP tool to verify the work.

1.  **Complex Changes**: Use `review_project` for multi-file changes or system refactoring.
2.  **Simple Edits**: Use `review_file` for single-file syntax/logic checks.

## Protocol
- **Context**: You MUST provide a detailed `change_description` explaining *what* changed and *why*.
- **Memory**: You MUST generate and maintain a consistent `session_id` for the duration of a task.

🛠️ 工具列表

您可以在对话中直接调用以下工具:

工具名称

图标

类型

用途

review_project

🏢

核心

系统级审查 - 扫描全项目,处理复杂逻辑与架构变更。

review_file

📄

轻量

文件级审查 - 快速检查单文件语法、风格与逻辑错误。

review_code_changes

💬

通用

通用审查 - 发送任意代码片段进行分析。

continue_review

🔄

会话

多轮对话 - 针对之前的审查结果进行追问或微调。


📄 许可证

本项目基于 MIT License 开源。


Available Tools

4 tools
continue_reviewB

【会话工具】在现有会话中继续讨论。用于追问 Codex 更多细节或请求进一步的修改建议。

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYes要发送给 Codex 的消息
session_idYes必需的会话 ID,用于继续之前的对话

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions the tool continues discussions with Codex but doesn't disclose behavioral traits like whether this requires specific permissions, how it handles session state, response format, or any rate limits. The description adds minimal behavioral context beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with two concise sentences. The first sentence states the core purpose, and the second provides usage context, with zero wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that interacts with an AI system (Codex). It lacks details on response behavior, error handling, or session management, which are critical for contextual understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (message and session_id). The description doesn't add meaning beyond what the schema provides, such as examples of message content or session_id format. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '在现有会话中继续讨论' (continue discussion in an existing session) with specific verbs and resources. It distinguishes from siblings by focusing on continuing existing sessions rather than initiating new reviews, though it doesn't explicitly name the sibling tools for comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage context: '用于追问 Codex 更多细节或请求进一步的修改建议' (used to ask Codex for more details or request further modification suggestions). However, it doesn't explicitly state when to use this tool versus the sibling tools (review_code_changes, review_file, review_project) or provide clear exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

review_code_changesB

【通用工具】将代码或文本发送给 Codex 代理进行审查、修改和验证。Codex 将分析代码,执行必要的编辑或命令,并返回修复摘要。每次 Gemini 修改代码后,应该调用此工具获取 Codex 的审查意见。

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes需要审查的代码或文本内容(Gemini 修改后的代码)
session_idNo用于维护上下文连续性的会话 ID。**重要提示**:Agent 应为每个独立的用户任务生成一个唯一的 Session ID,并在该任务的所有相关工具调用中复用它。这允许 Codex 记住之前的变更和对话历史。
contextNo可选的上下文信息,例如文件路径、修改原因等

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that Codex will '分析代码,执行必要的编辑或命令,并返回修复摘要' (analyze code, perform necessary edits or commands, and return a fix summary), which implies mutation and output format. However, it lacks details on permissions, rate limits, error handling, or what '修复摘要' (fix summary) entails. For a tool with potential edits and no annotation coverage, this is insufficient behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences that are front-loaded: the first states the core purpose, and the second provides usage timing. There's minimal waste, though the second sentence could be more concise. It efficiently conveys key information without redundancy, earning a high score for structure and brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (involves Codex agent analysis and potential edits), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral traits like mutation effects, error cases, or output details. While it mentions the tool's role in a workflow, it fails to provide sufficient context for safe and effective use, especially for a tool with siblings and no structured safety hints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters (content, session_id, context) with good descriptions. The description adds no additional parameter semantics beyond what's in the schema—it doesn't explain parameter interactions, formats, or examples. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '将代码或文本发送给 Codex 代理进行审查、修改和验证' (send code or text to Codex agent for review, modification, and verification). It specifies the verb (send/review) and resource (code/text), but doesn't explicitly differentiate from sibling tools like 'review_file' or 'review_project', which likely have overlapping functions. The description is specific about what happens (Codex analyzes, edits, returns summary) but lacks sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance: '每次 Gemini 修改代码后,应该调用此工具获取 Codex 的审查意见' (after Gemini modifies code, this tool should be called to get Codex's review). This suggests it's for post-modification review, but doesn't explicitly state when to use it versus alternatives like 'continue_review' or 'review_file'. There's no mention of prerequisites, exclusions, or clear context for choosing among siblings, leaving usage somewhat vague.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

review_fileA

【次要工具】审查单个文件的内容。适用于改动仅在单个或两个文件内的情况。Codex 将读取文件并根据变更描述提供审查建议。

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYes要审查的文件路径(相对或绝对路径)
change_descriptionYesAgent 具体修改了代码的什么内容(详细说明修改了逻辑以及目的)
session_idNo用于维护上下文连续性的会话 ID。**重要提示**:Agent 应为每个独立的用户任务生成一个唯一的 Session ID,并在该任务的所有相关工具调用中复用它。这允许 Codex 记住之前的变更和对话历史。

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions that 'Codex 将读取文件并根据变更描述提供审查建议' (Codex will read the file and provide review suggestions based on the change description), which gives some behavioral insight (e.g., it involves reading and AI analysis). However, it lacks details on permissions, rate limits, output format, or error handling. For a tool with no annotations, this is a significant gap in behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured in two sentences. The first sentence states the purpose and usage context, and the second explains the behavioral process. Every sentence adds value without redundancy, making it easy to parse and front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides basic purpose and usage but lacks details on behavioral traits, output format, or error handling. It's adequate for a simple review tool but incomplete for guiding an AI agent fully, especially without annotations to cover safety or operational aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters (file_path, change_description, session_id) with clear descriptions. The description doesn't add any parameter-specific semantics beyond what's in the schema, such as examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '审查单个文件的内容' (review content of a single file) and '提供审查建议' (provide review suggestions). It specifies the verb (review), resource (file content), and scope (single file). However, it doesn't explicitly differentiate from sibling tools like 'review_code_changes' or 'review_project' beyond mentioning it's for '改动仅在单个或两个文件内的情况' (changes limited to one or two files).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: '适用于改动仅在单个或两个文件内的情况' (suitable when changes are limited to one or two files). It implies alternatives by mentioning this scope, but doesn't explicitly name sibling tools or state when not to use it. The guidance is helpful but could be more explicit about comparisons.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

review_projectB

【核心工具】审查整个项目的代码。适用于跨文件夹修改、系统级重构或需要全面上下文的情况。Codex 将分析项目结构和代码,根据提供的变更描述进行审查和修复。

ParametersJSON Schema
NameRequiredDescriptionDefault
project_pathYes当前项目的根目录路径(绝对路径)
change_descriptionYesAgent 具体修改了代码的什么内容(详细说明修改了哪些文件、逻辑以及目的)
session_idNo用于维护上下文连续性的会话 ID。**重要提示**:Agent 应为每个独立的用户任务生成一个唯一的 Session ID,并在该任务的所有相关工具调用中复用它。这允许 Codex 记住之前的变更和对话历史。

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions 'Codex 将分析项目结构和代码,根据提供的变更描述进行审查和修复' (Codex will analyze project structure and code, review and fix based on the provided change description), which implies mutation behavior but lacks details on permissions, side effects, rate limits, or what '修复' (fix) entails. For a tool with potential code modifications, this is insufficient behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with three sentences that are front-loaded with core functionality. Each sentence adds value: the first states the purpose, the second provides usage context, and the third explains the behavioral process. There's minimal waste, though it could be slightly more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (code review/fix tool with no annotations and no output schema), the description is moderately complete. It covers purpose and usage well but lacks details on behavioral traits like safety, output format, or error handling. Without annotations or output schema, more context on what '修复' (fix) means and the result format would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters. The description adds no additional parameter semantics beyond what's in the schema. The baseline is 3 since the schema provides comprehensive parameter details, and the description doesn't compensate or add value here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '审查整个项目的代码' (review the entire project's code) with specific verbs like '分析项目结构和代码' (analyze project structure and code) and '进行审查和修复' (perform review and fix). It distinguishes from siblings by mentioning '跨文件夹修改、系统级重构或需要全面上下文的情况' (cross-folder modifications, system-level refactoring, or situations requiring comprehensive context), though it doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: '适用于跨文件夹修改、系统级重构或需要全面上下文的情况' (suitable for cross-folder modifications, system-level refactoring, or situations requiring comprehensive context). It implies usage scenarios but doesn't explicitly state when not to use it or name specific alternatives like 'review_file' for single-file reviews.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.0
    • First observedcontinue_review
    • First observedreview_code_changes
    • First observedreview_file
    • First observedreview_project

TDQS

B3.3/5.0
Disambiguation2/5

The tools have significant overlap in purpose, as all four are focused on code review with Codex. While there are distinctions between reviewing a file, project, or code changes, the boundaries are unclear—for example, 'review_code_changes' and 'review_file' could easily be confused for similar tasks, and the descriptions do not fully resolve this ambiguity.

Naming Consistency5/5

The tool names follow a highly consistent verb_noun pattern throughout (e.g., continue_review, review_code_changes, review_file, review_project). All use snake_case and start with a verb related to reviewing, making them predictable and easy to parse.

Tool Count4/5

With 4 tools, the count is reasonable for a code review server, though it feels slightly thin. Each tool appears to serve a distinct niche (e.g., file vs. project review), but the set might benefit from additional operations like summarization or feedback integration to enhance completeness.

Completeness3/5

The server covers core review scenarios (file, project, code changes, and session continuation), but there are notable gaps. For example, it lacks tools for managing review sessions (e.g., starting or ending reviews), handling non-code artifacts, or providing post-review actions like approval or rejection, which could limit agent workflows in broader contexts.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    F
    maintenance
    Connects AI assistants like Claude to the Codex CLI for code analysis, editing, and execution. Supports file references with @ syntax, sandboxed code execution with approval workflows, and structured code changes for automated refactoring and documentation.
    8
    198
    179
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Bridges the Model Context Protocol with Language Server Protocol to provide AI agents with persistent access to code intelligence features including navigation, diagnostics, refactoring, and completion across 7+ programming languages.
    2,757
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    A project-local MCP bridge that allows Codex Desktop to plan tasks and OpenCode to execute them within the current project directory, with session reuse and native OpenCode background subagents.
    4
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SpongeBaby-124/CodexReviewerMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server