Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Planet Scale MCP server

Vendor MCP
Open markdown

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 app
Scalekit's or your own

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    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. Create the Planet Scale MCP connection

    In AgentKit > Connections, create a Planet Scale MCP connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for Planet Scale MCP server, so you don't need to register an OAuth app.

  4. 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.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)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'planetscalemcp_planetscale_list_organizations',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • planetscalemcp_planetscale_execute_read_queryExecute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) against a PlanetScale database branch.Read-only

    Planetscale 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-only

    Planetscale 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-only

    Planetscale 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-only

    Planetscale 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-only

    Planetscale 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-only

    Planetscale 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-only

    Planetscale Get Organization

    Get details about a specific PlanetScale organization.

    Inputs

    pathParametersobjectrequired
    No description.
  • planetscalemcp_planetscale_list_branchesList all branches within a PlanetScale database.Read-only

    Planetscale List Branches

    List all branches within a PlanetScale database.

    Inputs

    pathParametersobjectrequired
    No description.
    queryParametersobject
    No description.