Skip to content
GitHub (opens in a new tab)

Databases · Integration guide

How to connect ClickHouse to any AI IDE (Claude/Codex/Cursor/VS Code/Antigravity)

Before you start, install GateRook and connect it to your AI development environment: Claude Desktop, Codex, Cursor, Antigravity or VS Code.

Connect your AI app

Analytics queries with row and time limits. Read only.

The screenshots show GateRook 2.0.0: the ClickHouse form, the endpoint selector, and this connector’s actual tool preview. The form and preview have not been saved. Select a screenshot to open it at full size.

1. Create a connection and enter the settings

In GateRook, open Connections, select Add connection, search for ClickHouse, choose its card and select Continue to configure. GateRook downloads the official ClickHouse connector module when you choose it. Wait for the download and verification to finish before configuring the connection.

Find the ClickHouse HTTP endpoint and prepare a user allowed to read the required databases. The GateRook connector provides read-only query and inspection tools.

Use the HTTP interface rather than the native TCP interface. This connector accepts port 8443 with TLS or 8123 without TLS; unencrypted access is limited to a private address permitted by the environment.

Enter a Name, for example clickhouse-demo. Your AI app uses this name to choose the connection.

Enter Host, Port, User and Password. For ClickHouse Cloud, use the service’s host and TLS HTTP port 8443.

Set Database for unqualified queries and select the allowed Databases. Under TLS and limits, match TLS to the endpoint and review Max rows and Max execution time (s).

Choose Development, Staging or Production to match the service. Review the connector’s limit and access settings before continuing.

GateRook 2.0.0 Configure ClickHouse form before saving.
The ClickHouse configuration form. Enter your own connection settings before testing.

2. Test the connection and add it to an endpoint

Select Continue to test. GateRook checks the settings from your computer. Review the result and resolve any connection, certificate or permission error before continuing.

If the test returns a protocol error, check that you selected the HTTP port rather than 9000 or another native-protocol port. The user still needs access to the databases and system metadata used by the inspection tools.

After the test passes, select Continue to add to an endpoint. Choose the endpoint your AI app uses, review its tool modes, then select Save connection. GateRook offers default as the starter endpoint.

GateRook endpoint selector with default selected; no connector tool list is shown.
Choose the endpoint your AI app uses. This selector is shared across connector types; the next screenshot shows this connector’s own tools.

3. Use the connection from your AI IDE

After saving ClickHouse on the endpoint and passing its connection test, ask your AI app to use clickhouse-demo, or the name you chose. If its tools are missing, confirm the endpoint assignment and refresh the MCP connection or start a new chat.

The preview below shows this connector’s default tools before saving. The table explains what each tool can do; connection settings, credentials and endpoint policies can restrict access further.

ClickHouse connector tool names and default modes in the GateRook 2.0.0 endpoint preview.
ClickHouse tools in the Development endpoint preview. This is an unsaved preview, not a successful service call.

Start with a small read request. Replace example resource names with existing resources your connection may access. Open Activity after the call to inspect its connection, tool, arguments, policy decision and result metadata.

Ask your AI, for example

  • “List the databases available through clickhouse-demo.”
  • “Describe the sorting and partition keys of analytics.events on clickhouse-demo.”
  • “Using clickhouse-demo, explain a query counting events by day without executing it.”
Tools your AI gets
ToolWhat it doesStarts as
clickhouse_queryRuns one read-only query: SELECT, WITH … SELECT, SHOW, DESCRIBE, EXPLAIN or EXISTS. ClickHouse runs it with readonly=1, a row limit and a time limit; table functions that reach other systems (url, s3, remote, file, …) and FORMAT, SETTINGS or INTO OUTFILE clauses are refused.Read only
clickhouse_list_databasesList the databases allowed by this connection and visible to the ClickHouse user, with their engines and table counts.Read only
clickhouse_list_tablesThe tables of one database (the connection's when not given): engine, rows, size on disk and comment, largest first.Read only
clickhouse_describe_tableThe columns of one table with their types, defaults and comments, and its engine, sorting key, partition key and size.Read only
clickhouse_explainHow ClickHouse would run a read-only query, without running it: the plan, the pipeline, an estimate of the rows and marks it reads, or the query as ClickHouse rewrites it.Read only
clickhouse_running_queriesInspect queries currently visible in system.processes, including elapsed time, rows read and memory; query text is limited to 300 characters. This server-wide tool is unavailable when the connection restricts Databases.Read only

You can change each tool’s mode on the endpoint. Every call your AI makes appears in Activity.

Service documentation

Keep exploring

PostgreSQL

Connect PostgreSQL to Claude, Codex, Cursor, VS Code or Antigravity in three steps. Your AI runs read queries; changes wait for your approval.

MySQL

Connect MySQL to Claude, Codex, Cursor, VS Code or Antigravity in three steps. GateRook keeps the password; your AI reads data and asks before changes.

MariaDB

Connect MariaDB to Claude, Codex, Cursor, VS Code or Antigravity in three steps with GateRook’s MySQL connector. Changes wait for your approval.

Browse all integration guides

Your local MCP gateway and firewall.

Connect ClickHouse to your AI IDE.

Choose a connector. Start with read-only access. Approve changes and inspect the audit trail.

Read the getting started guide

Get GateRook

Download GateRook 2.0.0 for your Mac, or get the Windows app from Microsoft Store.

macOS

Version 2.0.0 for Apple Silicon (arm64). This download does not support Intel Macs.

Open the DMG and drag GateRook to Applications.

Windows

Available for free from Microsoft Store. Install GateRook and receive updates through the Store.

macOS release notes and checksums (opens in a new tab)