- Create a service token in your organization settings.
- Copy the token value. It starts with
pscale_tkn_. Do not use the token ID, and do not sendid:secret. - Grant only the organization and database permissions you want the MCP tools to have. Leave the rest off.
- Set
PLANETSCALE_API_TOKENto that token value in the environment where the client runs. - Send it as
Authorization: Bearer pscale_tkn_...tohttps://mcp.pscale.dev/mcp/planetscale.
https://mcp.pscale.dev/mcp/planetscale-insights-only.
Claude.ai, Claude for desktop, Claude Managed Agents, and Notion authenticate with OAuth only. They do not accept a service token header.
Permissions
The MCP server calls the PlanetScale API with the token you send. Each tool fails if the token is missing the permission for that API call. Grant the smallest set that covers the tools you want. Add organization permissions on the token, then add database permissions on each database the token should see, or use permissions for all databases.Read-only access
This covers listing organizations, databases, branches, schema, Insights, and schema recommendations. It does not allow SQL execution. Organizationread_organizationread_databases
read_databaseread_branch
read_database returns metadata about a database (name, state, default branch). It does not connect to MySQL or Postgres, and it does not run queries. Connecting and executing SQL requires the connect_* permissions below.
read_databases lets the token list every database in the organization. If you only want one database, skip read_databases and grant read_database plus read_branch on that database only.
Add read_invoices on the organization if you want the invoice tools.
Read queries
Add these database permissions on top of the read-only set. The MCP server creates a short-lived reader password or Postgres role, runs the query, then deletes the credential.connect_branch(development branches)connect_production_read_only_branch(production branches)delete_branch_password(development branches)delete_production_read_only_branch_password(production branches)
connect_branch and delete_branch_password. If you only query development branches, leave off the production pair. delete_production_branch_password also works for deleting reader credentials on production.
Do not grant connect_production_branch. That permission can create write credentials on production.
Write queries
planetscale_execute_write_query creates an admin or write role, so it needs the full connect permissions, not the read-only ones.
Add these on top of the read-only set:
connect_branchconnect_production_branchdelete_branch_passworddelete_production_branch_password
Tool permissions
Client configuration
- Cursor
- Claude Code
- Codex
- VS Code
- Gemini CLI
- OpenCode
Add the header to
.cursor/mcp.json or ~/.cursor/mcp.json. Cursor and the Cursor CLI (agent) read PLANETSCALE_API_TOKEN from the environment at connect time..cursor/mcp.json
Troubleshooting
If a tool returnsinvalid_token, the header is the wrong shape. Send Authorization: Bearer pscale_tkn_... (the token secret only). The token ID, or id:secret, is rejected.
If a tool returns permission denied, the token is missing the grant for that API call. Add the permission from the table above.

