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
- OAuth app
- Your own CockroachDB Cloud MCP server app
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 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_nameyour code passes. See Configure connections.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.
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 = 'cockroachdbmcp'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'cockroachdbmcp_get_cluster',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 = "cockroachdbmcp"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize CockroachDB Cloud MCP:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="cockroachdbmcp_get_cluster",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_toolcockroachdbmcp_explain_queryShow query execution plan without executing the queryRead-onlyExplain 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-onlyGet 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-onlyGet 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-onlyList 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-onlyList 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-onlyList 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-onlySelect 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-onlyShow 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.
cockroachdbmcp_show_statementExecute a SHOW statement for introspection (e.g., SHOW SCHEMAS, SHOW INDEXES, SHOW REGIONS, SHOW CONSTRAINTS).Read-onlyShow statement
Execute a SHOW statement for introspection (e.g., SHOW SCHEMAS, SHOW INDEXES, SHOW REGIONS, SHOW CONSTRAINTS). Results are limited to 100 rows by default. Prefer list_databases, list_tables, or get_table_schema for those operations.
Inputs
querystringrequired- The SHOW statement to execute (e.g., 'SHOW SCHEMAS', 'SHOW INDEXES FROM mytable', 'SHOW REGIONS', 'SHOW CREATE TABLE mytable', 'SHOW CONSTRAINTS FROM mytable')
cluster_idstring- CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
databasestring- The database context for the SHOW statement (optional for cluster-level statements like SHOW DATABASES)
cockroachdbmcp_create_databaseCreate a new database in the clusterWriteCreate database
Create a new database in the cluster
- Idempotent
Inputs
databasestringrequired- The name of the database to create
cluster_idstring- CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
cockroachdbmcp_create_tableCreate a new table in a database using a CREATE TABLE DDL statement.WriteCreate table
Create a new table in a database using a CREATE TABLE DDL statement. Only CREATE TABLE statements are allowed. Supports CREATE TABLE AS SELECT for creating tables from query results.
Inputs
databasestringrequired- The name of the database
ddlstringrequired- The CREATE TABLE DDL statement
cluster_idstring- CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
cockroachdbmcp_insert_rowsInsert rows into an existing table.DestructiveInsert rows
Insert rows into an existing table. Only INSERT statements are allowed, including INSERT INTO ... VALUES and INSERT INTO ... SELECT.
Inputs
databasestringrequired- The name of the database
querystringrequired- The INSERT statement to execute. Include the full table name with optional schema prefix (e.g., 'INSERT INTO schema.table_name ...' or 'INSERT INTO table_name ...').
cluster_idstring- CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
No tools match.