DATABASE DEVELOPMENT / Cockroach Labs
CockroachDB MCP Server
Typed CockroachDB tools written in Go, registering read-only tools by default with write and DDL tools behind an explicit environment variable. Supports stdio and HTTP modes, cert-based authentication and a least-privilege SQL role recipe.
“CockroachDB MCP Server is a Model Context Protocol server that exposes CockroachDB to AI agents as a set of typed tools. Ships read tools by default; write and DDL tools opt in via env var.”
01 / THE REASONING
Why this made the selection.
- Cockroach Labs publishes the server in its own organisation with read-only tools registered by default, which is the safest default of the SQL servers screened this wave.
- The security model is layered: password auth is rejected unless opted in, TLS modes below verify are refused at startup, and HTTP mode requires a bearer token with TLS by default.
02 / THE REVIEW RECORD
What we actually inspected.
Source review has boundaries.
A clear record is more useful than a “safe” badge.
Material inspected
- README.md at pinned revision 2f06f189dde830952f8c5baf1bd09b6e28d17c86: install paths (go install, release tarballs, distroless nonroot Docker image), stdio and HTTP client configuration, authentication and TLS rules, default read-only tool table and CRDB_MCP_ENABLE_WRITE_QUERIES opt-in.
- go.mod at the same revision: module github.com/cockroachdb/cockroachdb-mcp-server, Go 1.26, cockroachdb-parser and pgx v5 dependencies.
- LICENSE at the same revision: Apache License 2.0.
- Repository root at the same revision: main.go entrypoint plus auth, config, db, middleware and otel packages.
Our findings
- Default registered tools are read-only: list_databases, list_tables, get_table_schema, get_cluster, list_sql_users and list_cluster_nodes.
- HTTP mode enforces a bearer token (CRDB_MCP_BEARER_TOKEN) with TLS by default; cleartext HTTP and TLS-optional database modes each require a separate opt-in variable.
Not established by this review
- The server was not built or connected to a cluster; tool execution was not tested.
The review applies to the material and revision named here. A newer upstream release can change its behavior.
03 / PUT IT TO WORK
Connect a server deliberately.
DOCUMENTED COMMAND
go install github.com/cockroachdb/cockroachdb-mcp-server@latest Copying does not execute this command. It may retrieve a newer version than the reviewed source.
- Install the binary with Go 1.26+, from release tarballs, or via the published Docker image.
- Configure the client with cert-based connection variables or a full CRDB_DATABASE_URL with sslmode verify-full.
- Grant the connecting SQL role only the privileges the registered tools need before enabling write tools.
Before you start
- Go 1.26+ or a release binary for linux or windows.
- A reachable CockroachDB cluster with client certificates.
Documented configuration example
Use the client and authentication context described in the setup guidance. Configuration formats vary between hosts.
{
"mcpServers": {
"cockroachdb": {
"command": "cockroachdb-mcp-server",
"env": {
"CRDB_HOST": "YOUR_CRDB_HOST",
"CRDB_USERNAME": "YOUR_CRDB_USERNAME",
"CRDB_SSL_MODE": "verify-full",
"CRDB_SSL_CA_PATH": "/certs/ca.crt",
"CRDB_SSL_CERTFILE": "/certs/client.crt",
"CRDB_SSL_KEYFILE": "/certs/client.key"
}
}
}
} 04 / FOLLOW THE EVIDENCE
The source trail.
Our notes are separate from the original resource.
Check upstream before adopting a new version.
https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/README.md
Supports: summary, upstreamDescription, install, configExample, access, transports, whySelected, bestFor, limitations
https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/LICENSE
Supports: license
https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/go.mod
Supports: language, compatibility