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 26 tools.

Tools
26
What they doRead · write · destructive
15 · 10 · 115 read10 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', 'percentTime', 'totalTime', 'cpuTime', 'p50Latency', 'rowsRead', 'rowsReadPerQuery', 'rowsAffected', 'egressBytes', 'egressBytesPerQuery', 'maxEgressBytes', 'ingressBytes', 'ingressBytesPerQuery', 'maxIngressBytes', 'indexes', 'maxShardQueries']). 'cpuTime' is Postgres/Neki-only; 'maxEgressBytes' and ingress* are MySQL/Vitess-only. 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). Defaults to 24 hours ago. A range wider than 25 hours must start on the hour (e.g. '2026-08-19T00:00:00Z') and span at most 365 days; a wide range that is not hour-aligned is rejected, not narrowed. Supported in both discovery and fingerprint modes, though in fingerprint mode only the summary honours a wide range.
    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/Neki databases).
    limitnumber
    Number of results per metric (default: 5, max: 20)
    periodstring
    Shorthand for a recent time window ending at now. Cannot be combined with from/to — use one or the other. Only supported in discovery mode (ignored in fingerprint mode — use from/to instead).one of 15m1h3h6h12h1d2d7d8d
    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, tag:tag_key:tag_value for queries carrying that tag with that value, tag:tag_key on its own for queries carrying the tag whatever its value (including ones whose value went unrecorded), where tag_key is the bare tag name without the 'S'/'B' prefix `list_query_tags` reports and a value containing spaces or colons needs quoting (tag:route:"GET /horses"), 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). Any term can be negated by an immediately preceding '!' (!tag:app:web). 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/Neki-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. For a range wider than 25 hours it must land on an hour boundary -- either the top of an hour or its last second ('T13:00:00Z' or 'T12:59:59Z') -- so the simplest way to ask for a wide window is to omit it, which covers everything through the current hour. 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.