Skip to content

fix(mcp): ChatGPT links missing a tool's write scope are told to reconnect - #126

Merged
Ooscaar merged 1 commit into
developfrom
t3/missing-write-scope-reconnect
Nov 24, 2026
Merged

Ooscaar merged 1 commit into
developfrom
t3/missing-write-scope-reconnect

Conversation

@Ooscaar

@Ooscaar Ooscaar commented Nov 24, 2026

Copy link
Copy Markdown
Member

Why

Since Schedule-Posts-API #10188, a token with accounts:read but not accounts:write gets a read-only 403 on account and profile writes. About 3,200 ChatGPT links are in that state. MissingScopeMiddleware showed the reconnect steps only when the token held none of the tool's x-oauth-scopes. The spec still lists accounts:read on writes, so these links got a bare error with no way forward.

What

  • MissingScopeMiddleware now shows the steps when the token lacks the tool's first declared scope (reaching[0]: the :write scope for a write, the :read scope for a read). A :write scope still counts as holding its :read, so the existing "a write scope reaches the read" case still gets the API's own error.
  • API keys behave as before. _log_group_refusal runs as before, and challenged now follows the new decision.
  • _SCOPE_PURPOSE gets an entry for accounts:write, so the steps name it in plain words.
  • This works both before and after the sibling Schedule-Posts-API change that stops listing posts:read/accounts:read on writes, because it depends only on the first declared scope.

Tests

  • A link with posts:write accounts:read calling profiles_create_profile that gets the read-only 403 now sees the reconnect steps naming accounts:write.
  • A link that holds accounts:write, or an API key, still gets the API's own error.
  • A read tool refused for a missing :read scope still shows the steps (existing test_a_link_without_the_tools_scope_is_asked_to_relink).

🤖 Generated with Claude Code

…nnect

Key the reconnect steps on the tool's first declared scope instead of on
all its x-oauth-scopes, so a link holding accounts:read but not
accounts:write gets the steps when the API refuses a profile or account
write. A :write scope still counts as holding its :read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ooscaar
Ooscaar merged commit bdab3d5 into develop Nov 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant