Open
Conversation
Switches Codex from SSE via mcp-remote to Streamable HTTP using Codex's native --transport http support, enabling `codex mcp login` OAuth flow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
--url for streamable HTTP servers, --bearer-token-env-var for auth. Codex doesn't have --transport or --header flags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
We support Codex? (@daniloc is probably the one we need here) |
Member
|
@gewenyu99 this is for |
Covers both the CLI and the desktop app since they share config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Codex CLI was configured to use SSE transport via
mcp-remote, which doesn't supportcodex mcp loginfor native OAuth authentication. Then it was trying to login when starting codex, and that was timing out because there was a 10 second timeout. If we rather usecodex mcp add posthog --url https://mcp.posthog.com/mcpit triggers oauth at that point, which is nice because then it's already set up when I start codex. Alternatively, we could add it to the~/.codex/config.tomlfile, but then the user would have to runcodex mcp login posthogwhich isn't really intuitive.https://www.loom.com/share/1311023cfcaf466eabad4029e20191d9
Changes
getDefaultServerConfig(apiKey, 'sse')(mcp-remote wrapper) tobuildMCPUrl('streamable-http')with nativecodex mcp add --transport httpcodex mcp login posthoghandles auth nativelyHow did you test this code
npx jest --testPathPattern='codex.test'— 9/9 passing)🤖 Generated with Claude Code