codex-mcp-bridge
Click on "Deploy 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-bridgeAsk Codex: why does my app return 404?"
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 Persistent Bridge
Local Codex App Server + persistent bridge experiment.
Purpose
This project explores a local integration path:
AI client / MCP client
│ MCP stdio
▼
core/codex_mcp_bridge.py
│ WebSocket
▼
Codex App Server
│
▼
Local project workspaceThe MCP bridge exposes ask_codex(prompt: str). It forwards requests to a local Codex App Server and returns the final text response.
The project also contains a long-running persistent service:
tests/persistent_test.py
│ TCP JSON Lines :4600
▼
core/persistent_bridge.py
│ WebSocket :4500
▼
Codex App ServerThe persistent service keeps one CodexSession alive between requests. The first request creates a thread; later requests reuse the WebSocket connection and thread_id.
Related MCP server: pokeclaw
Repository layout
codex-mcp-persistent-bridge/
├── core/
│ ├── codex_mcp_bridge.py
│ └── persistent_bridge.py
├── tests/
│ └── persistent_test.py
├── docs/
│ └── Codex_MCP_Bridge_Development_Log.md
├── README.md
├── requirements.txt
├── start_persistent_bridge.ps1
└── .gitignoreRuntime logs are written under logs/ when the startup script uses redirected output. The directory and log files are excluded from Git.
Installation
Open a terminal at the project root and create an environment if needed:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txtThe startup script currently uses the Python interpreter from the verified local setup. When moving the project to another machine, review that interpreter setting before starting the service.
Startup
From the project root:
.\start_persistent_bridge.ps1The script:
Starts
codex app-server --listen ws://127.0.0.1:4500when the App Server is not already listening.Waits for TCP port
4500.Starts
core/persistent_bridge.py.Waits for TCP port
4600.Prints the process IDs and keeps both child processes alive.
Press Ctrl+C in the startup window to stop the child processes started by the script.
Persistent session test
With the service running, open another terminal at the project root:
python .\tests\persistent_test.pyThe test sends three requests over one TCP connection. Expected diagnostic behavior is:
CALL 0
current thread_id = None
created new thread_id = <id>
CALL 1
current thread_id = <id>
CALL 2
current thread_id = <id>The exact ID is generated by Codex. The important result is that the ID remains the same for all three calls.
MCP stdio entry point
core/codex_mcp_bridge.py remains the standard MCP entry point and exposes ask_codex(prompt: str). A compatible MCP host should launch it with its configured Python interpreter and a project-root-relative configuration, for example:
{
"mcpServers": {
"codex-mcp-bridge": {
"command": "<python-interpreter>",
"args": ["<project-root>/core/codex_mcp_bridge.py"],
"env": {
"CODEX_APP_SERVER_URL": "ws://127.0.0.1:4500",
"CODEX_MCP_WORKDIR": "<project-root>"
}
}
}
}The stdio entry point and the long-running TCP service are separate launch modes. The persistent service exists to keep the Session alive after a short-lived client exits; it does not change the MCP tool interface or the WebSocket protocol.
Known limitations
The project is a local Codex App Server and MCP bridge experiment, not a hosted service.
ChatGPT Desktop has not been verified to provide a direct local MCP connection for this project.
ChatGPT Web cannot automatically access a local process just because the process listens on
127.0.0.1.The persistent service currently uses a local TCP JSON Lines interface; it is not itself a replacement for the standard MCP stdio entry point.
The current setup assumes the local Codex CLI, Python dependencies, permissions and App Server are available in the host environment.
The bridge uses local execution settings that should be reviewed before any broader or write-enabled deployment.
Development record
The engineering history, failed attempts and debugging conclusions are recorded in docs/Codex_MCP_Bridge_Development_Log.md.
This server cannot be deployed
Maintenance
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Generate contextual prompts and reusable agent skills, evaluate prompts with the 16-dimension Prompt Score, and manage saved work in PromptDrive. Twelve MCP tools also provide authorized access to private Memory for source-grounded answers. Connect over Streamable HTTP using OAuth 2.1 and PKCE. Generation consumes account quota and automatically saves successful results; Memory access follows account permissions and plan limits.
A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log
Related MCP Servers
- AlicenseAqualityBmaintenanceA stateless MCP server that wraps the headless Gemini CLI, providing tools to send prompts to Google's Gemini models and receive text responses. It supports both simple prompts and prompts with contextual information.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to spawn and control Codex CLI and Claude Code sessions on the host machine, with session management and filesystem access.4MIT
- AlicenseAqualityBmaintenanceBridges OpenAI Codex CLI to any MCP client, allowing headless Codex sessions via tools like codex and codex-reply.28 npm1MIT
- AlicenseAqualityBmaintenanceMCP server for Claude Desktop to send prompts into a live Codex thread through a shared Codex app-server, preserving thread history, working directory, and model.9552 npm17MIT