Understand Codex MCP Server session lifecycle
mainSessions in the Codex MCP Server follow a specific lifecycle:
- Creation: Sessions are created automatically or explicitly via a provided
sessionId. - Activity: Every interaction updates the
lastAccessedAttimestamp. - Persistence: Sessions remain active for 24 hours of inactivity.
- Cleanup: Expired sessions are removed automatically.
- Limits: The server supports a maximum of 100 concurrent sessions.
The server uses Codex CLI v0.50+ native resume functionality by extracting conversation IDs from output and executing codex exec resume <conversation-id> to ensure seamless continuity.