Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Track Codex and ChatGPT step-up: they need the challenge in the tool result, not the spec's 403

Open
#298 2 comments 0 reactions 0 assignees View on GitHub

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

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

enhancement

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" into StreamableHttpError::InsufficientScope (http_client_adapter.rs#L298-L307). RmcpClient::call_tool only converts AuthRequired (a 401) into a result carrying mcp/www_authenticate (rmcp_client.rs#L909-L930). InsufficientScope falls through as a transport error: "Transport send error … Insufficient scope".
  • The behaviour is pinned by a test. streamable_http_403_scope_challenge_returns_insufficient_scope asserts 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.
  • rmcp already has the missing piece. AuthorizationManager::request_scope_upgrade computes 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.write and workers-kv-storage.write in 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 /mcp instead (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 the codex entry from src/clients.ts.
  • ChatGPT steps up on a 403. Remove the chatgpt entry the same way.
  • Once no client needs scopeChallenge: 'tool', remove it from ClientBehavior, along with ?scopeChallenge.
Dominant language
TypeScript
Stars
972
Forks
143
Avg merge
2d 19h
Merged PRs (30d)
36

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/mcp

All issues in cloudflare/mcp

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.