Skip to content

feat(mcp): advertise the six area read scopes - #133

Merged
Ooscaar merged 2 commits into
developfrom
feat/mcp-area-read-scopes
Nov 26, 2026
Merged

Ooscaar merged 2 commits into
developfrom
feat/mcp-area-read-scopes

Conversation

@Ooscaar

@Ooscaar Ooscaar commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Why

The Zernio authorization server added six read-only scopes (Schedule-Posts-API #10954). MCP clients request exactly the scopes /mcp advertises, so without them no MCP user can get read-only access to these areas.

What

  • OAUTH_SCOPES: append commerce:read, calendar:read, files:read, campaigns:read, money:read, automations:read after messaging:read. The strings and order must match libs/oauth/scopes.ts in Schedule-Posts-API (#10954).
  • _SCOPE_PURPOSE: a relink purpose for each new scope and for its :write sibling (a read-narrowed token calling a write tool is refused on the :write). automations:read covers contacts and webhooks, not workflows.
  • Tests: the six are advertised at the end, and each area scope has a purpose. CHANGELOG entry.

Merge only once zernio.com has deployed #10954: test_metadata_scopes_match_the_live_authorization_server compares against the live issuer and fails until then, and before it an authorize request with the new scopes gets invalid_scope.

🤖 Generated with Claude Code

Ooscaar and others added 2 commits November 26, 2026 18:53
commerce:read, calendar:read, files:read, campaigns:read, money:read and
automations:read, appended after messaging:read to match libs/oauth/scopes.ts
in Schedule-Posts-API (#10954), each with a relink purpose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A token narrowed to an area's :read that calls a write tool is refused on
the tool's first declared scope, the :write, which had no purpose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ooscaar

Ooscaar commented Nov 26, 2026

Copy link
Copy Markdown
Member Author

Review (code-review high --fix)

Finding Outcome
Shipping before #10954 is live makes authorize return invalid_scope Not a code change: merge only after #10954 deploys (in PR body)
:write area scopes had no relink purpose (what a read-narrowed token hits) Fixed
Test only covered unreachable :read purposes Fixed, covers :read and :write
No CHANGELOG entry Fixed
Area read tools declare only :write in TOOL_OAUTH_SCOPES, so a :read token gets relink steps on a group 403 Skipped: needs the spec and generated_tools.py regenerated (bot-owned); same today for ads:read

Tests / QA

Check Result
pytest tests/test_mcp_protected_resource_metadata.py tests/test_chatgpt_generated_tools.py 46 passed, 1 failed (live-issuer comparison, expected until #10954 deploys)
Live zernio.com/.well-known/oauth-authorization-server Still 16 scopes (#10954 not yet deployed)

Metrics

Metric Before Expected after
Database / cost none (constants only) none
/mcp scopes_supported 16 22

Pending post-deploy check: once #10954 is on zernio.com, rerun test_metadata_scopes_match_the_live_authorization_server (must pass) and confirm a MCP client authorize with the 22 scopes succeeds.

@Ooscaar
Ooscaar merged commit 5fde16d into develop Nov 26, 2026
8 of 11 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