Analyticbase

io.github.CloudCorpRecordsPublished by GitHub account CloudCorpRecordsv0.1.0Updated Nov 7, 2026

Query ClickHouse over HTTP: list databases and tables, run SELECT.

VerifiedSTDIODesktop onlyDatabasesData & Analytics

Overview

AI-generated overview

Read-only ClickHouse MCP server that lets an assistant list databases and tables and run guarded SELECT queries over ClickHouse's HTTP interface.

What you can do
  • List the databases on a ClickHouse server
  • List the tables in a database with engine, comment, row count and column count, optionally filtered by LIKE patterns
  • Run a single read-only SELECT or WITH query and get the rows back as JSON objects keyed by column name
  • Report connection and database errors as tool errors rather than returning invented rows
When to use it
Useful when an assistant needs to explore or answer questions about data in a ClickHouse instance without any ability to modify it, for example schema discovery or ad-hoc read-only analysis.
Requirements
Runs locally as a stdio process via npx or the Docker image. Needs a reachable ClickHouse HTTP endpoint, configured through CLICKHOUSE_URL or CLICKHOUSE_HOST and CLICKHOUSE_PORT, plus CLICKHOUSE_USER and CLICKHOUSE_PASSWORD. No credentials are declared in the manifest; the server starts and lists tools even without a reachable server.
Before you install
Credentials are sent as URL parameters to the ClickHouse HTTP interface, so use TLS and a least-privilege account. The read-only guard is keyword-based and may refuse legitimate queries containing words like update or drop; it is a filter, not a substitute for database-side permissions. Queries can be expensive on large tables.

Installation

In SourceWeft

  1. Open Analyticbase in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

analyticbase

analyticbase lets an agent — or you, at a terminal — look inside a ClickHouse database and ask it questions, without ever being able to change it. It lists the databases on a server, lists the tables in one database along with each table's engine, comment, row count and column count, and runs single read-only SELECT queries. Everything travels over ClickHouse's plain HTTP interface, so there is no client library bundled and no native port to tunnel.

When ClickHouse is not there, analyticbase says so. The MCP server starts and lists its tools with no server behind it at all; only an actual operation makes a request, and a refused connection or a server error comes back as an error carrying the server's own text — never as invented rows.

Install

bash
npx @reneturcios/analyticbase list-databases

Or run the container image:

bash
docker run -i ghcr.io/cloudcorprecords/analyticbase

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

bash
# Which databases does this server hold?analyticbase list-databases
# What tables live in one database? (name filters are LIKE patterns)analyticbase list-tables analyticsanalyticbase list-tables analytics --like "events_%" --not-like "%_tmp"
# Run one read-only query; rows print as JSONanalyticbase query "SELECT count() AS n FROM analytics.events"
# Start the MCP serveranalyticbase mcp
analyticbase --version

Exit codes: 0 on success, 1 when the query, the guard, or the connection fails (the error says which), 2 for usage errors.

The endpoint is configured through the environment:

VariableMeaningDefault
CLICKHOUSE_URLWhole base URL of the HTTP interface; overrides host and port—
CLICKHOUSE_HOSTHostname, or a full http(s):// URLlocalhost
CLICKHOUSE_PORTHTTP interface port8123
CLICKHOUSE_USERUsernamedefault
CLICKHOUSE_PASSWORDPassword(empty)

How the queries work

Each operation POSTs its SQL to the HTTP interface as the request body, with the credentials as URL parameters — the interface's own convention. The listing operations append FORMAT JSONEachRow and parse one JSON object per line; list_tables reads system.tables and counts each table's columns with a subquery over system.columns, applying the like / not_like filters as LIKE / NOT LIKE clauses with safely escaped literals. Select queries append FORMAT JSON and return the response's data array.

The read-only guard

run_select_query (and the CLI query command) accepts a query only if all of these hold:

  • After leading whitespace and comments are stripped, its first keyword is SELECT or WITH.
  • It is a single statement: a semicolon followed by anything other than whitespace ends the conversation.
  • None of INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE, GRANT, REVOKE, OPTIMIZE, RENAME, DETACH, or ATTACH appears as a whole word outside a string literal. Single-quoted literals are blanked out before scanning, so SELECT 'drop table t' is a fine query; a column literally named update is not — the guard would rather refuse an odd name than be talked around.

The listing operations build their SQL internally from validated, escaped pieces, so they need no guard.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/analyticbase mcp

MCP client configuration:

json
{  "mcpServers": {    "analyticbase": {      "command": "npx",      "args": ["-y", "@reneturcios/analyticbase", "mcp"],      "env": { "CLICKHOUSE_HOST": "localhost", "CLICKHOUSE_PORT": "8123" }    }  }}

Tools

ToolInputWhat it returns
list_databases(none)One object per database, from system.databases.
list_tablesdatabase (string, required), like / not_like (strings, optional)One object per table in that database: its schema (database), name, engine, comment, row count, and column count.
run_select_queryquery (string, required) — one read-only SQL statementThe result rows as a JSON array of objects keyed by column name. Guard violations, a missing server, and database errors all come back as tool errors — never as made-up rows.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no network, no live ClickHousenpm run dev     # run the CLI from source via tsx

All HTTP goes through an injectable fetch function, which is what the test suite drives: config resolution, the guard, SQL construction, both response-format parsers, and all three operations are covered against a fake fetch.

License

MIT — see LICENSE.

Source: README.md at commit 4f03e0f

Tools

3

list_databases

List available ClickHouse databases

Takes no parameters.

list_tables

List available ClickHouse tables in a database, including schema, comment, row count, and column count.

Parameterslikedatabaserequirednot_like

run_select_query

Run a SELECT query in a ClickHouse database

Parametersqueryrequired

Version history

1
  1. v0.1.0LatestOct 31, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts