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.
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 |
Sponsor this page
AvailableReach developers actively building with CockroachDB. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →Code Examples
curl -X GET https://localhost:8080/_status/nodes \
--user 'root:your_password' \
--cacert certs/ca.crt \
-H 'Content-Type: application/json'
Use CockroachDB from Claude / Cursor / ChatGPT
Get a hosted MCP endpoint for CockroachDB. Paste your CockroachDB API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls CockroachDB directly with your credentials — no local install, works on mobile.
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
Connect in 60 seconds
Paste your CockroachDB key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.
Connect CockroachDB to your AI →