drio
Open app

CockroachDB MCP Server

Source

Catalog onlyCatalog onlySTDIO

Overview

CockroachDB MCP Server is a middleware component that connects to a CockroachDB instance, exposing database and table schemas as resources, running SQL queries as tools, and providing prompts for query analysis.

To use the CockroachDB MCP Server, clone the repository, install dependencies, build the project, and run the server with the appropriate database URL and optional auth token.

  • Exposes database and table schemas as resources. - Executes SQL queries with options for execution plan analysis. - Provides access to cluster metadata with authentication.
  1. Querying available databases in a CockroachDB instance.
  2. Retrieving schema information for specific tables.
  3. Running and debugging SQL queries with analysis prompts.

Add to your AI client

Use these steps to connect CockroachDB MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "cockroachdb-mcp-server-dhartunian": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-cockroachdb-mcp-server-dhartunian"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "cockroachdb-mcp-server-dhartunian": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-cockroachdb-mcp-server-dhartunian"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "cockroachdb-mcp-server-dhartunian": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-cockroachdb-mcp-server-dhartunian"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "cockroachdb-mcp-server-dhartunian": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-cockroachdb-mcp-server-dhartunian"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "cockroachdb-mcp-server-dhartunian": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-cockroachdb-mcp-server-dhartunian"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "cockroachdb-mcp-server-dhartunian": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-cockroachdb-mcp-server-dhartunian"
      ]
    }
  }
}

FAQ

What is required to run the CockroachDB MCP Server?

You need to have Node.js installed and a CockroachDB instance accessible.

How do I configure the server?

You need to provide a database URL and optionally an auth token when starting the server.

Can I use this server with other applications?

Yes, it can be integrated with applications like Claude for Desktop and Cline.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":1995,"uuid":"d8ba0c72-9072-47ec-9683-a1efad7f0ae7","name":"cockroachdb-mcp-server","title":"CockroachDB MCP Server","description":"","avatar_url":"https://avatars.githubusercontent.com/u/986307?v=4","created_at":"$D2025-03-05T07:46:40.891Z","updated_at":"$D2025-03-12T10:18:21.412Z","status":"created","author_name":"dhartunian","author_avatar_url":"https://avatars.githubusercontent.com/u/986307?v=4","tags":"cockroachdb,mcp-server,database-connector","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/dhartunian/cockroachdb-mcp-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"\",\"language\":\"TypeScript\",\"is_official\":false,\"latest_commit_time\":\"2025-02-25 16:30:21\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]