CockroachDB
Integrate with CockroachDB, a cloud-native, distributed SQL database.
CockroachDB MCP Server
This MCP server connects to a CockroachDB instance, exposing database and table schemas as resources, running SQL queries as tools, and providing prompts for query analysis.
Features
Resources
postgres://{host}/databases/{database}- Get information about a specific databasepostgres://{host}/databases/{database}/tables/{table}/schema- Get the schema for a specific tablepostgres://{host}/cluster-metadata/{resource}- Get cluster metadata (requires auth token)- Currently supports:
nodes- Information about cluster nodes
- Currently supports:
Tools
query- Execute a SQL query with options for execution plan analysis
Installation
- Clone this repository
- Install dependencies:
pnpm install - Build the project:
npx tsc
Note: You must build the project with
tscbefore using the MCP server locally.
Configuration
The server requires a database URL as a command-line argument and optionally accepts an auth token for accessing admin UI endpoints:
node dist/server.js postgres://user:password@host:port/database [auth_token]
The auth token is required for accessing cluster metadata resources.
Using with Claude for Desktop
-
Open your Claude for Desktop App configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add your server configuration:
{
"mcpServers": {
"cockroachdb": {
"command": "node",
"args": [
"/path/to/cockroachdb-mcp-server/dist/server.js",
"postgres://user:password@host:port/database",
"your_auth_token"
]
}
}
}
- Restart Claude for Desktop
Using with Cline
-
Open your Cline configuration file from the extension settings under "MCP Servers". Select "Configure MCP Servers".
-
Add your server configuration:
{
"mcpServers": {
"crdb": {
"command": "node",
"args": [
"/path/to/cockroachdb-mcp-server/dist/server.js",
"postgres://root@127.0.0.1:26257/testdb",
"your_auth_token"
]
}
}
}
- Restart Cline or start a new session
Example Queries
Here are some example queries you can ask Claude:
- "What databases are available in my CockroachDB instance?"
- "Can you show me the schema for the 'users' table in the 'testdb' database?"
- "Run this query on my database: SELECT * FROM users LIMIT 10"
- "Debug this query and suggest improvements: SELECT * FROM orders WHERE customer_id = 123"
- "Show me information about all nodes in my CockroachDB cluster"
Security Considerations
- Be careful when configuring database access. Consider using a read-only user for the connection if you only need to query data.
- The auth token is used to access the CockroachDB admin UI API. Make sure to keep this token secure.
Troubleshooting
- If you encounter connection issues, verify your database credentials and ensure the CockroachDB instance is accessible from your machine.
- For SQL errors, check the server logs for detailed error messages.
- If Claude can't see the server, verify the configuration file is properly formatted and the path to the server.js file is correct.
- For cluster metadata resources, ensure you've provided a valid auth token and that the admin UI is accessible on port 8080.
Related Servers
CData Sage 300
A read-only MCP server by CData that enables LLMs to query live data from Sage 300.
supOS MCP Server
Provides access to supOS open APIs for querying topic structures, real-time and historical data, and executing SQL queries.
Keboola MCP Server
An MCP server for interacting with the Keboola Connection data platform.
kintone
An MCP server for accessing and managing data on the kintone low-code platform.
Supabase Memory Service
A memory service using Supabase PostgreSQL with pgvector for semantic search and knowledge graph storage.
Chronos
Interact with the Stellar blockchain to manage wallets, list tokens, query balances, and transfer funds.
Supabase
Access and manage your Supabase projects through the Model Context Protocol (MCP).
Tabular MCP Server
An MCP server for local Tabular Models like PowerBI. It allows LLM clients to debug, analyze, and compose DAX queries by connecting to a local Tabular model instance.
MySQL MCP Tools
Provides tools for querying and managing a MySQL database.
Seq MCP Server
Search and stream events from a Seq server.