CockroachDB
About
A Model Context Protocol server for managing, monitoring, and querying data in [CockroachDB](https://cockroachlabs.com).
Details
- Author
- amineelkouhen
- Downloads
- 222
- Categories
- Other, Database, AI
Jump to
- Natural language queries and transaction creation
- Cluster health and node status monitoring
- Database operations: create, drop, list, switch
- Table management including indexes, views, and schemas
- SQL query execution with JSON, CSV, or table formatting
- Multi-statement transaction support and query plan analysis
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
CockroachDBCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install and run the server using uvx with a CockroachDB connection URI or individual parameters. Alternatively, use a Docker image or clone the repository for development. Configure via command-line arguments or environment variables (e.g., CRDB_HOST, CRDB_PORT, CRDB_DATABASE). Connect any MCP client (like Claude Desktop) by editing its config file to point to the server.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"cockroachdb": {
"cockroach": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"CRDB_HOST=<cockroachdb_host>",
"-e",
"CRDB_PORT=<cockroachdb_port>",
"-e",
"CRDB_DATABASE=<cockroachdb_database>",
"-e",
"CRDB_USERNAME=<cockroachdb_user>",
"mcp-cockroachdb"
]
}
}
}
}
McpServers
{
"cockroach": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"CRDB_HOST=<cockroachdb_host>",
"-e",
"CRDB_PORT=<cockroachdb_port>",
"-e",
"CRDB_DATABASE=<cockroachdb_database>",
"-e",
"CRDB_USERNAME=<cockroachdb_user>",
"mcp-cockroachdb"
]
}
}
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 - 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 - ContactFeatures
- Natural Language Queries: Enables AI agents to query and create transactions using natural language, supporting complex workflows. - Search & Filtering: Supports efficient data retrieval and searching in CockroachDB. - Cluster Monitoring: Check and monitor the CockroachDB cluster status, including node health and replication. - Database Operations: Perform all operations related to databases, such as creation, deletion, and configuration. - Table Management: Handle tables, indexes, and schemas for flexible data modeling. - Seamless MCP Integration: Works with any MCP client for smooth communication. - Scalable & Lightweight: Designed for high-performance data operations.Tools
The CockroachDB MCP Server Server provides tools to manage the data stored in CockroachDB.
The tools are organized into four main categories:
Cluster Monitoring
Purpose:
Provides tools for monitoring and managing CockroachDB clusters.
Summary:
- Get cluster health and node status.
- Show currently running queries.
- Analyze query performance statistics.
- Retrieve replication and distribution status for tables or the whole database.
Database Operations
Purpose:
Handles database-level operations and connection management.
Summary:
- Connect to a CockroachDB database.
- List, create, drop, and switch databases.
- Get connection status and active sessions.
- Retrieve database settings.
Table Management
Purpose:
Provides tools for managing tables, indexes, views, and schema relationships in CockroachDB.
Summary:
- Create, drop, and describe tables and views.
- Bulk import data into tables.
- Manage indexes (create/drop).
- List tables, views, and table relationships.
- Analyze schema structure and metadata.
Query Engine
Purpose:
Executes and manages SQL queries and transactions.
Summary:
- Execute SQL queries with formatting options (JSON, CSV, table).
- Run multi-statement transactions.
- Explain query plans for optimization.
- Track and retrieve query history.
Installation
The CockroachDB MCP Server supports the stdio transport. Support for the streamable-http transport will be added in a future release.
Quick Start with uvx
The easiest way to use the CockroachDB MCP Server is with uvx, which allows you to run it directly from GitHub (from a branch, or use a tagged release). It is recommended to use a tagged release. The main branch is under active development and may contain breaking changes. As an example, you can execute the following command to run the 0.1.0 release:
uvx --from git+https://github.com/amineelkouhen/mcp-cockroachdb.git@0.1.0 cockroachdb-mcp-server --url postgresql://localhost:26257/defaultdb
Check the release notes for the latest version in the Releases section.
Additional examples are provided below.
```sh
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





