Enable AI agents to manage, monitor, and query CockroachDB using natural language. Perform complex database operations, cluster management, and query execution seamlessly through AI-driven workflows. Integrate effortlessly with MCP clients for scalable and high-performance data operations.
593
0
29 Tools
Version 4.43 or later needs to be installed to add the server automatically
Use cases
About
Enable AI agents to manage, monitor, and query CockroachDB using natural language. Perform complex database operations, cluster management, and query execution seamlessly through AI-driven workflows. Integrate effortlessly with MCP clients for scalable and high-performance data operations.
Attribute | Details |
---|---|
Docker Image | mcp/cockroachdb |
Author | amineelkouhen |
Repository | https://github.com/amineelkouhen/mcp-cockroachdb |
Dockerfile | https://github.com/amineelkouhen/mcp-cockroachdb/blob/main/Dockerfile |
Docker Image built by | Docker Inc. |
Docker Scout Health Score | |
Verify Signature | COSIGN_REPOSITORY=mcp/signatures cosign verify mcp/cockroachdb --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub |
Licence | MIT License |
Tools provided by this Server | Short Description |
---|---|
analyze_performance | Analyze query performance statistics for a given query or time range. |
analyze_schema | Analyze the schema and provide a summary of tables, views, and relationships. |
bulk_import | Bulk import data into a table from a file (CSV or Avro) stored in cloud or web storage. |
connect | Connect to the default CockroachDB database and create a connection pool. |
connect_database | Connect to a CockroachDB database and create a connection pool. |
create_database | Enable the creation of new databases. |
create_index | Create a new index on a specified table to improve query performance. |
create_table | Enable the creation of new tables in the current database. |
create_view | Create a view from a specific query. |
describe_table | Provide detailed schema information, column definitions, data types, and other metadata for a specified table. |
drop_database | Drop an existing database. |
drop_index | Drop an existing index. |
drop_table | Facilitate the deletion of existing tables from the database. |
drop_view | Drop an existing view. |
execute_query | Execute a SQL query with optional parameters and formatting. |
execute_transaction | Execute a list of SQL queries as a single transaction. |
explain_query | Return CockroachDB's statement plan for a preparable statement. |
get_active_connections | List active connections/sessions to the current database. |
get_cluster_status | Get cluster health and node distribution. |
get_connection_status | Get the current connection status and details. |
get_database_settings | Retrieve current database or cluster settings. |
get_query_history | Get the history of executed queries. |
get_replication_status | Get replication and distribution status for a table or the whole database. |
get_table_relationships | Get foreign key relationships for a table or all tables. |
list_databases | List all databases in the CockroachDB cluster. |
list_tables | List all tables present in the connected Cockroach database instance. |
list_views | List all views in a schema. |
show_running_queries | Show currently running queries on the cluster. |
switch_database | Switch the connection to a different database. |
analyze_performance
Analyze query performance statistics for a given query or time range.
Parameters | Type | Description |
---|---|---|
query | string | |
time_range | string optional |
analyze_schema
Analyze the schema and provide a summary of tables, views, and relationships.
Parameters | Type | Description |
---|---|---|
db_schema | string optional |
bulk_import
Bulk import data into a table from a file (CSV or Avro) stored in cloud or web storage. Supports S3, Azure Blob, Google Storage, HTTP/HTTPS URLs.
Parameters | Type | Description |
---|---|---|
file_url | string | |
format | string | |
table_name | string | |
delimiter | string optional | |
skip_header | boolean optional |
connect
Connect to the default CockroachDB database and create a connection pool.
Returns: A success message or an error message.
connect_database
Connect to a CockroachDB database and create a connection pool.
Parameters | Type | Description |
---|---|---|
database | string | |
host | string | |
password | string | |
port | integer | |
sslcert | string | |
sslkey | string | |
sslmode | string | |
sslrootcert | string | |
username | string |
create_database
Enable the creation of new databases.
Parameters | Type | Description |
---|---|---|
database_name | string |
create_index
Create a new index on a specified table to improve query performance. This tool allows users to define indexes on one or more columns, enabling faster data retrieval and optimized execution plans for read-heavy workloads.
Parameters | Type | Description |
---|---|---|
columns | array | |
index_name | string | |
table_name | string |
create_table
Enable the creation of new tables in the current database. You can instruct the AI to define table names, columns, and their types, streamlining database setup and schema evolution directly through natural language.
Parameters | Type | Description |
---|---|---|
columns | array | |
table_name | string |
create_view
Create a view from a specific query.
Parameters | Type | Description |
---|---|---|
query | string | |
view_name | string |
describe_table
Provide detailed schema information, column definitions, data types, and other metadata for a specified table. This allows the AI to accurately interpret table structures and formulate precise queries or data manipulation commands.
Parameters | Type | Description |
---|---|---|
table_name | string | |
db_schema | string optional |
drop_database
Drop an existing database.
Parameters | Type | Description |
---|---|---|
database_name | string |
drop_index
Drop an existing index.
Parameters | Type | Description |
---|---|---|
index_name | string |
drop_table
Facilitate the deletion of existing tables from the database. This tool is useful for cleaning up test environments or managing schema changes, always with the necessary confirmations for security.
Parameters | Type | Description |
---|---|---|
table_name | string |
drop_view
Drop an existing view.
Parameters | Type | Description |
---|---|---|
view_name | string |
execute_query
Execute a SQL query with optional parameters and formatting.
Parameters | Type | Description |
---|---|---|
query | string | |
format | string optional | |
limit | string optional | |
params | string optional |
execute_transaction
Execute a list of SQL queries as a single transaction.
Parameters | Type | Description |
---|---|---|
queries | array |
explain_query
Return CockroachDB's statement plan for a preparable statement. You can use this information to optimize the query. If you run it with Analyze, it executes the SQL query and generates a statement plan with execution statistics.
Parameters | Type | Description |
---|---|---|
query | string | |
analyze | boolean optional |
get_active_connections
List active connections/sessions to the current database.
Returns: Active sessions on the cluster.
get_cluster_status
Get cluster health and node distribution.
Parameters | Type | Description |
---|---|---|
detailed | boolean optional |
get_connection_status
Get the current connection status and details.
Returns: The connection status or an error message.
get_database_settings
Retrieve current database or cluster settings.
Returns: All cluster settings.
get_query_history
Get the history of executed queries.
Parameters | Type | Description |
---|---|---|
limit | integer optional |
get_replication_status
Get replication and distribution status for a table or the whole database.
Parameters | Type | Description |
---|---|---|
table_name | string |
get_table_relationships
Get foreign key relationships for a table or all tables.
Parameters | Type | Description |
---|---|---|
table_name | string optional |
list_databases
List all databases in the CockroachDB cluster.
Returns: A list of databases with row count or an error message.
list_tables
List all tables present in the connected Cockroach database instance. This is invaluable for AI to understand the database’s landscape and identify relevant data sources for a given query.
Parameters | Type | Description |
---|---|---|
db_schema | string optional |
list_views
List all views in a schema.
Parameters | Type | Description |
---|---|---|
db_schema | string optional |
show_running_queries
Show currently running queries on the cluster.
Parameters | Type | Description |
---|---|---|
min_duration | string optional | |
node_id | integer optional | |
user | string optional |
switch_database
Switch the connection to a different database.
Parameters | Type | Description |
---|---|---|
database | string |
{
"mcpServers": {
"cockroachdb": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"CRDB_HOST",
"-e",
"CRDB_PORT",
"-e",
"CRDB_DATABASE",
"-e",
"CRDB_USERNAME",
"-e",
"CRDB_SSL_MODE",
"-e",
"CRDB_SSL_CA_PATH",
"-e",
"CRDB_SSL_KEYFILE",
"-e",
"CRDB_SSL_CERTFILE",
"-e",
"CRDB_PWD",
"mcp/cockroachdb"
],
"env": {
"CRDB_HOST": "127.0.0.1",
"CRDB_PORT": "26257",
"CRDB_DATABASE": "defaultdb",
"CRDB_USERNAME": "root",
"CRDB_SSL_MODE": "disable",
"CRDB_SSL_CA_PATH": "",
"CRDB_SSL_KEYFILE": "",
"CRDB_SSL_CERTFILE": "",
"CRDB_PWD": ""
}
}
}
}
Manual installation
You can install the MCP server using:
Installation for