PlanetScale
Connect Claude, ChatGPT or Cursor to PlanetScale via MCP. List organizations, databases, and branches with a service token.
Example questions
Try asking your AI client
-
Which PlanetScale organizations can this token see?
-
List databases in the acme organization and highlight production branches.
-
What branches exist on the billing database right now?
-
Show details for the main branch on the billing database.
-
Did we ever create a develop branch on the marketing database?
Overview
Connect PlanetScale so AI clients can list organizations, databases, and branches through the PlanetScale API.
stackgate.ai stores your service token ID and token encrypted and calls https://api.planetscale.com/v1 on your behalf. Tool results are returned to your AI client for that request.
This integration manages PlanetScale platform resources. It does not run SQL against your data. For query execution, use PlanetScale's own hosted MCP.
Prerequisites
- A PlanetScale organization
- A stackgate.ai account
Getting credentials
- Sign in to the PlanetScale dashboard.
- Open Settings → Service tokens and create a new service token.
- Copy the ID and token once. The token is not shown again.
- Grant organization access: at least
read_organization. - Grant database access for each database (or all databases): at least
read_databaseandread_branch. - In stackgate.ai, open My Integrations → PlanetScale, paste the ID and token, optionally set a default organization, and click Connect & enable.
- After connect, use Edit tool access if you want a smaller tool allowlist.
Treat the token like a password. Rotate or delete it in PlanetScale if it is exposed.
See the service token documentation for access permissions.
Using with AI clients
- Dedicated endpoint:
POST /mcp/planetscalewith a Sanctum bearer token - Private gateway: one config for all integrations - use
planetscale__*namespaced tools
See Documentation for HTTP authentication and private gateway setup.
Suggested workflow
list_organizations- confirm the token and note organization names.list_databases/get_database- find the database name.list_branches/get_branch- inspect production and development branches.
If you set a default organization, tools can omit the organization argument.
Troubleshooting
- 422 integration not configured - paste a service token ID and token in My Integrations.
- 401 Unauthorized - regenerate the service token in PlanetScale and update My Integrations. The full token is shown only once.
- 403 Forbidden - the token is missing organization or database access. Add
read_organization,read_database, andread_branchon the token. - Empty organization or database lists - the token may have no grants for those resources.
- 429 Too many requests - the PlanetScale API allows 600 requests per minute. Wait and retry. Reduce parallel tool calls.
- SQL or query tools missing - this hub integration does not execute SQL. Use PlanetScale's hosted MCP for query execution.
Available tools
-
list_organizations
List PlanetScale organizations the service token can access.
-
get_organization
Get a PlanetScale organization by name.
-
list_databases
List databases in a PlanetScale organization.
-
get_database
Get a PlanetScale database by name.
-
list_branches
List branches for a PlanetScale database.
-
get_branch
Get a PlanetScale database branch by name.
MCP endpoint:
https://stackgate.ai/mcp/planetscale
(HTTP) or via the
private gateway.