Databases
Basic Auth
CockroachDB REST API
Distributed SQL database with PostgreSQL compatibility
CockroachDB is a cloud-native, distributed SQL database designed for resilience, scale, and consistency. It provides PostgreSQL wire protocol compatibility, making it easy for developers to build applications that require global distribution, automatic failover, and horizontal scalability. CockroachDB's HTTP API enables programmatic database management, cluster monitoring, and administrative operations.
Base URL
https://localhost:8080
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /health | Check the health status of a CockroachDB node |
| GET | /_status/nodes | Retrieve information about all nodes in the cluster |
| GET | /_status/vars | Get Prometheus-compatible metrics from the cluster |
| GET | /_status/databases | List all databases in the cluster |
| GET | /_status/databases/{database} | Get detailed information about a specific database |
| GET | /_status/sessions | Retrieve active SQL sessions across the cluster |
| GET | /_status/ranges/{range_id} | Get detailed information about a specific range |
| POST | /_admin/v1/databases | Create a new database programmatically |
| GET | /_admin/v1/events | Retrieve cluster event log entries |
| GET | /_admin/v1/settings | List all cluster settings and their current values |
| POST | /_admin/v1/settings/{key} | Update a specific cluster setting |
| GET | /_status/allocator/node/{node_id} | Get allocator information for a specific node |
| GET | /_status/certificates/{node_id} | Retrieve certificate information for a node |
| POST | /_admin/v1/drain | Drain a node for graceful shutdown or maintenance |
| GET | /_status/hotranges | Identify hot ranges with high read/write activity |
Code Examples
curl -X GET https://localhost:8080/_status/nodes \
--user 'root:your_password' \
--cacert certs/ca.crt \
-H 'Content-Type: application/json'
Connect CockroachDB to AI
Deploy a CockroachDB MCP server on IOX Cloud and connect it to Claude, ChatGPT, Cursor, or any AI client. Your AI assistant gets direct access to CockroachDB through these tools:
get_cluster_health
Check the overall health status of the CockroachDB cluster and identify any degraded nodes
list_databases
Retrieve all databases in the cluster with size and table information
monitor_cluster_metrics
Fetch Prometheus metrics for CPU, memory, disk usage, and query performance across the cluster
manage_sessions
View active SQL sessions, identify long-running queries, and terminate problematic sessions
analyze_hot_ranges
Identify performance bottlenecks by finding hot ranges with high read/write activity
Deploy in 60 seconds
Describe what you need, AI generates the code, and IOX deploys it globally.
Deploy CockroachDB MCP Server →