Skip to main content
MCP server CX Codex

CockroachDB — Claude Code MCP server for database operations

Connect an AI agent to CockroachDB to run SQL, inspect cluster health, and manage database objects through MCP.

no license updated 2026-10-29

Open on GitHub

What CockroachDB does

The server accepts requests from an MCP client and reaches CockroachDB through an asyncpg connection pool. It supports stdio and streamable HTTP transports. Its tools cover SQL queries, tables, user roles, backups, changefeeds, cluster monitoring, and vector search.

Python 3.12+ is required. The --read-only mode blocks writes, while destructive operations require --allow-destructive and a per-call confirm=True. A request from the agent alone cannot remove objects. The server also validates identifiers and redacts DSNs in responses.

What it helps with

  • inspect node health and cluster replication
  • run a parameterized SQL query against CockroachDB
  • create a table or change its columns
  • manage SQL users, roles, and privileges
  • search for similar records with vector metrics

Example prompts for the agent

  • Check CockroachDB node health and find slow queries.
  • Run a parameterized SQL query and return the results as CSV.
  • Create an SQL user with limited privileges.

How to install CockroachDB

Install

The MCP registry has no launch command for it: see the repository README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about CockroachDB

How do I install CockroachDB in Claude Code?

Connect the server to Claude Code as an MCP server. Python 3.12+ is required to run it.

What does the CockroachDB MCP server do?

It gives an AI agent tools to query CockroachDB, manage database objects, and monitor cluster health.

How are destructive operations gated?

They require --allow-destructive and confirm=True on the individual call. Use --read-only to block writes.

Similar MCP servers

All MCP servers for Data and databases →

Project sponsors

Companies that keep this analytics open