Codex As Mcp
@kky42
关于 Codex As Mcp
Enable Claude Code, Cursor and other AI tools to call Codex for task execution. Plus/Pro/Team subscribers can maximize GPT-5 usage without additional costs.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"codex": {
"type": "stdio",
"command": "uvx",
"args": [
"codex-as-mcp@latest",
"--yolo"
],
"env": {}
}
}
}工具
2Execute prompt using codex for general purpose. Args: prompt (str): The prompt for codex work_dir (str): The working directory, e.g. /Users/kevin/Projects/demo_project ctx (Context): MCP context for logging
Execute code review using codex with pre-defined review prompts for different scenarios. This tool provides specialized code review capabilities for various development scenarios, combining pre-defined review templates with custom instructions. Args: review_type (str): Type of code review to perform. Must be one of: - "files": Review specific files for code quality, bugs, and best practices Target: comma-separated file paths (e.g., "src/main.py,src/utils.py") Example: review_type="files", target="src/auth.py,src/db.py" - "staged": Review staged changes (git diff --cached) ready for commit Target: not needed (automatically detects staged changes) Example: review_type="staged" - "unstaged": Review unstaged changes (git diff) in working directory Target: not needed (automatically detects unstaged changes) Example: review_type="unstaged" - "changes": Review specific commit range or git changes Target: git commit range (e.g., "HEAD~3..HEAD", "main..feature-branch") Example: review_type="changes", target="HEAD~2..HEAD" - "pr": Review pull request changes comprehensively Target: pull request number or identifier Example: review_type="pr", target="123" - "general": General codebase review for architecture and quality Target: optional, can specify scope or leave empty for full codebase Example: review_type="general", target="src/" work_dir (str): The working directory path (e.g., "/Users/kevin/Projects/demo_project") target (str, optional): Target specification based on review_type: - For "files": comma-separated file paths - For "staged"/"unstaged": not needed (leave empty) - For "changes": git commit range (commit1..commit2) - For "pr": pull request number/identifier - For "general": optional scope (directory path or leave empty) prompt (str, optional): Additional custom instructions to append to the review prompt. Use this to specify particular aspects to focus on or additional context. Example: "Focus on security vulnerabilities and performance" ctx (Context, optional): MCP context for logging Returns: str: Detailed code review results from codex Examples: # Review specific files with security focus codex_review("files", "/path/to/project", "src/auth.py,src/api.py", "Focus on security vulnerabilities") # Review staged changes before commit codex_review("staged", "/path/to/project") # Review unstaged work-in-progress changes codex_review("unstaged", "/path/to/project", "", "Check for incomplete implementations") # Review recent commits codex_review("changes", "/path/to/project", "HEAD~3..HEAD", "Look for performance regressions") # Review pull request codex_review("pr", "/path/to/project", "456", "Focus on test coverage") # General codebase review codex_review("general", "/path/to/project", "src/", "Identify technical debt")
概览
What is Codex As Mcp?
Codex As Mcp is an MCP server that enables AI tools such as Claude Code and Cursor to call OpenAI Codex for task execution. It is designed for Plus, Pro, and Team subscribers who want to maximize GPT‑5 usage without incurring additional costs.
How to use Codex As Mcp?
First install the Codex CLI globally via npm and log in. Then add the server to your MCP configuration (.mcp.json) using uvx codex-as-mcp@latest. For writable (full‑capability) mode include the --yolo flag. Alternatively, use claude mcp add commands from the terminal.
Key features of Codex As Mcp
- Exposes two tools:
codex_executeandcodex_review - Safe Mode (read‑only) and Writable Mode (
--yolo) - Sequential execution prevents agent conflicts
- Works with Claude Code, Cursor, and other AI tools
- No extra costs for eligible Codex subscribers
Use cases of Codex As Mcp
- Run general‑purpose code tasks via an AI assistant
- Perform specialized code reviews with targeted prompts
- Integrate Codex’s capabilities into agentic workflows
FAQ from Codex As Mcp
Which AI tools can use this server?
Claude Code, Cursor, and any other tool that supports the Model Context Protocol (MCP) can connect to Codex As Mcp.
What is the difference between Safe Mode and Writable Mode?
Safe Mode (default) restricts operations to read‑only for safety. Writable Mode (activated with --yolo) allows full Codex capabilities, including file modifications.
Do I need a Codex subscription?
Yes, this server is intended for Codex Plus, Pro, or Team subscribers. Using it can help maximize GPT‑5 usage without additional costs.
What runtime dependencies are required?
You must have Node.js installed to run npm install -g @openai/codex. The server itself is launched via uvx, which requires a compatible Python environment.
Can I create custom use cases beyond the provided tools?
The README invites users to open an issue if they have other use‑case requirements, implying the two built‑in tools can be extended upon request.
开发工具 分类下的更多 MCP 服务器
Golf
golf-mcpProduction-Ready MCP Server Framework • Build, deploy & scale secure AI agent infrastructure • Includes Auth, Observability, Debugger, Telemetry & Runtime • Run real-world MCPs powering AI Agents
Stakpak Agent CLI
stakpakShip your code, on autopilot. An open source agent that lives on your machines 24/7 and keeps your apps running. 🦀
MCP Inspector
modelcontextprotocolVisual testing tool for MCP servers
Deepwiki MCP Server
regenrek📖 MCP server for fetch deepwiki.com and get latest knowledge in Cursor and other Code Editors
Code Index MCP
johnhuang316A Model Context Protocol (MCP) server that helps large language models index, search, and analyze code repositories with minimal setup
评论