CockroachDB MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CockroachDB MCP Servershow me the schema for the users table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Tools
query- Execute a SQL query with options for execution plan analysis
Related MCP server: CockroachDB MCP Server
Installation
Clone this repository
Install dependencies:
pnpm installBuild 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.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
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.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-quality-maintenanceConnects to CockroachDB instances and exposes database structures as resources, enabling SQL query execution and analysis through Claude's interface.4
- AlicenseAqualityDmaintenanceEnables AI assistants to query and interact with CockroachDB clusters through natural language, supporting schema discovery, CRUD operations, transactions, cluster monitoring, and data export with configurable safety controls.30Apache 2.0
- Flicense-qualityDmaintenanceEnables direct interaction with CockroachDB databases in Cursor, allowing users to connect, query tables, execute SQL statements, and manage database connections with automatic reconnection and keep-alive mechanisms.
- Alicense-qualityDmaintenanceA natural language interface for LLMs to manage, monitor, and query CockroachDB. It provides tools for cluster monitoring, database operations, table management, and query execution.MIT
Related MCP Connectors
Connect to PlanetScale databases, branches, schema, query insights, and execute SQL
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Run SOQL queries to explore and retrieve Salesforce data. Access accounts, contacts, opportunities…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcpnexus-registry/cockroachdb-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server