CockroachDB MCP Server
Overview
The CockroachDB MCP Server is a natural language interface designed for LLMs and agentic applications to manage, monitor, and query data in CockroachDB. It integrates seamlessly with MCP (Model Content Protocol) clients, such as Claude Desktop or Cursor, enabling AI-driven workflows to interact directly with your database.
Table of Contents
- Overview
- Features
- Tools
- Cluster Monitoring
- Database Operations
- Table Management
- Query Engine
- User & Privilege Management
- Vector Search
- Job Management
- Backup & Restore
- Statistics
- Multi-Region
- Changefeeds
- Cluster Admin
- Diagnostics
- Installation
- Quick Start with uvx
- Development Installation
- With Docker
- Configuration
- Configuration via command line arguments
- Configuration via Environment Variables
- Integrations
- OpenAI Agents SDK
- Augment
- Claude Desktop
- VS Code with GitHub Copilot
- Cursor
- Testing
- Contributing
- License
- Quality Badge
- Contact
Features
- Natural-Language Queries: AI agents can query and transact via natural language.
- Cluster Monitoring: Cluster status, node health, replication, slow queries, contention, index recommendations.
- Database Operations: List, create, drop, and switch databases.
- Table Management: Create, drop, alter (add/drop/rename column), truncate, rename, describe; bulk-import; indexes, views, schemas.
- Query Engine: Parameterized SQL with json/csv/table output, multi-statement transactions, explain, history.
- User & Privilege Management: Provision SQL users and roles, grant/revoke privileges. Lets you run the agent under a scoped non-root user.
- Vector Search: Similarity search with cosine/L2/inner-product metrics (auto-detected from index opclass), C-SPANN ANN index management (v25.2+).
- Job Management: Observe and control async jobs (BACKUP, RESTORE, IMPORT, CHANGEFEED, SCHEMA CHANGE).
- Backup & Restore: Full / database / table backup and restore against s3, gs, azure, nodelocal, userfile.
- Statistics: Create and show optimizer statistics.
- Multi-Region: Regions, survival goals, locality (REGIONAL_BY_ROW etc.), zone configuration.
- Changefeeds: CDC pipelines to Kafka / webhook / cloud-storage with sink-scheme validation.
- Cluster Admin: Cluster settings, decommission/drain (gated).
- Diagnostics: Tracing spans, statement-diagnostics bundles.
- Safety First: Strict identifier validation, parameterized values,
--read-onlymode, explicitconfirm=Truefor destructive ops, redacted DSN responses. - Seamless MCP Integration: Works with any MCP client (Claude Desktop, Cursor, VS Code Copilot, OpenAI Agents SDK, etc.).
- Multiple Transports: stdio (default) and streamable HTTP.






