# CockroachDB

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

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: amineelkouhen
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/amineelkouhen/mcp-cockroachdb
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/cockroachdb

## What it 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.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

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

## When to use it
- 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
- 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.

## Similar
- [cockroachdb-expert](https://affpapa.org/en/nevibecode/agents/cockroachdb-expert.md) — subagent · ★ 1029 repo stars
- [prisma-driver-adapter-implementation](https://affpapa.org/en/nevibecode/skills/prisma-driver-adapter-implementation.md) — skill · 425600 installs
- [Neon](https://affpapa.org/en/nevibecode/mcp/neon-neon.md) — MCP server · 1350 installs
- [clickhouse-js-node-coding](https://affpapa.org/en/nevibecode/skills/clickhouse-js-node-coding.md) — skill · 7300 installs
- [postgres-patterns](https://affpapa.org/en/nevibecode/skills/postgres-patterns.md) — skill · 7200 installs
- [mysql-patterns](https://affpapa.org/en/nevibecode/skills/mysql-patterns.md) — skill · 6400 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
