CockroachDB MCP Server
by dhartunian
The CockroachDB MCP Server connects to a CockroachDB instance and exposes database and table schemas as resources. It also allows running SQL queries as tools and provides prompts for query analysis.
Last updated: N/A
What is CockroachDB MCP Server?
The CockroachDB MCP Server is a tool that allows you to interact with a CockroachDB instance through a Machine Communication Protocol (MCP) server. It exposes database schemas and cluster metadata as resources and provides a tool for executing SQL queries with options for execution plan analysis.
How to use CockroachDB MCP Server?
To use the server, clone the repository, install dependencies using pnpm install
, and build the project with npx tsc
. Then, run the server using node dist/server.js postgres://user:password@host:port/database [auth_token]
. Configure your Claude for Desktop or Cline applications to connect to the server by adding the server configuration to their respective configuration files.
Key features of CockroachDB MCP Server
Exposes database and table schemas as resources.
Provides access to cluster metadata (requires auth token).
Allows executing SQL queries with execution plan analysis.
Integrates with Claude for Desktop and Cline.
Use cases of CockroachDB MCP Server
Retrieving database and table schema information.
Analyzing SQL query execution plans.
Executing SQL queries against a CockroachDB instance.
Getting information about cluster nodes.
FAQ from CockroachDB MCP Server
What is an auth token used for?
What is an auth token used for?
The auth token is required to access cluster metadata resources, which provide information about the nodes in your CockroachDB cluster. This token is used to authenticate against the CockroachDB admin UI API.
How do I configure the server to work with Claude for Desktop?
How do I configure the server to work with Claude for Desktop?
Open your Claude for Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json
on macOS or %APPDATA%\Claude\claude_desktop_config.json
on Windows) and add your server configuration under the mcpServers
section. Ensure the path to server.js
and the database URL are correct.
What should I do if I encounter connection issues?
What should I do if I encounter connection issues?
Verify your database credentials and ensure that the CockroachDB instance is accessible from your machine. Check the server logs for detailed error messages.
How can I improve the security of my database connection?
How can I improve the security of my database connection?
Consider using a read-only user for the database connection if you only need to query data. This will limit the potential impact of any security vulnerabilities.
What if Claude can't see the server?
What if Claude can't see the server?
Verify that the configuration file is properly formatted and that the path to the server.js file is correct. Restart Claude after making changes to the configuration.