CockroachDB MCP Server

CockroachDB MCP Server

cockroachdb-mcp-server-swayingleaves•byswayingleaves

An MCP server that lets clients such as Cursor connect to and interact directly with a CockroachDB database.

License: Not specified•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Connects to a CockroachDB database using a JDBC URL, username, and password, and supports manual disconnection.
  • •Lists all tables and retrieves the structure of a specified table.
  • •Executes SQL queries.
  • •Provides a database status resource and a SQL query template prompt.

BEST FOR

  • •Querying and inspecting a CockroachDB database from an MCP-capable client like Cursor.
  • •Exploring schema details such as table structure while working with CockroachDB.

ABOUT COCKROACHDB-MCP-SERVER-SWAYINGLEAVES

CockroachDB MCP Server is cataloged as an MCP server attributed to swayingleaves. An MCP server that lets clients such as Cursor connect to and interact directly with a CockroachDB database. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for CockroachDB MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does the server handle special characters in database credentials?

It connects using psycopg2 directly, which automatically handles special characters in usernames and passwords without additional URL encoding.

Upstream README

View this exact version on GitHub

README.md · dd3834d70674 · Fetched 2026-11-13 11:46:44 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

CockroachDB MCP Server

smithery badge English | 简体中文

This is a CockroachDB MCP server for Cursor, implemented based on the Model Context Protocol (MCP) specification, allowing you to interact directly with CockroachDB database in Cursor.

Features

  • Connect to CockroachDB database
  • Get all tables from the database
  • Get table structure information
  • Execute SQL queries
  • Provide database status resources
  • Provide SQL query templates
  • Automatic reconnection mechanism to ensure connection stability
  • Connection keep-alive mechanism to prevent connection timeout
  • Graceful process exit handling
  • Detailed logging for troubleshooting
  • Support manual disconnection

Installation

Installing via Smithery

To install CockroachDB MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @Swayingleaves/cockroachdb-mcp-server --client claude
  1. Clone the repository and enter the project directory
  2. Install dependencies:
pip install -r requirements.txt
  1. Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

Using in Cursor

{
    "mcpServers": {
        "cockroachdb-mcp": {
            "command": "uv",
            "args": [
                "--directory",
                "/Users/local/cockroachdb-mcp",
                "run",
                "server.py"
            ],
            "jdbc_url": "jdbc:postgresql://localhost:26257/defaultdb",
            "username": "root",
            "password": "root"
        }
    }
  }

MCP Function Description

Tools

connect_database

Connect to CockroachDB database.

Parameters:

  • jdbc_url: JDBC connection URL (e.g., jdbc:postgresql://localhost:26257/defaultdb)
  • username: Database username
  • password: Database password

initialize_connection

Initialize database connection, can be called immediately after connecting to the MCP server to establish a database connection.

Parameters:

  • jdbc_url: JDBC connection URL (e.g., jdbc:postgresql://localhost:26257/defaultdb)
  • username: Database username
  • password: Database password

disconnect_database

Manually disconnect from the database.

No parameters.

get_tables

Get all tables from the database.

No parameters.

get_table_schema

Get structure information of a specified table.

Parameters:

  • table_name: Table name

execute_query

Execute SQL query.

Parameters:

  • query: SQL query statement

Resources

db://status

Get database connection status.

Returns:

  • When not connected: "Not connected"
  • When connected: "Connected - [Database version]"
  • When connection error: "Connection error - [Error message]"

Prompts

sql_query_template

SQL query template to help users write SQL queries.

Logs

Server logs are saved in logs/cockroachdb_mcp.log file. You can check this file to understand the server's running status and detailed logs.

The log file uses a rotating log mechanism, with each log file maximum size of 10MB and keeping up to 5 backup files to prevent excessive disk space usage.

Special Character Handling

This server uses psycopg2 to connect directly to CockroachDB database, which automatically handles special characters in usernames and passwords without additional URL encoding. This ensures correct database connection even when passwords contain special characters (such as @, %, &, etc.).

TCP Keep-alive Settings

The server is configured with TCP keep-alive mechanism by default to prevent connections from being closed due to long periods of inactivity:

  • keepalives=1: Enable TCP keepalive
  • keepalives_idle=30: Send keepalive after 30 seconds of idle time
  • keepalives_interval=10: Send keepalive every 10 seconds
  • keepalives_count=5: Give up after 5 attempts

Troubleshooting

If you encounter problems, please check the log file logs/cockroachdb_mcp.log, which will help you understand the server's running status and potential issues.

Common Issues

  1. Connection Refused: Ensure the CockroachDB server is running and accessible from your machine.
  2. Authentication Failed: Check if the username and password are correct.
  3. Connection Timeout: Check if the network connection is stable, especially when connecting to a remote database.
  4. Database Server Issues: Check if the CockroachDB server is running properly.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for CockroachDB MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/cockroachdb-mcp-server-swayingleaves)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage