The Planet Scale MCP connector routes your AI agent's tool calls to Planet Scale's own MCP server through Scalekit. Each user signs in to Planet Scale once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 16 tools.
- Tools
- 16
- What they doRead · write · destructive
- 15 · 0 · 115 read0 write1 destructive
- Users sign in with
- OAuth
- OAuth app
- Scalekit's or your own
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Planet Scale MCP connection
In AgentKit > Connections, create a Planet Scale MCP connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Scalekit credentials are available for Planet Scale MCP server, so you don't need to register an OAuth app.
Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'planetscalemcp'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Planet Scale MCP:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'planetscalemcp_planetscale_list_organizations',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "planetscalemcp"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Planet Scale MCP:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="planetscalemcp_planetscale_list_organizations",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user signs in once. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolplanetscalemcp_planetscale_execute_read_queryExecute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) against a PlanetScale database branch.Read-onlyPlanetscale Execute Read Query
Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) against a PlanetScale database branch.
Inputs
branchstringrequired- Branch name (e.g., 'main')
databasestringrequired- Database name
organizationstringrequired- PlanetScale organization name
querystringrequired- SQL SELECT query to execute
postgres_database_namestring- Postgres only: target database name to connect to. Use when the user has created additional databases in the same PlanetScale Postgres cluster (e.g. via CREATE DATABASE). Omit to use the default database for the branch.
use_replicaboolean- Route read queries to a read replica when the branch has replicas. Defaults to true. Set false to force the primary.
planetscalemcp_planetscale_get_branchGet details about a specific database branch.Read-onlyPlanetscale Get Branch
Get details about a specific database branch.
Inputs
pathParametersobjectrequired- No description.
planetscalemcp_planetscale_get_branch_schemaGet the schema (tables and columns) for a specific database branch.Read-onlyPlanetscale Get Branch Schema
Get the schema (tables and columns) for a specific database branch.
Inputs
pathParametersobjectrequired- No description.
queryParametersobject- No description.
planetscalemcp_planetscale_get_databaseGet details about a specific PlanetScale database.Read-onlyPlanetscale Get Database
Get details about a specific PlanetScale database.
Inputs
pathParametersobjectrequired- No description.
planetscalemcp_planetscale_get_insightsGet query performance insights for a PlanetScale database branch, including top queries aggregated over a time period.Read-onlyPlanetscale Get Insights
Get query performance insights for a PlanetScale database branch, including top queries aggregated over a time period.
Inputs
branchstringrequired- Branch name (e.g., 'main')
databasestringrequired- Database name
organizationstringrequired- PlanetScale organization name
fieldsarray- Request specific metric fields from the API (e.g. ['query', 'count', 'rowsRead', 'rowsAffected', 'rowsReadPerReturned', 'egressBytes', 'indexes', 'maxShardQueries']). Ignored when fingerprint is provided.
fingerprintstring- Query fingerprint hash to drill down into a specific query pattern. Use the `fingerprint` value from an initial insights call. Always include `keyspace` (also from the initial results) to get summary data.
fromstring- Start of time range (ISO 8601 format, e.g. '2026-03-09T00:00:00.000Z'). Defaults to 24 hours ago. Supported in both discovery and fingerprint modes.
keyspacestring- Keyspace for fingerprint drill-down. Required to get summary data. Use the `keyspace` value returned in insights results (e.g. 'my_keyspace' for MySQL/Vitess or 'postgres.public' for Postgres databases).
limitnumber- Number of results per metric (default: 5, max: 20)
periodstring- Shorthand for a recent time window ending at now. Valid values: '15m', '1h', '3h', '6h', '12h', '24h'. Cannot be combined with from/to — use one or the other. Only supported in discovery mode (ignored in fingerprint mode — use from/to instead).
querystring- Filter insights by search query. Supports plain text matching and structured filters: exact match with quotes ("select count"), statement_type:select|delete|update|insert, table:table_name, keyspace:keyspace_name, table_keyspace:keyspace_name, index:index_name or index:table.index_name, indexed:true|false, multishard:true|false, query_count:>N or query_count:<N, p99:>N or p50:<N (ms), max_latency:>N (ms). Ignored when fingerprint is provided.
sort_bystring- Sort order: 'all' (default) aggregates curated API calls for a comprehensive view, or specify a single metric: 'count', 'percentTime', 'totalTime', 'cpuTime', 'p50Latency', 'p99Latency', 'rowsRead', 'rowsReadPerQuery', 'rowsReadPerReturned', 'rowsAffected', 'egressBytes', 'egressBytesPerQuery', 'maxEgressBytes', 'ingressBytes', 'ingressBytesPerQuery', 'maxIngressBytes'. 'cpuTime' is Postgres-only; 'maxEgressBytes' and ingress* are MySQL/Vitess-only. Ignored when fingerprint is provided.one of
allcountpercentTimetotalTimecpuTimep50Latencyp99LatencyrowsReadrowsReadPerQueryrowsReadPerReturnedrowsAffectedegressBytesegressBytesPerQuerymaxEgressBytesingressBytesingressBytesPerQuerymaxIngressBytes tablet_typestring- Filter by tablet type: 'primary' or 'replica'one of
primaryreplica tostring- End of time range (ISO 8601 format). Defaults to now. Supported in both discovery and fingerprint modes.
planetscalemcp_planetscale_get_invoice_line_itemsGet all line items for a specific invoice, broken down by database branch costs.Read-onlyPlanetscale Get Invoice Line Items
Get all line items for a specific invoice, broken down by database branch costs.
Inputs
pathParametersobjectrequired- No description.
queryParametersobject- No description.
planetscalemcp_planetscale_get_organizationGet details about a specific PlanetScale organization.Read-onlyPlanetscale Get Organization
Get details about a specific PlanetScale organization.
Inputs
pathParametersobjectrequired- No description.
planetscalemcp_planetscale_list_branchesList all branches within a PlanetScale database.Read-onlyPlanetscale List Branches
List all branches within a PlanetScale database.
Inputs
pathParametersobjectrequired- No description.
queryParametersobject- No description.
planetscalemcp_planetscale_list_cluster_sizesList available PlanetScale cluster sizes (SKUs) for an organization.Read-onlyPlanetscale List Cluster Sizes
List available PlanetScale cluster sizes (SKUs) for an organization.
Inputs
organizationstringrequired- PlanetScale organization name
enginestring- Database engine to list SKUs for (default: mysql)one of
mysqlpostgresql typestring- Filter to only autoscaling (PS-*, network-backed) or metal (M-*, local storage) sizesone of
autoscalingmetal
planetscalemcp_planetscale_list_databasesList all databases within a PlanetScale organization.Read-onlyPlanetscale List Databases
List all databases within a PlanetScale organization.
Inputs
pathParametersobjectrequired- No description.
queryParametersobject- No description.
planetscalemcp_planetscale_list_invoicesList all invoices for a PlanetScale organization.Read-onlyPlanetscale List Invoices
List all invoices for a PlanetScale organization.
Inputs
pathParametersobjectrequired- No description.
queryParametersobject- No description.
planetscalemcp_planetscale_list_organizationsList all PlanetScale organizations you have access to.Read-onlyPlanetscale List Organizations
List all PlanetScale organizations you have access to.
Inputs
queryParametersobject- No description.
planetscalemcp_planetscale_list_regions_for_organizationList the regions available for a PlanetScale organization.Read-onlyPlanetscale List Regions For Organization
List the regions available for a PlanetScale organization.
Inputs
pathParametersobjectrequired- No description.
queryParametersobject- No description.
planetscalemcp_planetscale_list_schema_recommendationsList all schema recommendations for a PlanetScale database based on production query patterns.Read-onlyPlanetscale List Schema Recommendations
List all schema recommendations for a PlanetScale database based on production query patterns.
Inputs
pathParametersobjectrequired- No description.
queryParametersobject- No description.
planetscalemcp_planetscale_search_documentationSearch the PlanetScale knowledge base for documentation, API references, code examples, and guides.Read-onlyPlanetscale Search Documentation
Search the PlanetScale knowledge base for documentation, API references, code examples, and guides.
Inputs
querystringrequired- Search query for PlanetScale docs
api_reference_onlyboolean- Only return API reference docs
code_onlyboolean- Only return code snippets
languagestring- Optional language filter (e.g., 'en', 'es')
versionstring- Optional version filter (e.g., 'v0.7')
planetscalemcp_planetscale_execute_write_queryExecute a write SQL query (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database branch.DestructivePlanetscale Execute Write Query
Execute a write SQL query (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database branch.
Inputs
branchstringrequired- Branch name (e.g., 'main')
databasestringrequired- Database name
organizationstringrequired- PlanetScale organization name
querystringrequired- SQL INSERT/UPDATE/DELETE/DDL query to execute
confirm_destructiveboolean- HUMAN CONFIRMATION REQUIRED: Only set to true after explicitly asking the user and receiving their approval. Show them the exact DELETE or DDL query first.
postgres_database_namestring- Postgres only: target database name to connect to. Use when the user has created additional databases in the same PlanetScale Postgres cluster (e.g. via CREATE DATABASE). Omit to use the default database for the branch.
No tools match.