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

@arvoretech/clickhouse-mcp

v1.0.0

Published

ClickHouse MCP Server for read-only database operations

Readme

ClickHouse MCP Server

A Model Context Protocol (MCP) server implementation for ClickHouse that enables read-only database operations through a standardized protocol for integration with LLMs and AI tools.

Why not the official ClickHouse MCP?

The official ClickHouse MCP server requires OAuth re-authentication frequently, which breaks long agent sessions. Complex or heavy queries often hit timeout limits and fail silently. This server connects directly via @clickhouse/client with static credentials, so there's no auth interruption and you get full control over request timeouts.

Features

  • Read-only: Executes only SELECT, SHOW, DESCRIBE, EXPLAIN and WITH (CTE) queries
  • Secure: Validates queries to prevent write operations
  • No OAuth: Direct connection with static credentials — no re-authentication needed
  • Configurable timeout: Handles complex/heavy queries without premature timeouts
  • Fast: Direct ClickHouse connection using @clickhouse/client
  • MCP Protocol: Communication via stdio transport
  • TypeScript: Fully typed with Zod validation
  • Environment Configuration: Easy setup via environment variables

Installation

npm install -g @arvoretech/clickhouse-mcp

Configuration

The server is configured via environment variables:

export CLICKHOUSE_URL=http://localhost:8123
export CLICKHOUSE_USER=default
export CLICKHOUSE_PASSWORD=secret
export CLICKHOUSE_DATABASE=default
export CLICKHOUSE_REQUEST_TIMEOUT=30000

Usage

# Development
pnpm dev

# Production
node dist/index.js

Available MCP Tools

read_query

Executes read-only SQL queries on the ClickHouse database.

Parameters:

  • query (string): SQL SELECT statement

list_tables

Lists all tables in the specified database.

Parameters:

  • database (string, optional): Database name (defaults to configured database)

describe_table

Gets column structure of a specific table including types, keys, and defaults.

Parameters:

  • tableName (string): Name of the table
  • database (string, optional): Database name

list_databases

Lists all available databases on the ClickHouse server.

Parameters: None

Programmatic Usage

import { ClickHouseMCPServer } from "@arvoretech/clickhouse-mcp";

const server = new ClickHouseMCPServer({
  url: "https://your-host:8443",
  username: "default",
  password: "secret",
  database: "default",
  requestTimeout: 30000,
});

server.setupGracefulShutdown();
await server.start();

Claude Desktop Integration

{
  "mcpServers": {
    "clickhouse": {
      "command": "npx",
      "args": ["-y", "@arvoretech/clickhouse-mcp"],
      "env": {
        "CLICKHOUSE_URL": "https://your-host:8443",
        "CLICKHOUSE_USER": "default",
        "CLICKHOUSE_PASSWORD": "secret",
        "CLICKHOUSE_DATABASE": "default"
      }
    }
  }
}

Development

pnpm install
pnpm dev
pnpm build
pnpm test
pnpm lint

Limitations

  • Read-only operations only (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH)
  • ClickHouse only
  • Stdio transport only (no HTTP/WebSocket)