By cockroachdb
Connect Claude Code directly to your CockroachDB clusters for hands-on database work — explore schemas, write optimized SQL, debug queries, and manage distributed database clusters. This plugin provides tools across two active MCP backends (self-hosted MCP Toolbox and managed CockroachDB Cloud MCP Server), three specialized agents (DBA, Developer, Operator), skills across multiple operational domains, and built-in safety hooks.
CockroachDB database administration agent. Use when diagnosing performance issues, reviewing schema designs, analyzing query plans, troubleshooting cluster problems, or planning multi-region deployments. This agent has deep knowledge of CockroachDB distributed SQL internals.
CockroachDB application developer agent. Use when building applications on CockroachDB, configuring ORMs/drivers, implementing transaction retry logic, optimizing queries, designing schemas for distributed SQL, or migrating from PostgreSQL/Oracle. Deep knowledge of JPA/Hibernate, Spring, JDBC, and multi-language driver patterns.
CockroachDB operator and SRE agent. Use when managing cluster operations, monitoring, alerting, incident response, backup/restore, scaling, version upgrades, node maintenance, changefeed management, or troubleshooting performance and availability issues. Based on the official CockroachDB runbook template.
Guides application developers in designing correct and performant transaction patterns for CockroachDB, covering transaction lifetime, implicit vs explicit transactions, retry handling with exponential backoff, pushing invariants into SQL, selective pessimistic locking, set-based operations, connection pooling, prepared statements, keyset pagination, follower reads, and separating business logic from database logic. Use when building applications on CockroachDB, designing transaction workflows, handling retries, optimizing application-layer database interactions, or configuring connection pools.
Guides developers in selecting and implementing multi-region patterns for CockroachDB applications, covering active-passive vs active-active architectures, REGIONAL BY ROW, GLOBAL tables, manual geo-partitioning with lease preferences, and live demo setup with validation queries. Use when designing multi-region database topologies, choosing between REGIONAL BY ROW and manual partitioning, building multi-region demos, or optimizing cross-region latency.
Analyzes CockroachDB range distribution across tables and indexes using SHOW RANGES to identify range count, size patterns, leaseholder placement, and replication health. Use when investigating hotspots, uneven data distribution, range fragmentation, or validating zone configuration effects without DB Console access.
Estimates storage requirements for CockroachDB online schema change backfills using SHOW RANGES WITH DETAILS, KEYS, INDEXES. Use before CREATE INDEX, ADD COLUMN with INDEX/UNIQUE, ALTER PRIMARY KEY, CREATE MATERIALIZED VIEW, CREATE TABLE AS, REFRESH, or SET LOCALITY on tables with large per-index footprints, to avoid mid-backfill disk exhaustion.
Audits optimizer table statistics for staleness, missing coverage, and data quality issues using SHOW STATISTICS. Use when diagnosing poor query performance, unexpected plan changes, or after bulk data changes to identify stale statistics requiring refresh via CREATE STATISTICS.
Admin access level
Server config contains admin-level keywords
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Modifies files
Hook triggers on file write and edit operations
Modifies files
Hook triggers on file write and edit operations
External network access
Connects to servers outside your machine
External network access
Connects to servers outside your machine
Requires secrets
Needs API keys or credentials to function
Requires secrets
Needs API keys or credentials to function
Uses power tools
Uses Bash, Write, or Edit tools
Uses power tools
Uses Bash, Write, or Edit tools
Connect Claude Code directly to your CockroachDB clusters for hands-on database work — explore schemas, write optimized SQL, debug queries, and manage distributed database clusters. This plugin provides tools across two active MCP backends (self-hosted MCP Toolbox and managed CockroachDB Cloud MCP Server), three specialized agents (DBA, Developer, Operator), skills across multiple operational domains, and built-in safety hooks.
Install from the Claude Marketplace, or in Claude Code run:
/install-plugin cockroachdb
claude --plugin-dir /path/to/claude-plugin
This plugin connects to CockroachDB via MCP (Model Context Protocol) using MCP Toolbox for Databases (v1.0.0+):
brew install mcp-toolbox
Set environment variables for your CockroachDB connection:
export COCKROACHDB_HOST="your-cluster-host"
export COCKROACHDB_PORT="26257"
export COCKROACHDB_USER="your-user"
export COCKROACHDB_[REDACTED:Password]
export COCKROACHDB_DATABASE="your-database"
export COCKROACHDB_SSLMODE="verify-full"
For CockroachDB Cloud, find connection details in the Cloud Console.
The plugin ships with the MCP Toolbox (stdio) backend active by default. To use a different backend, replace the contents of .mcp.json:
{
"mcpServers": {
"cockroachdb-toolbox-http": {
"type": "http",
"url": "http://your-toolbox-host:5000/mcp"
}
}
}
Run Toolbox in HTTP mode: toolbox --config tools.yaml --address 0.0.0.0 --port 5000
Run Toolbox with the built-in web UI: toolbox --config tools.yaml --ui --port 5000 (opens at http://127.0.0.1:5000/ui)
Note: Toolbox must successfully connect to CockroachDB on startup. If the database is unreachable (wrong host/port, env vars not set), the server will hang during initialization and the UI will be stuck on "Fetching tools...". Make sure your
COCKROACHDB_*environment variables are set and the database is accessible before starting.
The ccloud CLI is an agent-ready command-line tool for full cluster lifecycle management. AI agents call ccloud directly via shell commands (not MCP protocol) -- every command supports -o json for structured output.
Install: brew install cockroachdb/tap/ccloud
Authenticate (interactive): ccloud auth login (opens browser; supports SSO via OIDC/SAMLv2)
Authenticate (org-scoped): ccloud auth login --org {organization-label}
Authenticate (headless/CI): ccloud auth login --no-redirect or use a service account API key as a bearer token.
Example agent commands:
# Provision
ccloud cluster create serverless my-cluster us-east-1 --cloud AWS -o json
ccloud cluster database create my-cluster myapp -o json
# Connect
ccloud cluster connection-string my-cluster --database myapp --sql-user maxroach -o json
# Composable: pipe into jq + psql
ccloud cluster connection-string my-cluster --database myapp --sql-user maxroach -o json \
| jq -r '.connection_url' | xargs -I{} psql {} -c "SELECT count(*) FROM users"
# Operate
ccloud cluster list -o json
ccloud cluster info my-cluster -o json
ccloud cluster backup config update my-cluster --frequency 60 --retention 60
# Observe
ccloud audit list --limit 10 -o json
ccloud cluster versions -o json
ccloud cluster cmek get my-cluster -o json
# Scale & DR
ccloud replication create --primary-cluster prod-east --standby-cluster dr-west
ccloud cluster networking allowlist list <cluster-id> -o json
# Organize
ccloud folder create Production -o json
ccloud folder contents <folder-id> -o json
# Test resilience
ccloud cluster disruption set my-cluster --region us-east-1 --whole-region
Coverage: Provision, Connect, Operate, Observe, Scale & DR, Organize, Test resilience. See the ccloud reference for full command list.
npx claudepluginhub cockroachdb/claude-plugin --plugin cockroachdbCreate, connect, and interact with a Cloud SQL for PostgreSQL database and data.
Create, connect, and interact with an AlloyDB for PostgreSQL database and data.
Connect and interact with a Cloud SQL for MySQL database and data.
Claude Code skill pack for ClickHouse (24 skills)
Database architecture and SQL optimization with PostgreSQL expertise
Connect and interact with Spanner data using natural language.