##markdown
Windows-compatible fork of kky42/codex-as-mcp. Fixes subprocess hanging and PowerShell compatibility issues.
Check if Python is installed:
python --version
# or
py --versionIf not installed:
- Download Python from python.org
- During installation, CHECK "Add Python to PATH" ✅
- Restart your terminal after installation
Verify Python is in PATH:
where python
# Should show: C:\Users\[YourName]\AppData\Local\Programs\Python\Python3X\python.exenpm install -g @openai/codex
codex logingit clone https://github.com/takaok5/codex-as-mcp-windows.git
cd codex-as-mcp-windows
pip install -e .For Windows users - add to .claude.json:
Safe Mode (Read-only):
{
"mcpServers": {
"codex": {
"type": "stdio",
"command": "python",
"args": [
"C:\\path\\to\\codex-as-mcp-windows\\src\\codex_as_mcp\\server.py"
]
}
}
}Skip-Git Mode (Workspace writes, recommended):
{
"mcpServers": {
"codex": {
"type": "stdio",
"command": "python",
"args": [
"C:\\path\\to\\codex-as-mcp-windows\\src\\codex_as_mcp\\server.py",
"--skip-git"
]
}
}
}Writable Mode (Full auto, dangerous):
{
"mcpServers": {
"codex": {
"type": "stdio",
"command": "python",
"args": [
"C:\\path\\to\\codex-as-mcp-windows\\src\\codex_as_mcp\\server.py",
"--yolo"
]
}
}
}Note: If python command doesn't work, try using py instead in the command field.
The MCP server exposes two tools:
codex_execute(prompt, work_dir)- General purpose codex executioncodex_review(review_type, work_dir, target?, prompt?)- Specialized code review
- ✅ Windows PowerShell/CMD compatibility
- ✅ Non-interactive execution (no hanging)
- ✅ UTF-8 encoding issues resolved
- ✅ New
--skip-gitmode for non-git directories
- Safe Mode: Default read-only operations protect your environment
- Skip-Git Mode: NEW - Write to workspace without git checks
- Writable Mode: Use
--yoloflag when you need full codex capabilities - Sequential Execution: Prevents conflicts from parallel agent operations
- Uses direct Python execution instead of uvx
- Passes prompts via stdin with
--jsonflag for non-interactive mode - Cleaned encoding for Windows compatibility
- Added intermediate
--skip-gitmode
- Windows 10/11
- Python 3.11+ (must be in PATH)
- Node.js 18+
- Codex CLI installed and authenticated
Python not found:
- Make sure Python is in PATH:
where python - Try using
pyinstead ofpythonin the config - Reinstall Python with "Add to PATH" checked
Codex not responding:
- Verify codex works:
codex --version - Check authentication:
codex login