C

CockroachDB

Integrates with CockroachDB to provide cluster monitoring, database operations, table management, an...

5 views
0 installs
Updated Dec 20, 2025
Not audited
Integrates with CockroachDB to provide cluster monitoring, database operations, table management, and SQL query execution with transaction support and performance analysis.
  1. Click "Install Now" and open the FastMCP connection interface
    Click the ready-made "Install Now" button; when the FastMCP dialog appears, you will enter the MCP server environment variables into the connection form (FastMCP fields labeled for ENV key / value).

  2. Choose whether to provide a single connection URI or individual env vars

    • Option A (recommended, simpler): provide a full CockroachDB connection URI in the field that maps to the server's --url argument (use the key CRDB_URL or the FastMCP "Connection String" field if available).
      Example URI format: postgresql://:@:/?sslmode=verify-full
    • Option B: provide individual environment variables (use the FastMCP ENV key/value pairs). Proceed with steps 3–8 for the individual values.
  3. Fill CRDB_HOST (hostname / IP)

    • Key: CRDB_HOST
    • Value: the hostname or IP of your CockroachDB SQL endpoint (e.g., db.cluster-example.cockroachlabs.cloud or 127.0.0.1).
    • Enter that value into the FastMCP ENV value field for CRDB_HOST.
  4. Fill CRDB_PORT (SQL port)

    • Key: CRDB_PORT
    • Value: the SQL port (default 26257).
    • Enter that value into FastMCP.
  5. Fill CRDB_DATABASE (database name)

    • Key: CRDB_DATABASE
    • Value: the database name you want the MCP server to use (default defaultdb).
    • Enter that value into FastMCP.
  6. Fill CRDB_USERNAME (SQL user) and CRDB_PWD (password)

    • Key: CRDB_USERNAME — the SQL user (commonly root or a created SQL user).
    • Key: CRDB_PWD — the password for that user.
    • Mark CRDB_PWD as secret/sensitive in FastMCP if the interface supports secret masking. Do not commit this value to public repos.
  7. Configure TLS/SSL options if your CockroachDB requires TLS

    • Key: CRDB_SSL_MODE — one of: disable (default), allow, prefer, require, verify-ca, verify-full. Set according to your cluster requirements (e.g., verify-full for strict TLS).
    • If SSL is required, also provide one or more of the following (as file paths accessible to the MCP runtime, or paste/upload cert contents if FastMCP supports file/certificate fields):
      • CRDB_SSL_CA_PATH — path or uploaded CA root certificate (PEM) used to validate the server certificate.
      • CRDB_SSL_CERTFILE — path or upload of the client certificate (PEM) if mutual TLS is required.
      • CRDB_SSL_KEYFILE — path or upload of the client private key (PEM) if mutual TLS is required.
    • In FastMCP: for file/cert values either upload files (if supported) or paste absolute file paths that the MCP container/host will have access to. If you paste file system paths, ensure the MCP server process can read those paths after provisioning.
  8. Alternative: put SSL params into the connection URI

    • If using Option A (connection URI), you can encode sslmode and certificate paths in the URI query string, e.g.:
      postgresql://user:pass@host:26257/db?sslmode=verify-full&sslrootcert=/path/to/ca.crt&sslcert=/path/to/client.crt&sslkey=/path/to/client.key
    • Paste this entire URI into the CRDB_URL / Connection String field in FastMCP.
  9. How to obtain these values from your CockroachDB provider

    • Managed CockroachDB (Cockroach Cloud): log in to the Cockroach Cloud console → select your cluster → click "Connect" or "JDBC/psql" → copy the connection string and download CA/client certificates or follow the GUI steps to create a SQL user and password.
    • Self-hosted CockroachDB: ask your DBA or check the cluster node configuration for the SQL address and port; create a SQL user (via cockroach sql or SQL console) and set a password; export or generate client certificates if using TLS.
    • If you need a SQL user/password and you have cluster access, create one with SQL (example):
      CREATE USER myuser WITH PASSWORD 'mypassword'; GRANT ALL ON DATABASE defaultdb TO myuser;
    • For TLS certs, follow your CockroachDB cluster docs to generate or download the appropriate PEM files (CA cert, client cert, client key).
  10. Enter each ENV into FastMCP exactly as named

    • Add ENV key/value pairs in FastMCP for: CRDB_HOST, CRDB_PORT, CRDB_DATABASE, CRDB_USERNAME, CRDB_PWD, CRDB_SSL_MODE, CRDB_SSL_CA_PATH, CRDB_SSL_CERTFILE, CRDB_SSL_KEYFILE (as applicable).
    • Or enter CRDB_URL (or the Connection String field) with the full postgresql:// URI if you used Option A.
  11. Save the connection and run a test

    • Click FastMCP's Save / Connect / Test button (use the interface’s "Test connection" if present).
    • Alternatively, start the MCP server from FastMCP; check logs for a successful connection or any TLS/auth errors. Fix values and re-save if tests fail.
  12. Security checklist

    • Mark CRDB_PWD as secret in FastMCP if supported.
    • Store any certificate files on the host or in a secure secrets manager accessible to the MCP runtime—not in version control.
    • If using file paths for certs, ensure the MCP container or host process can read them (correct volume mounts or host paths).
  13. If you prefer to run locally or by CLI later

    • You can mirror the same env vars in a .env file (cp .env.example .env), or export them in your shell before starting the MCP server:
      export CRDB_HOST=...; export CRDB_PWD=...; uv run src/main.py
    • Or use uvx/--url with the same connection URI you entered into FastMCP.
  14. Troubleshoot common errors

    • Authentication error: verify CRDB_USERNAME / CRDB_PWD and privileges.
    • TLS verification error: confirm CRDB_SSL_MODE and that CRDB_SSL_CA_PATH points to the correct CA certificate; for verify-full ensure server hostname matches certificate.
    • Connection refused: confirm CRDB_HOST and CRDB_PORT and that network/firewall rules permit connections from the MCP host.
  15. Once connection is successful

    • The MCP server will use these environment variables to connect to CockroachDB and become available to your MCP client (Claude, Cursor, VS Code, etc.).

Quick Start

View on GitHub

More for Database

View All →

More for Monitoring

View All →

Report Issue

Thank you! Your issue report has been submitted successfully.