Labsco
MCP SERVER

CockroachDB

by Swayingleaves

Query a CockroachDB cluster and read its schema from inside Cursor or Claude.

Relational SQL Databases
Summary
A CockroachDB session that survives the conversation.

Schema reads and query execution are the whole job, and the reconnection and keep-alive behaviour is what makes it usable across a long conversation rather than only the first few minutes. Whatever the connected database user can do, the assistant can do.

What it is

A Python MCP server for CockroachDB. It connects over a JDBC URL, lists tables, returns table structure and executes SQL, with automatic reconnection and a keep-alive so a long session does not drop, plus database status resources and SQL query templates.

What you get
  • A connection opened from a JDBC URL, username and password (connect_database), or established as soon as the client attaches (initialize_connection)
  • Every table in the database listed (get_tables)
  • One table's structure returned in full (get_table_schema)
  • SQL executed against the cluster (execute_query)
  • A manual disconnect when you want the connection closed (disconnect_database)
  • Automatic reconnection and a keep-alive, so an idle session does not time out
  • Database status exposed as a resource, plus SQL query templates and detailed logging
Requirements

Python with the repo's requirements and uv, or a one-command install through Smithery. The JDBC URL, username and password go in the client config, and the grants on that database user decide what any query can do.

Setup effort

One command — npx -y @smithery/cli install @Swayingleaves/cockroachdb-mcp-server --client claude