npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@c0pilot/openclaw-clickhouse

v1.0.3

Published

OpenClaw plugin for ClickHouse database integration

Readme

OpenClaw ClickHouse Plugin

Connect your AI agent to ClickHouse databases. List databases, explore tables, run queries, and insert data.

Installation

Option 1: From npm (Recommended)

openclaw plugins install @unsanction/openclaw-clickhouse

Option 2: From GitHub

openclaw plugins install github:unsanction/openclaw-clickhouse

Option 3: Local Development

git clone https://github.com/unsanction/openclaw-clickhouse.git
cd openclaw-clickhouse
npm install
npm run build
openclaw plugins install -l ./openclaw-clickhouse

Configuration

Add to your ~/.openclaw/openclaw.json:

{
  "plugins": {
    "entries": {
      "clickhouse": {
        "enabled": true,
        "config": {
          "host": "localhost",
          "port": 8123,
          "username": "default",
          "password": "",
          "database": "default",
          "secure": false,
          "readonly": true
        }
      }
    }
  }
}

Configuration Options

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | host | string | required | ClickHouse server host | | port | number | 8123 | Server port (8123 HTTP, 8443 HTTPS) | | username | string | "default" | Database username | | password | string | "" | Database password | | database | string | "default" | Default database | | secure | boolean | false | Use HTTPS connection | | readonly | boolean | true | Enable read-only mode | | allowedOperations | string[] | all | Restrict to specific operations | | queryTimeout | number | 30000 | Query timeout in milliseconds |

Allowed Operations

You can restrict which operations are available:

  • "select" - Execute SELECT queries
  • "insert" - Insert data (requires readonly: false)
  • "listDatabases" - List all databases
  • "listTables" - List tables in a database
  • "describeTable" - Get table schema

Example restricting to read-only exploration:

{
  "config": {
    "host": "localhost",
    "readonly": true,
    "allowedOperations": ["listDatabases", "listTables", "describeTable"]
  }
}

Available Tools

clickhouse_list_databases

List all available databases on the server.

Input: None required

Output:

{
  "databases": ["default", "system", "mydb"],
  "count": 3
}

clickhouse_list_tables

List tables in a database with metadata.

Input:

  • database (optional): Database name, defaults to configured database
  • like (optional): LIKE pattern to filter tables (e.g., %logs%)

Output:

{
  "database": "default",
  "tables": [
    {
      "name": "events",
      "engine": "MergeTree",
      "total_rows": "1000000",
      "total_bytes": "52428800"
    }
  ],
  "count": 1
}

clickhouse_describe_table

Get the schema of a table.

Input:

  • table (required): Table name
  • database (optional): Database name

Output:

{
  "database": "default",
  "table": "events",
  "columns": [
    {
      "name": "id",
      "type": "UInt64",
      "is_primary_key": true,
      "is_sorting_key": true
    },
    {
      "name": "event_time",
      "type": "DateTime",
      "is_partition_key": true
    }
  ],
  "column_count": 2
}

clickhouse_run_query

Execute a SQL query. Only SELECT queries are allowed in readonly mode.

Input:

  • query (required): SQL query to execute
  • database (optional): Database context

Output:

{
  "data": [
    {"version()": "24.1.1.1"}
  ],
  "rows": 1,
  "statistics": {
    "elapsed": 0.001,
    "rows_read": 1,
    "bytes_read": 8
  }
}

clickhouse_insert

Insert data into a table. Only available when readonly: false.

Input:

  • table (required): Target table name
  • data (required): Array of objects to insert
  • database (optional): Database name

Output:

{
  "success": true,
  "table": "events",
  "database": "default",
  "rows_inserted": 10
}

Examples

Basic Read-Only Setup

{
  "plugins": {
    "entries": {
      "clickhouse": {
        "enabled": true,
        "config": {
          "host": "localhost",
          "readonly": true
        }
      }
    }
  }
}

Prompt your agent:

  • "List all databases in ClickHouse"
  • "What tables are in the system database?"
  • "Describe the query_log table"
  • "Show me the last 10 queries from system.query_log"

Production with HTTPS

{
  "config": {
    "host": "clickhouse.example.com",
    "port": 8443,
    "username": "analyst",
    "password": "secret",
    "database": "analytics",
    "secure": true,
    "readonly": true,
    "queryTimeout": 60000
  }
}

Write-Enabled for ETL

{
  "config": {
    "host": "localhost",
    "readonly": false,
    "allowedOperations": ["select", "insert", "listTables", "describeTable"]
  }
}

Local Development

# Clone the repository
git clone https://github.com/unsanction/openclaw-clickhouse.git
cd openclaw-clickhouse

# Install dependencies
npm install

# Build
npm run build

# Start ClickHouse for testing
docker run -d -p 8123:8123 -p 9000:9000 clickhouse/clickhouse-server

# Install locally
openclaw plugins install -l .

# Verify
openclaw plugins list

Security Considerations

  1. Use readonly mode in production to prevent accidental data modification
  2. Restrict allowedOperations to only what the agent needs
  3. Use a dedicated read-only user in ClickHouse for additional safety
  4. Set appropriate queryTimeout to prevent long-running queries
  5. Use HTTPS (secure: true) when connecting over networks

License

MIT