MCP connection is not re-established after a local server restart
Summary
Codex loses its MCP connection when a local MCP server restarts, even when the server comes back on the same endpoint. The Codex session remains open but the MCP tools stay unavailable until the Codex client/session is restarted.
This is particularly disruptive for local development servers such as Persephone: editing source code causes Vite and the application (including its MCP server) to restart.
Reproduction
- Configure a local MCP server in Codex.
- Start Codex and verify that the server's tools are available.
- Restart the local application/server while keeping the Codex session open.
- Wait for the MCP server to come back at the same endpoint.
- Try to use one of its tools.
Expected behavior
Codex should automatically re-establish the MCP session when the configured server becomes available again, or provide an explicit reconnect action such as:
/mcp reconnect <server-name>
Actual behavior
The original MCP connection remains dead. The server is running again, but the tools are not available in the existing Codex session. Restarting Codex is required.
Environment
- OS: Windows
- Codex CLI: 0.148.0
- MCP server: local Persephone development server
- Transport: local MCP transport (please classify as stdio or Streamable HTTP if required)
- Server lifecycle: Vite/application restart stops and starts the MCP server again
Additional context
The documented /mcp command can inspect active MCP servers, but there does not appear to be a reconnect command. A reconnect or automatic retry would make local MCP-based development workflows much more reliable.
2 Comments
For comparison, I have tested Claude Code with the same style of local MCP development workflow. Claude Code now reconnects to the MCP server after the application/server restarts, or otherwise keeps the MCP integration usable without restarting the chat. Codex should provide equivalent automatic recovery or an explicit reconnect command, since persistent MCP-based development is a core developer workflow.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action