CockroachDB Plugin for Claude Code

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 MCP backends (self-hosted MCP Toolbox and managed CockroachDB Cloud MCP Server), specialized agents (DBA, Developer, Operator), skills across operational domains, and built-in safety hooks.
Installation
Install from the Claude Marketplace, or in Claude Code run:
/plugin install cockroachdb@claude-plugins-official
To install from this repository's own marketplace instead:
/plugin marketplace add cockroachdb/claude-plugin
/plugin install cockroachdb@cockroachdb-claude-plugin
Local development
claude --plugin-dir /path/to/claude-plugin
Prerequisites
The skills, agents, and hooks work without any setup. Each of the plugin's MCP servers needs its own:
cockroachdb-toolbox (any self-hosted or Cloud cluster) needs MCP Toolbox for Databases v1.0.0 or later on your PATH, and a running CockroachDB cluster it can reach. Toolbox connects when the session starts, so without a reachable cluster this server fails to start. If you don't run a cluster, turn the server off.
cockroachdb-cloud (CockroachDB Cloud) needs a CockroachDB Cloud account. Run /mcp and select the server to sign in.
Install MCP Toolbox
macOS or Linux:
brew install mcp-toolbox
Windows: download toolbox.exe into a folder on your PATH. In PowerShell, set the version to the latest one on the Toolbox releases page, and use windows/arm64 in the URL on Arm devices:
$VERSION = "1.14.0"
curl.exe -o toolbox.exe "https://storage.googleapis.com/mcp-toolbox-for-databases/v$VERSION/windows/amd64/toolbox.exe"
Restart Claude after changing your PATH, then confirm the install with toolbox --version. For other platforms, the container image, and building from source, see Install Toolbox.
Configuration
Self-hosted clusters (MCP Toolbox)
The cockroachdb-toolbox server reads its connection settings from environment variables. Each one is optional, and an unset variable falls back to its default:
| Variable | Default | Notes |
|---|
COCKROACHDB_HOST | localhost | |
COCKROACHDB_PORT | 26257 | |
COCKROACHDB_USER | root | |
COCKROACHDB_PASSWORD | (empty) | |
COCKROACHDB_DATABASE | defaultdb | |
COCKROACHDB_SSLMODE | require | Use disable for a local --insecure cluster, verify-full for production |
Set them in the environment Claude starts from. On macOS or Linux, add them to your shell profile:
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"
On Windows, set them as user environment variables, for example setx COCKROACHDB_HOST "your-cluster-host", then restart Claude.
For a CockroachDB Cloud cluster, find the connection details in the Cloud Console.
Toolbox runs in read-only mode: SELECT, SHOW, and EXPLAIN work, and writes and schema changes are rejected. To allow writes, run Toolbox with your own copy of tools.yaml that sets enableWriteMode: true, configured as your own MCP server, and turn off the plugin's cockroachdb-toolbox server.
CockroachDB Cloud