codex-mcp-server
Provides tools to interact with OpenAI Codex CLI, allowing execution of Codex commands, code review, skill management, job polling, and health checks.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codex-mcp-serverlist available Codex skills"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
codex-mcp-server
MCP server(stdio)封裝 OpenAI Codex CLI,讓 pi / Codex 可將 8 個 Codex 工具作為 named tools 呼叫。
來源: C:\Users\hsi67063\.codex\mcp\codex-mcp-server
打包目的: 可攜至其他電腦使用。
目錄結構
codex-mcp-server/
├── index.js # MCP server 本體(已標記需修改路徑)
├── package.json # 依賴:@modelcontextprotocol/sdk + zod
├── README.md # 本檔
├── install.bat # ★ 新電腦安裝腳本(全自動)
└── setup-git.bat # ★ Git 初始化 + Push 腳本快速安裝(新電腦)
方式一:一鍵安裝(建議)
cd C:\path\to\codex-mcp-server
install.bat腳本會自動:
執行
npm install偵測 Codex CLI 路徑,寫入
index.js的CODEX_BIN在
pi settings.json中注册mcpServers.codex驗證 server 可載入
方式二:手動安裝
# 1. 安裝依賴
cd codex-mcp-server
npm install
# 2. 編輯 index.js,更新 CODEX_BIN 為正確路徑
# 3. 在 pi settings.json 新增:
{
"mcpServers": {
"codex": {
"command": "node",
"args": ["C:/path/to/codex-mcp-server/index.js"]
}
}
}
# 4. 重啟 pi已注册的工具(8 個)
工具 | 模式 | 說明 |
| background | 非互動執行 Codex,即時返回 job_id |
| sync (5min) | 程式碼審查 |
| sync | 列出 Codex skills |
| background | 執行指定 skill |
| sync (5min) |
|
| sync | 查詢背景工作狀態 |
| sync | 列出所有工作 |
| sync | 終止執行中的工作 |
複製到新電腦前需確認
項目 | 現有設定 | 新電腦是否需修改 |
|
| 是,install.bat 會自動更新 |
|
| 視需求 |
| 絕對路徑 | 是,install.bat 會自動更新 |
Git Push
.\setup-git.bat [remote_url]範例:
.\setup-git.bat "https://github.com/your_user/codex-mcp-server.git"若未提供 remote_url,脚本只會初始化 repo 並顯示後續指令。
前置需求
Node.js 18+
Codex CLI 已安裝並在 PATH
pi 或 Codex 已設定
settings.json
疑難排解
Q: npm install 失敗
確認網路暢通
嘗試:
npm install --legacy-peer-deps
Q: 找不到 Codex CLI
手動確認路徑後編輯
index.js中的CODEX_BINCodex CLI 常見位置:
C:\Users\<user>\.codex\tools\npm-global\codex.cmdC:\Users\<user>\AppData\Local\OpenAI\Codex\bin\codex.exe
Q: pi 重啟後看不到 codex_ 工具*
確認
settings.json中mcpServers.codex區塊已正確寫入檢查 pi 日誌是否有錯誤輸出
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/Pigowenhsiao/codex-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server