CockroachDB Cloud MCP server for AI agents

Live

OAUTH 2.1

DATABASES

Developer Tools

CockroachDB Cloud MCP gives your agent access to your CockroachDB Cloud clusters: list clusters, databases, and tables, read table schemas, run read-only SELECT queries, explain query plans, and create databases, tables, and rows.

  • Per-user credentials: each call uses the actual user's token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
CockroachDB Cloud MCP
agent · Acme Q3
Run
How many rows are in the orders table of the payments database?
S
cockroachdbmcp_select_query
310ms
Database agent
The orders table in payments has 18,204 rows. I ran a SELECT COUNT(*) on your cluster and added no filters.
Sources: CockroachDB Cloud payments cluster, 1 query
cockroachdbmcp
1 query
18:29
Message Claude...

Tools your database agent reaches for on CockroachDB Cloud MCP, scoped per user.

CALL ANY TOOL
12 tools for databases in CockroachDB Cloud MCP: list clusters, databases, and tables, read schemas, run SELECT and SHOW statements, explain plans, watch running queries, and create databases, tables, and rows.
cockroachdbmcp_create_database
Create database
Create a new database in the cluster
Parameters
Name
Type
Required
Description
database
string
Required
The name of the database to create
cluster_id
string
Optional
CockroachDB cluster UUID. Required when the MCP config has no cluster_id; otherwise must be omitted.
cockroachdbmcp_create_table
Create table
cockroachdbmcp_explain_query
Query explain
cockroachdbmcp_get_cluster
Get cluster
cockroachdbmcp_get_table_schema
Get table schema
cockroachdbmcp_insert_rows
Insert rows
cockroachdbmcp_list_clusters
List clusters
cockroachdbmcp_list_databases
List databases
cockroachdbmcp_list_tables
List tables
cockroachdbmcp_select_query
Query select
cockroachdbmcp_show_running_queries
Show running queries
cockroachdbmcp_show_statement
Show statement
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// CockroachDB Cloud tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["cockroachdbmcp"], toolNames: [
    "cockroachdbmcp_list_clusters",
    "cockroachdbmcp_get_table_schema",
    "cockroachdbmcp_select_query"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "List my clusters, show the schema of the orders table, and select the 10 most recent rows" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["cockroachdbmcp"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "List my clusters, show the schema of the orders table, and select the 10 most recent rows" }],
  tools,
});

// Execute the tool call with the user's vaulted CockroachDB Cloud OAuth token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["cockroachdbmcp"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "List my clusters, show the schema of the orders table, and select the 10 most recent rows" }],
  tools,
});

// Tool call runs with the user's vaulted CockroachDB Cloud OAuth token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["cockroachdbmcp"] }, pageSize: 100,
});

const agent = new Agent({
  name: "database_agent",
  model: "gemini-2.5-pro",
  instruction: "CockroachDB Cloud tools scoped to this user",
  tools,
});

await agent.run("List my clusters, show the schema of the orders table, and select the 10 most recent rows");
Try these prompts
Copy any prompt into your agent. Each maps directly to a CockroachDB Cloud MCP tool. Click to copy, paste into your agent, done.
Explore clusters
Copy the prompt
Copied
List the CockroachDB clusters I can access.
Copy the prompt
Copied
Show details for my production cluster.
Copy the prompt
Copied
List the databases in this cluster.
Schemas and queries
Copy the prompt
Copied
List the tables in the payments database.
Copy the prompt
Copied
Show the columns and indexes of the orders table.
Copy the prompt
Copied
Select the 10 most recent rows from orders.
Plans and changes
Copy the prompt
Copied
Explain the execution plan for this query without running it.
Copy the prompt
Copied
Show the queries running on the cluster right now.
Copy the prompt
Copied
Create a database named staging_analytics.
SEE HOW AUTH WORKS
Each user signs in to CockroachDB Cloud once; Scalekit stores and refreshes their tokens. Credentials stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
CockroachDB Cloud MCP
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
CockroachDB Cloud MCP
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
CockroachDB Cloud MCP
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
CockroachDB Cloud MCP
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other database connectors.
Engineering Teams
DevOps assistant agent
Polls GitHub for failing checks and stale PRs, opens Linear issues for the ones that need work, and posts a daily digest to Slack. It acts as the engineer, not a shared service account.
Engineering Teams
Engineering standup agent
Pulls commits from GitHub and GitLab, tracks issue movement in Jira, and posts a per-engineer standup brief to Slack. Each engineer's activity is read on their own delegated OAuth.
Test other agents
See the same per-user auth pattern across other database connectors.
ENGINEERING
DevOps assistant agent
Poll GitHub for failing checks and stale pull requests, open Linear issues for the ones that need work, and digest to Slack.
ENGINEERING
Engineering standup agent
Pull commits from GitHub and GitLab, track Jira issue movement, and post a per-engineer standup brief to Slack.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared CockroachDB Cloud token looks fine in a demo. In production every query and schema change looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
CockroachDB Cloud MCP today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access CockroachDB Cloud as the user or through a shared service account?
As the user. Each user signs in to CockroachDB Cloud once, and Scalekit stores and refreshes their tokens. every query and schema change in your audit trail is attributed to that user, not a shared service account.
Where is the CockroachDB Cloud OAuth token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. Refresh is automatic. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in CockroachDB Cloud?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the read tools such as cockroachdbmcp_select_query and cockroachdbmcp_list_tables without cockroachdbmcp_create_table, cockroachdbmcp_create_database, and cockroachdbmcp_insert_rows. Scalekit also enforces scope checks before every API call.
What happens when a user revokes CockroachDB Cloud access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Can the agent run any SQL statement on my cluster?
No. cockroachdbmcp_select_query runs read-only SELECT queries and adds LIMIT 25 if none is set. cockroachdbmcp_show_statement runs SHOW statements, and cockroachdbmcp_create_table accepts only CREATE TABLE statements. cockroachdbmcp_insert_rows accepts only INSERT statements.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""cockroachdbmcp"": {
""url"": ""https://mcp.scalekit.com/cockroachdbmcp"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.cockroachdbmcp]
url = ""https://mcp.scalekit.com/cockroachdbmcp""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""cockroachdbmcp"": {
""url"": ""https://mcp.scalekit.com/cockroachdbmcp"",
""type"": ""http""
}
}
}