Skip to content

fix(supabase): recommend scoped personal access tokens for the Management API, CLI, and MCP - #604

Merged
w3b6x9 merged 1 commit into
mainfrom
w3b6x9/scoped-pat-guidance
Sep 24, 2026
Merged

w3b6x9 merged 1 commit into
mainfrom
w3b6x9/scoped-pat-guidance

Conversation

@w3b6x9

@w3b6x9 w3b6x9 commented Sep 24, 2026

Copy link
Copy Markdown
Member

The skill had no guidance on personal access tokens, so agents setting up Management API scripts, CLI in CI, or the MCP server without OAuth tended to suggest a classic token with full account access. Scoped personal access tokens limit a token to chosen organizations, projects, and permissions.

Changes to skills/supabase/SKILL.md:

  • Security checklist: prefer scoped personal access tokens for scripts, CI, and agents, and look up required permissions in the personal access tokens guide instead of guessing. No endpoint-to-permission mapping is copied into the skill, so it can't drift from the docs.
  • CLI gotchas: the browser flow of supabase login creates a classic token. In CI, set SUPABASE_ACCESS_TOKEN to a scoped token, which takes precedence over a saved login. Commands that connect with the database password (for example supabase db push with SUPABASE_DB_PASSWORD) aren't limited by the token's permissions.
  • MCP troubleshooting: where the browser OAuth flow can't run, pass a scoped token in the Authorization header. New step 4 explains the "You do not have permission to perform this action" error a scoped token returns when it lacks a tool's permission or the project is outside its scope.

…ment API, CLI, and MCP

The skill had no guidance on personal access tokens, so agents setting up
Management API scripts, CLI in CI, or the MCP server without OAuth tended to
suggest a classic token with full account access. Scoped personal access
tokens limit a token to chosen organizations, projects, and permissions.

Changes to skills/supabase/SKILL.md:

- Security checklist: prefer scoped personal access tokens for scripts, CI,
  and agents, and look up required permissions in the personal access tokens
  guide instead of guessing. No endpoint-to-permission mapping is copied into
  the skill, so it can't drift from the docs.
- CLI gotchas: the browser flow of `supabase login` creates a classic token.
  In CI, set SUPABASE_ACCESS_TOKEN to a scoped token, which takes precedence
  over a saved login. Commands that connect with the database password (for
  example `supabase db push` with SUPABASE_DB_PASSWORD) aren't limited by the
  token's permissions.
- MCP troubleshooting: where the browser OAuth flow can't run, pass a scoped
  token in the Authorization header. New step 4 explains the "You do not have
  permission to perform this action" error a scoped token returns when it
  lacks a tool's permission or the project is outside its scope.

@Rodriguespn Rodriguespn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Thanks @w3b6x9

@w3b6x9
w3b6x9 merged commit 551274e into main Sep 24, 2026
5 checks passed
@w3b6x9
w3b6x9 deleted the w3b6x9/scoped-pat-guidance branch September 24, 2026 09:55
This was referenced Sep 24, 2026
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.

2 participants