---
title: "CockroachDB MCP Server: review, setup & limitations · Undominated.ai"
canonical: https://undominated.ai/mcp-servers/cockroachdb/
description: "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: review, setup & limitations · Undominated.ai

> 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.

[← Explore all mcp servers](/mcp-servers/)

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.

 [See setup guidance ↓](#setup)[Original source ↗](https://github.com/cockroachdb/cockroachdb-mcp-server)

SOURCE REVIEW

 Reviewed 2026-10-07
 Evidence 3 linked sources
 Publisher Cockroach Labs
 Licence [Apache-2.0 ↗](https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/LICENSE)
 Revision 2f06f189dde8
 [Read what was—and wasn’t—checked ↓](#review)

“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.”

 [Cockroach Labs · upstream description ↗](https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/README.md) Our analysis follows below.

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.

### A good fit for

 - Letting an agent explore databases, tables, schemas and cluster metadata on a distributed SQL cluster without write access.
- Operators who want to grant an agent narrowly-scoped write tools per SQL privilege rather than all-or-nothing.

### Weigh up before choosing

 - Write and DDL tools exist and are enabled together by one environment variable; per-operation control relies on the connecting role's SQL privileges.
- Pre-built release binaries do not cover macOS because a CockroachDB parser dependency needs cgo there; macOS users build from source or use Docker.

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.

[Upstream setup instructions ↗](https://github.com/cockroachdb/cockroachdb-mcp-server)

DOCUMENTED COMMAND

 go install github.com/cockroachdb/cockroachdb-mcp-server@latest Copy command ↗

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"
 }
 }
 }
} Copy configuration ↗

### Compatibility

MCP clients supporting stdio or Streamable HTTP. · A reachable CockroachDB cluster with certificate-based credentials, or an explicitly opted-in password connection.

### Implementation

Go

### Transports

stdio · Streamable HTTP

### CockroachDB SQL credentials

 - Read-only tools are registered by default; write and DDL tools require CRDB_MCP_ENABLE_WRITE_QUERIES=true.
- Password-based database auth is rejected unless CRDB_MCP_ALLOW_PASSWORD_AUTH is set; HTTP mode requires a bearer token and TLS.

### Cost model

Open source under Apache-2.0; CockroachDB cluster or cloud costs apply separately.

04 / FOLLOW THE EVIDENCE

## The source trail.

Our notes are separate from the original resource. Check upstream before adopting a new version.

 - [CockroachDB MCP Server readme at pinned revision ↗](https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/README.md) Checked 2026-10-07 https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/README.md Supports: summary, upstreamDescription, install, configExample, access, transports, whySelected, bestFor, limitations
- [Repository licence at pinned revision ↗](https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/LICENSE) Checked 2026-10-07 https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/LICENSE Supports: license
- [go.mod manifest at pinned revision ↗](https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/go.mod) Checked 2026-10-07 https://github.com/cockroachdb/cockroachdb-mcp-server/blob/2f06f189dde830952f8c5baf1bd09b6e28d17c86/go.mod Supports: language, compatibility

KEEP COMPARING

## Other approaches to consider.

Related by category or shared topics. These are alternatives to inspect, not a measured quality order.

 [### YDB MCP ↗ Python MCP server from the ydb-platform organisation that runs YDB SQL, explains queries, and lists or describes paths, with writes off unless a flag or environment variable turns them on.](/mcp-servers/ydb/)[### YugabyteDB MCP Server ↗ Python MCP server from the Yugabyte organisation that lists schema objects, runs a SELECT inside a read-only transaction, and keeps the write tool off unless an operator flag turns it on.](/mcp-servers/yugabytedb/)[### Aurora DSQL MCP ↗ AWS Labs MCP server that turns questions into Postgres-compatible SQL for Aurora DSQL, read-only unless --allow-writes is passed, and only on the same host as the client.](/mcp-servers/awslabs-aurora-dsql/)

 [AI Tools ↗](/tools/)[Skills ↗](/skills/)[Agents ↗](/agents/)[MCP Servers ↗](/mcp-servers/)[Workflows ↗](/workflows/)

## Continue your investigation

 - [Inspect resource evidence](/tools/)
- [Choose a host](/agents/)
- [Inspect reusable workflows](/skills/)
- [Use Undominated data](/api/)
