Skip to content

feat(mcp): ChatGPT plugin lists the 40 most used reads (wave 1) with least-privilege scopes - #120

Merged
mikipalet merged 5 commits into
developfrom
feat/chatgpt-plugin-wave1
Nov 23, 2026
Merged

mikipalet merged 5 commits into
developfrom
feat/chatgpt-plugin-wave1

Conversation

@mikipalet

@mikipalet mikipalet commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Why

The ChatGPT plugin (/chatgpt, published, ~1,700 users a week) only lists its 13 hand-shaped posting and analytics tools. OpenAI now picks up new tools on a published plugin after a daily or on-demand scan, each tool reviewed on its own, so the plugin can grow without a resubmission. Miki asked for the most used tools first, a curated set (about 150 in all, not the ~1,400 /mcp serves), in waves, with least privilege.

What

  • chatgpt_tools.py: wave 1, the 40 most used reads over 30 days (REST requests plus /mcp tool calls): inbox, comments, reviews, account health, analytics, profiles, ads (campaigns, ads, insights, tree) and contacts/leads. Each declares its read scope (securitySchemes) and gets a short description (one paragraph, one line per argument). No search_tools/call_tool. 53 tools, ~25k tokens of tools/list (7.4k for the live 13).
  • /chatgpt advertises messaging:read, ads:read, contacts:read on top of its 4 scopes; no write scope for those groups.
  • Generator: explicit hints on every tool (read-only for 28 POST queries/previews/validations, openWorldHint for 7 public-content reads) and TOOL_OAUTH_SCOPES (every scope that reaches a tool, from the spec's x-oauth-scopes, the declared one first). openapi.yaml carries them until the next regenerate.
  • MissingScopeChallengeMiddleware: a link without any of a tool's scopes gets the mcp/www_authenticate insufficient_scope challenge, so ChatGPT asks to re-link. A 403 the token's scopes already cover (team member with the group off) stays a plain error. The token's scope comes from /v1/auth/verify, cached with the user id.
  • OAUTH_SCOPES gains the 3 read scopes (mirrors the authorization server).
  • The 13 live definitions are unchanged, pinned by tests/fixtures/chatgpt_live_tools.json.

Follow-ups

  • Merge after Schedule-Posts-API #10145 is deployed: test_metadata_scopes_match_the_live_authorization_server checks the live server's scopes.
  • After deploy: Rescan in the OpenAI dashboard, then check which of the 40 went live or got findings.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kx4ZnYRCwTShnKwf5bar5Y

mikipalet and others added 2 commits November 23, 2026 20:51
…ave 1)

/chatgpt now registers 40 generated tools next to its 13 hand-shaped
ones: the most used reads over the last 30 days (REST plus /mcp calls)
from inbox, comments, mentions, reviews, account health, analytics and
profiles. Each declares its OAuth scope (securitySchemes) from the spec's
x-oauth-scopes and a one-paragraph description; no search_tools/call_tool.
The 13 live definitions are unchanged and pinned by a fixture.

- Generator: explicit hints with read-only overrides for POST queries,
  openWorldHint on public-content reads, TOOL_OAUTH_SCOPE table.
- /chatgpt advertises messaging:write (the inbox scope) on top of its 4.
- A link without a tool's scope gets the mcp/www_authenticate
  insufficient_scope challenge, so ChatGPT asks to re-link; the token's
  scope comes from /v1/auth/verify and is cached with the user id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kx4ZnYRCwTShnKwf5bar5Y
…d ads and contacts reads

Schedule-Posts-API #10145 adds read-only ads:read, contacts:read and
messaging:read. Reads now declare them (TOOL_OAUTH_SCOPES keeps every scope
that reaches a tool, the declared one first), so /chatgpt advertises
messaging:read, ads:read and contacts:read instead of messaging:write.
Wave 1 is re-ranked over every readable group: ads and contacts reads in
the top 40 replace the tail of the old list. The re-link challenge fires
only when the token holds none of a tool's scopes, so a :write scope still
covers the read. Argument lines in descriptions are capped at 100 chars.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kx4ZnYRCwTShnKwf5bar5Y
@mikipalet mikipalet changed the title feat(mcp): ChatGPT plugin lists 40 more tools, the most used reads (wave 1) feat(mcp): ChatGPT plugin lists the 40 most used reads (wave 1) with least-privilege scopes Nov 23, 2026
mikipalet and others added 3 commits November 23, 2026 21:21
- The generator refuses a spec with no x-oauth-scopes instead of emptying
  the scope table, and a listed tool without a scope fails with its name.
- Pin the server instructions; test a generated tool's success path and
  the scope claim read from the verified token.
- Descriptions keep arguments documented by name only and no longer put a
  blank line after "Args:".
- A cache hit also keeps the token's identity (user id, scope) fresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kx4ZnYRCwTShnKwf5bar5Y
@mikipalet
mikipalet merged commit fd7e419 into develop Nov 23, 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