Skip to content

Connect OpenClaw to ClickHouse

Let an OpenClaw agent explore schemas and run SQL against your ClickHouse databases, with no credentials handed to the agent.

Tags:integrations

ClickHouse is the column-oriented database built for analytics at scale: event streams, product metrics, logs and billion-row tables that still need sub-second answers. Teams run it self-hosted or through ClickHouse Cloud. The queries are fast; the slow part is the human loop around them. Someone has to remember which table holds the events, write the SQL, check the schema after a column was renamed, and paste the result into a doc.

With Claworc’s External Connections, an OpenClaw agent can query your ClickHouse databases on your behalf. You enter the connection details once, Composio stores the credentials, and the agent gets an auto-generated claworc-clickhouse skill that tells it which ClickHouse tools exist and how to call them. The agent never sees a username, a password or a connection string.

Composio’s ClickHouse toolkit is small and focused, with six actions. Here is what each one does:

  • List databases — enumerate the databases the connected user can see, a natural first step on an unfamiliar server.
  • List tables — see the tables in a database so the agent picks the right source before writing any SQL.
  • Read a database schema — pull a database’s full schema in one call, which is what the agent needs to write correct joins.
  • Inspect a table — check one table’s columns and types, useful for confirming a column name before running a heavy query.
  • Run SQL — execute a query and return the result set. This is the capability behind almost every request you will make.
  • Open the Play UI — reach ClickHouse’s built-in query interface for the times you want to run a query yourself.

Every tool is called through a small broker running next to the agent, so the agent only needs to describe what it wants done in plain language and let the skill handle the rest.

“How many distinct users hit the checkout event last week, by country?” The agent inspects the events table’s schema to confirm the column names, writes the query, runs it and returns a table. You get the answer without opening a SQL client or asking the one person who knows the schema.

Have the agent run the same handful of queries every morning and post the results, with day-over-day deltas, to your team channel. Because the SQL lives in the agent’s instructions rather than in a dashboard nobody maintains, changing a metric definition is a one-line edit.

Before a migration, ask the agent to capture the current database schema. After the change, it captures it again and reports added, removed and retyped columns, so nothing surprising reaches production.

Connecting ClickHouse takes three steps: an admin adds a Composio API key to Claworc’s settings, you open the instance’s Settings tab, click + Add connection, pick ClickHouse and sign in with your host, username and password. The claworc-clickhouse skill appears in the instance a moment later. The full walkthrough, including the exact Composio permissions the key needs, is in the External Connections documentation.