Upgrade `rmcp` dependency to 1.4.0 to fix MCP HTTP/Cloudflare connection issues
Description
The Codex CLI and codex_apps currently depend on rmcp = "0.15.0".
As reported in multiple issues (e.g., #16485, #12859, #13852), this older version of the RMCP client lacks support for injecting custom HTTP headers (such as User-Agent or specific Auth headers) into Streamable HTTP and WebSocket handshakes. This causes MCP connections to fail behind Cloudflare, strict corporate proxies, or services like Supabase that require specific headers or constant re-authentication.
Proposed Solution
The rmcp crate has seen significant development and the 1.4.0 release introduces critical fixes for these exact problems:
StreamableHttpClienttrait methods (post_message,delete_session,get_stream) now accept aheadersparameter.- Extensive stability improvements to
PaginatedRequestParamsand theOAuthStatemachine.
We strongly recommend upgrading the rmcp dependency across the workspace to ^1.4.0.
Migration Effort
We have already successfully performed this migration in our downstream fork. Upgrading requires adapting to the new #[non_exhaustive] struct builders in rmcp::model::* (such as InitializeRequestParams, CallToolResult, ServerCapabilities, Implementation) and updating the StreamableHttpClient trait signatures in codex-rmcp-client.
If the maintainers are open to this upgrade, we would be happy to submit a Pull Request with the complete rmcp 1.4.0 migration to help close the aforementioned connection and auth issues.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I believe I have just ran into this issue as well while using a local MiTM proxy on my machine. Notes:
Codex CLI fails in environments where HTTPS traffic is intercepted (e.g., local MITM proxy with a trusted root CA). Even when the custom CA is provided via:
Codex still fails to complete critical HTTPS flows:
codex_apps) → fails during handshake tohttps://chatgpt.com/backend-api/wham/appshttps://auth.openai.com/oauth/tokenhttps://auth.openai.com/api/accounts/deviceauth/usercodeKey observations
curlcf-mitigated: challenge) when traffic is proxied/intercepted``
``error sending request for url (...)
instead of handling or surfacing the challenge
CODEX_CA_CERTIFICATEdoes not resolve the issueLikely root cause
Cloudflare challenge incompatibility
Will the new version allow codex to pass scopes in the registration part of DCR flow?
@etraut-openai This can be closed as the version on
mainis 1.8.0 now.https://github.com/openai/codex/blob/129ea2aaf5fb426d8ba683ee53f290742f41dd31/codex-rs/Cargo.toml#L376