Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Planet Scale MCP connector

OAuth 2.1/DCR DatabasesDeveloper ToolsAI

Connect to PlanetScale MCP. Run SQL queries, inspect database branches and schemas, get query performance insights, and manage organizations and invoices...

Planet Scale MCP connector

  1. Terminal window
    npm install @scalekit-sdk/node

    Full SDK reference: Node.js | Python

  2. Add your Scalekit credentials to your .env file. 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>
  3. quickstart.ts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENV_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'planetscalemcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Planet Scale MCP:', link)
    process.stdout.write('Press Enter after authorizing...')
    await new Promise(r => process.stdin.once('data', r))
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'planetscalemcp_planetscale_execute_read_query',
    toolInput: { organization: 'YOUR_ORGANIZATION', database: 'YOUR_DATABASE', branch: 'YOUR_BRANCH', query: 'YOUR_QUERY' },
    })
    console.log(result)

Connect this agent connector to let your agent:

  • Search planetscale — Search the PlanetScale knowledge base for documentation, API references, code examples, and guides
  • List planetscale — List all schema recommendations for a PlanetScale database based on production query patterns
  • Get planetscale — Get details about a specific PlanetScale organization
  • Execute planetscale — Execute a write SQL query (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database branch

Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.

planetscalemcp_planetscale_execute_read_query # Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) against a PlanetScale database branch. 5 params

Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) against a PlanetScale database branch.

Name Type Required Description
branch string required Branch name (e.g., 'main')
database string required Database name
organization string required PlanetScale organization name
query string required SQL SELECT query to execute
postgres_database_name string optional 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.
planetscalemcp_planetscale_execute_write_query # Execute a write SQL query (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database branch. 6 params

Execute a write SQL query (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database branch.

Name Type Required Description
branch string required Branch name (e.g., 'main')
database string required Database name
organization string required PlanetScale organization name
query string required SQL INSERT/UPDATE/DELETE/DDL query to execute
confirm_destructive boolean optional 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_name string optional 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.
planetscalemcp_planetscale_get_branch # Get details about a specific database branch. 1 param

Get details about a specific database branch.

Name Type Required Description
pathParameters object required No description.
planetscalemcp_planetscale_get_branch_schema # Get the schema (tables and columns) for a specific database branch. 2 params

Get the schema (tables and columns) for a specific database branch.

Name Type Required Description
pathParameters object required No description.
queryParameters object optional No description.
planetscalemcp_planetscale_get_database # Get details about a specific PlanetScale database. 1 param

Get details about a specific PlanetScale database.

Name Type Required Description
pathParameters object required No description.
planetscalemcp_planetscale_get_insights # Get query performance insights for a PlanetScale database branch, including top queries aggregated over a time period. 13 params

Get query performance insights for a PlanetScale database branch, including top queries aggregated over a time period.

Name Type Required Description
branch string required Branch name (e.g., 'main')
database string required Database name
organization string required PlanetScale organization name
fields array optional Request specific metric fields from the API (e.g. ['query', 'count', 'rowsRead', 'rowsAffected', 'rowsReadPerReturned', 'egressBytes', 'indexes', 'maxShardQueries']). Ignored when fingerprint is provided.
fingerprint string optional 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.
from string optional 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.
keyspace string optional 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).
limit number optional Number of results per metric (default: 5, max: 20)
period string optional 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).
query string optional 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_by string optional Sort order: 'all' (default) aggregates 5 API calls for comprehensive view, or specify a single metric: 'totalTime', 'rowsRead', 'p99Latency', 'rowsReadPerReturned', 'rowsAffected', 'egressBytes'. Ignored when fingerprint is provided.
tablet_type string optional Filter by tablet type: 'primary' or 'replica'
to string optional End of time range (ISO 8601 format). Defaults to now. Supported in both discovery and fingerprint modes.
planetscalemcp_planetscale_get_invoice_line_items # Get all line items for a specific invoice, broken down by database branch costs. 2 params

Get all line items for a specific invoice, broken down by database branch costs.

Name Type Required Description
pathParameters object required No description.
queryParameters object optional No description.
planetscalemcp_planetscale_get_organization # Get details about a specific PlanetScale organization. 1 param

Get details about a specific PlanetScale organization.

Name Type Required Description
pathParameters object required No description.
planetscalemcp_planetscale_list_branches # List all branches within a PlanetScale database. 2 params

List all branches within a PlanetScale database.

Name Type Required Description
pathParameters object required No description.
queryParameters object optional No description.
planetscalemcp_planetscale_list_cluster_sizes # List available PlanetScale cluster sizes (SKUs) for an organization. 3 params

List available PlanetScale cluster sizes (SKUs) for an organization.

Name Type Required Description
organization string required PlanetScale organization name
engine string optional Database engine to list SKUs for (default: mysql)
type string optional Filter to only autoscaling (PS-*, network-backed) or metal (M-*, local storage) sizes
planetscalemcp_planetscale_list_databases # List all databases within a PlanetScale organization. 2 params

List all databases within a PlanetScale organization.

Name Type Required Description
pathParameters object required No description.
queryParameters object optional No description.
planetscalemcp_planetscale_list_invoices # List all invoices for a PlanetScale organization. 2 params

List all invoices for a PlanetScale organization.

Name Type Required Description
pathParameters object required No description.
queryParameters object optional No description.
planetscalemcp_planetscale_list_organizations # List all PlanetScale organizations you have access to. 1 param

List all PlanetScale organizations you have access to.

Name Type Required Description
queryParameters object optional No description.
planetscalemcp_planetscale_list_regions_for_organization # List the regions available for a PlanetScale organization. 2 params

List the regions available for a PlanetScale organization.

Name Type Required Description
pathParameters object required No description.
queryParameters object optional No description.
planetscalemcp_planetscale_list_schema_recommendations # List all schema recommendations for a PlanetScale database based on production query patterns. 2 params

List all schema recommendations for a PlanetScale database based on production query patterns.

Name Type Required Description
pathParameters object required No description.
queryParameters object optional No description.
planetscalemcp_planetscale_search_documentation # Search the PlanetScale knowledge base for documentation, API references, code examples, and guides. 5 params

Search the PlanetScale knowledge base for documentation, API references, code examples, and guides.

Name Type Required Description
query string required Search query for PlanetScale docs
api_reference_only boolean optional Only return API reference docs
code_only boolean optional Only return code snippets
language string optional Optional language filter (e.g., 'en', 'es')
version string optional Optional version filter (e.g., 'v0.7')