chadtmiller.com/monolith
An atproto PDS
MCP step-up: a scope that does not allow a call is a 403 naming all it needs
MergedThis pull makes a ScopeMissingError for a working MCP token an HTTP 403 insufficient_scope challenge. The challenge lists the token's scope, then the scope the error names, then the other repository scopes the input needs. The spec (OAUTH-MCP.md), the README gap, the harness check and the server all change together. The spec pins the behaviour: the scope order, the body, and app-password methods staying tool errors. The check compares exact challenge fields, covers the negative case, and then proves the retry writes, mirrored on the reference. It makes the harness stricter and doesn't loosen anything. The server adds no crates, and I found nothing taken from reference or SDK source. I didn't run the code or read the checks' results. One small gap: the code replaces " with ' in error_description, and the spec doesn't say so. That is harmless, but worth a sentence in the spec.
The head moved only by a rebase onto main, which now holds the OAuth-for-MCP pull. The pull's own diff is the one I approved: the step_up challenge in mcp.rs, missing_for_records in scopes.rs, the step-up check in oauth-mcp.mjs, the new paragraph in OAUTH-MCP.md, and the README gap removed. The spec, code, harness check and README still agree. The harness check is stricter, not looser, and the server adds no crates. I didn't run the code. My earlier note still stands: error_description has " replaced with ', and the spec doesn't say so.
An MCP token whose scope doesn't allow a call now gets MCP's step-up: HTTP
403withWWW-Authenticate: Bearer error="insufficient_scope", scope="…", naming everything the call needs, so Claude asks the account for it once and retries. Before, it was a dead-end tool error.Claude Opus 5.5 · high
What changes
Spec.
spec/OAUTH-MCP.md, "Tokens at the MCP endpoint":403 ScopeMissingErroris answered with HTTP403andBearer error="insufficient_scope", scope=…, resource_metadata=…, error_description=….putRecordgets bothcreateandupdate, and one sign-in grants the whole call.Harness.
checks/oauth-mcp.mjs:atproto repo:com.example.otheralone.repo_put_recordtocom.example.note, which must be refused with403and the exact challenge.server_create_app_passwordwith the same token, which must stay a tool error.Server.
mcp.rs: astep_upchallenge raised wherever a scope refusal surfaces, both the gate before input and the method's own checks. Challenges now carry their own status and body error.scopes.rs:missing_for_recordslists every repository scope an input needs that a scope lacks.Why
Claude asks for
atproto transition:generic, which covers most tools, but a person may narrow it at consent, and some tools need scopes outside it, such as email and chat. Without step-up those calls fail with nothing Claude can act on. Naming everything at once matters:ScopeMissingErrornames only the first missing permission, soputRecordon a granular scope would have taken two sign-ins. MCP says a challenge SHOULD name all the operation needs, and Claude's docs say scopes from an earlier step-up aren't reliably carried forward.How it was checked
a call the scope refuses, a tool error with no challenge.the call after a step-up, a second403foraction=update, which is what led tomissing_for_records.a call the scope refuses. Put back.compare.mjs --steps 30 --seed 31 --commandsagrees;cargo test -p pds-server mcp::passes, clippy is clean;just quickpasses here.just gatesis left to the pull'sgatesworkflow.Shortcomings
blob:and anrpc:one, is challenged for the first, then the next. No method the MCP endpoint serves needs two such things today.