Track Codex and ChatGPT step-up: they need the challenge in the tool result, not the spec's 403
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust, typescript
- Domain
- api, authentication
Research direction
Start with src/clients.ts and the linked Codex issue openai/codex#20518; the issue also points to the Codex client code and regression test in rmcp-client. First check whether chatgpt.com and the latest Codex now step up from a 403 challenge, using the linked production issue and ?scopeChallenge=http. Done means both clients handle the flow and the corresponding entries and challenge behavior can be removed.
Written by the indexing model from the issue text.
Description
Codex and ChatGPT don't step up on the MCP spec's 403 insufficient_scope. src/clients.ts works around it (#275): both get the challenge in the tool result's _meta["mcp/www_authenticate"], and every other client gets the spec's 403. This issue tracks the root cause, so we can drop those entries once each client follows the step-up authorization flow.
Root cause: Codex
Codex is open source, and its MCP client is codex-rs/rmcp-client. Links are pinned to rust-v0.163.0, the latest release.
- The 403 is parsed but nothing acts on it. The adapter turns a 403 with
error="insufficient_scope"intoStreamableHttpError::InsufficientScope(http_client_adapter.rs#L298-L307).RmcpClient::call_toolonly convertsAuthRequired(a 401) into a result carryingmcp/www_authenticate(rmcp_client.rs#L909-L930).InsufficientScopefalls through as a transport error: "Transport send error … Insufficient scope". - The behaviour is pinned by a test.
streamable_http_403_scope_challenge_returns_insufficient_scopeasserts that error (streamable_http_recovery.rs#L348). - Re-authorizing drops existing scopes. When Codex does re-authorize from a tool-result challenge, it requests exactly the challenged scopes and ignores the ones on the stored token. A new grant replaces the old one, so naming only the missing scope would lose the rest. #275 works around this by having every challenge name the scopes the connection already holds plus the missing one.
rmcpalready has the missing piece.AuthorizationManager::request_scope_upgradecomputes the union of current and challenged scopes, but Codex doesn't call it.
Upstream: openai/codex#20518 (open). The Oct 18 status comment lays out the same gaps against main.
ChatGPT
ChatGPT is closed source. The Apps SDK auth docs say tool-level re-auth needs two things: the tool declares securitySchemes, and the error result carries _meta["mcp/www_authenticate"] with error and error_description. Both come from draft SEPs: SEP-1488 is open, and SEP-1489 was closed in favour of the HTTP 403. The reference documents _meta["securitySchemes"] as a mirror of the top-level field, so we use _meta, which stays within the spec.
- Codex and the ChatGPT desktop app: step up from the tool-result challenge.
- chatgpt.com: doesn't step up, even with both halves in place (#277 on production, Oct 19). The tool call just reports that it returned an empty list.
Observed
- Codex 0.157 and 0.162, CLI and desktop: the 403 failed the tool call with the transport error above. With the challenge in the tool result, Codex reconnected and the retry worked, on staging (Oct 9) and on production (Oct 19). Production grants went from read-only (194 scopes) to 195, adding
workers-scripts.writeandworkers-kv-storage.writein two separate step-ups. - Claude, Claude Code and claude.ai: step up on the 403 with the union of scopes. Claude Code doesn't open the browser mid-session and asks you to run
/mcpinstead (anthropics/claude-code#68720, anthropics/claude-code#92518).
To close
- chatgpt.com steps up. #277 (
_meta.securitySchemes) wasn't enough on production; find out what else chatgpt.com needs, then land #277. - Codex ships 403 step-up (openai/codex#20518). Test the latest Codex against
?scopeChallenge=http, then remove thecodexentry fromsrc/clients.ts. - ChatGPT steps up on a 403. Remove the
chatgptentry the same way. - Once no client needs
scopeChallenge: 'tool', remove it fromClientBehavior, along with?scopeChallenge.
- Dominant language
- TypeScript
- Stars
- 972
- Forks
- 143
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 36
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/mcp
-
[Connection guide] Claude CodePossibly taken @ting-hong-shieh claimed this 69 days ago. Openenhancement good first issue
Difficulty 1/5 Under an hour Newbie friendliness 72/100
cloudflare/mcp#39 · 6 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Access application creation returns “1010: undefined” without diagnostic detailsPossibly taken @mattzcarey claimed this 6 days ago. Openbug
cloudflare/mcp#292 · 1 assignee ·
Maintainers usually reply within 1 day
-
Hosted execute times out after 300s during inactive Worker version submissionPossibly taken @mattzcarey claimed this 6 days ago. Openbug
cloudflare/mcp#290 · 1 assignee ·
Maintainers usually reply within 1 day
-
question
Difficulty 4/5 1-2 days Newbie friendliness 22/100
cloudflare/mcp#286 ·
Maintainers usually reply within 1 day
-
Support EU-jurisdiction R2 buckets in Cloudflare MCPPossibly taken @MauroDruwel claimed this 9 days ago. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
cloudflare/mcp#278 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
zts212653/clowder-ai#1678 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Progressive-Victory/the-website#680 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100