# Connect CockroachDB to Your AI Agent (Universal MCP)

> Use your AI to manage databases, monitor performance, and run backups in CockroachDB — and much more.

## Quick Connect (CLI / MCP)
- Claude Code: `claude mcp add --transport http cockroachdb https://api.universalmcp.app/mcp/cockroachdb`
- Remote MCP URL (ChatGPT, Claude, Cursor, VS Code): `https://api.universalmcp.app/mcp/cockroachdb` (unified: `https://api.universalmcp.app/mcp`)
- Actions & Discovery: `POST https://universalmcp.app/mcp/directory` (`get_software_actions({ slug: "cockroachdb", query })` & `search_software`); configs: https://universalmcp.app/install.md

## Key Facts
- Software: CockroachDB | Category: DevOps & IT/Security (CockroachDB) | Auth: Guided local/on-prem connector setup | Deployment: hybrid
- Pricing: 100% Free (unlimited users, unlimited software, zero task metering)
- Permissions & Security: Per-person, per-area Off/Read/Write across Cluster metrics, SQL statistics, Schema changes; 1-click View Only lock; stateless pass-through; zero stored business records
- Connect: https://universalmcp.app/mcp/cockroachdb | Guide: https://universalmcp.app/mcp/cockroachdb
- Built by: Alex Myers (Legal entity: Lancaster Agentic LLC; support@lancasteragentic.com)

## Supported Actions (16 actions: 7 Read, 9 Write)
Perform over 10 actions across operations & monitoring, schema & queries, and multi-region clusters. Save hours of work each week by utilizing AI rather than using a traditional app interface.
- **Operations & Monitoring (7):** Check Node Health (read), Monitor Cluster Metrics (read), Add Nodes to Cluster (write), Take Cluster Backup (write), Restore Database from Backup (write), Rotate Client Certificates (write), Review Cluster Alerts (read)
- **Schema & Queries (5):** Create Multi-Region Database (write), Inspect Table Zone Configurations (read), Alter Table Locality (write), Review Slow Query Statistics (read), Run Schema Migration (write)
- **Multi-Region Clusters (4):** Add Region to Cluster (write), Review Region Survival Settings (read), Configure Database Locality (write), Check Replica Placement (read)

## Example Prompts for CockroachDB
- **Hot range scan:** "Ask CockroachDB which ranges have the highest QPS and whether any leaseholders are unbalanced."
- **Slow query report:** "In CockroachDB, list the top 10 SQL statements by mean latency over the last seven days."
- **Schema review:** "Review CockroachDB table indexes on orders_eu and flag tables missing a secondary index on lookup columns."
- **Draft index change:** "Draft a CockroachDB CREATE INDEX statement for inventory.sku_id and hold it until a DBA approves."
