Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the CockroachDB Cloud MCP server

Vendor MCP
Open markdown

The CockroachDB Cloud MCP connector routes your AI agent's tool calls to CockroachDB Cloud's own MCP server through Scalekit. Each user signs in to CockroachDB Cloud once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 12 tools.

Tools
12
What they doRead · write · destructive
9 · 2 · 19 read2 write1 destructive
Users sign in with
OAuth app
Your own CockroachDB Cloud MCP server app

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 CockroachDB Cloud MCP connection

    In AgentKit > Connections, create a CockroachDB Cloud MCP connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    CockroachDB Cloud MCP server connections use your own OAuth app. Register one with CockroachDB Cloud MCP server and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the CockroachDB Cloud MCP connection.

  5. 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 = 'cockroachdbmcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize CockroachDB Cloud 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: 'cockroachdbmcp_get_cluster',
    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
  • cockroachdbmcp_explain_queryShow query execution plan without executing the queryRead-only

    Explain query

    Show query execution plan without executing the query

    Inputs

    databasestringrequired
    The name of the database
    querystringrequired
    The SQL query to explain
    cluster_idstring
    CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
  • cockroachdbmcp_get_clusterGet detailed information for the CockroachDB clusterRead-only

    Get cluster

    Get detailed information for the CockroachDB cluster

    Inputs

    cluster_idstring
    CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
  • cockroachdbmcp_get_table_schemaGet detailed schema information for a table including columns and indexesRead-only

    Get table schema

    Get detailed schema information for a table including columns and indexes

    Inputs

    databasestringrequired
    The name of the database
    tablestringrequired
    The name of the table
    cluster_idstring
    CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
    schemastring
    The schema name (defaults to 'public' if not specified)
  • cockroachdbmcp_list_clustersList all CockroachDB clusters accessible to the authorized userRead-only

    List clusters

    List all CockroachDB clusters accessible to the authorized user

    Inputs

    show_inactiveboolean
    If true, show clusters that have been deleted or failed to initialize.default false
  • cockroachdbmcp_list_databasesList all databases in the CockroachDB cluster.Read-only

    List databases

    List all databases in the CockroachDB cluster.

    Inputs

    cluster_idstring
    CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
    limitinteger
    Maximum results to return (default: 100, max: 10000)default 100
    offsetinteger
    Number of results to skip (default: 0)default 0
  • cockroachdbmcp_list_tablesList all tables in a database.Read-only

    List tables

    List all tables in a database.

    Inputs

    databasestringrequired
    The name of the database
    cluster_idstring
    CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
    limitinteger
    Maximum results to return (default: 100, max: 10000)default 100
    offsetinteger
    Number of results to skip (default: 0)default 0
  • cockroachdbmcp_select_queryExecute a read-only SELECT query on the CockroachDB cluster.Read-only

    Select query

    Execute a read-only SELECT query on the CockroachDB cluster. Automatically adds LIMIT 25 if not specified. Maximum LIMIT is 10000. Use LIMIT with OFFSET for pagination (e.g., LIMIT 100 OFFSET 200).

    Inputs

    databasestringrequired
    The name of the database
    querystringrequired
    The SQL query to execute (SELECT statements only). Use LIMIT/OFFSET in your query for pagination.
    cluster_idstring
    CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
  • cockroachdbmcp_show_running_queriesList currently executing queries on the clusterRead-only

    Show running queries

    List currently executing queries on the cluster

    Inputs

    cluster_idstring
    CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.