Skip to main content
Glama
alyiox

mcp-clickhousex

MCP ClickHouse Tool

CI PyPI Python 3.13+ License: MIT

Ein schreibgeschützter Model Context Protocol (MCP) Server für ClickHouse, der Metadaten-Erkennung, Ressourcen, parametrisierte SELECT-Abfragen, SHOW-Introspektion, Abfrageanalyse und Snapshot-Modus für große Ergebnismengen unterstützt, mit profilbasierter Konfiguration und strikter Durchsetzung von No-DML/DDL.

Anforderungen: Python 3.13+, eine laufende ClickHouse-Instanz und Verbindungsdetails über Umgebungsvariablen oder eine Konfigurationsdatei.

Schnellstart

Legen Sie eine DSN fest und starten Sie den Server mit MCP Inspector:

# Option 1: Run directly with uvx (no clone needed)
export MCP_CLICKHOUSE_DSN="http://default:@localhost:8123/default"
npx -y @modelcontextprotocol/inspector uvx mcp-clickhousex
# Option 2: Run from source (clone repo, then)
export MCP_CLICKHOUSE_DSN="http://default:@localhost:8123/default"
npx -y @modelcontextprotocol/inspector uv run main.py

Related MCP server: io.github.Aguantar/clickhouse-dataops-mcp

Konfiguration

Alle Einstellungen verwenden das Präfix MCP_CLICKHOUSE. Flache Umgebungsvariablen (z. B. MCP_CLICKHOUSE_DSN) sind der unkomplizierte Weg, das Standard-Profil zu konfigurieren, wenn Sie eine einzelne Verbindung haben. Für mehrere Profile wird die benutzerspezifische Datei config.json empfohlen.

Einzelne Verbindung: Konfigurieren Sie über Umgebungsvariablen.

# Connection DSN (required).
export MCP_CLICKHOUSE_DSN="http://user:password@host:8123/database"

# Optional description for the default profile (tooling/AI discovery).
export MCP_CLICKHOUSE_DESCRIPTION="Primary cluster"

# Optional max rows per interactive query (default 500; hard ceiling 1000).
export MCP_CLICKHOUSE_QUERY_MAX_ROWS="500"

# Optional interactive query timeout in seconds (default 30; hard ceiling 300).
export MCP_CLICKHOUSE_QUERY_COMMAND_TIMEOUT_SECONDS="30"

# Optional max rows for snapshot queries (default 10000; hard ceiling 50000).
export MCP_CLICKHOUSE_SNAPSHOT_MAX_ROWS="10000"

# Optional snapshot query timeout in seconds (default 120; hard ceiling 300).
export MCP_CLICKHOUSE_SNAPSHOT_COMMAND_TIMEOUT_SECONDS="120"

Mehrere Verbindungen: Verwenden Sie die benutzerspezifische Datei config.json (empfohlen). Umgebungsvariablen funktionieren auch über das Präfix MCP_CLICKHOUSE_PROFILES_<NAME>_ (z. B. MCP_CLICKHOUSE_PROFILES_WAREHOUSE_DSN).

  • Unix-like: ~/.config/mcp-clickhousex/config.json

  • Windows: %USERPROFILE%\.config\mcp-clickhousex\config.json

Beispiel (config.json):

{
  "profiles": {
    "default": {
      "dsn": "http://default:@localhost:8123/default",
      "description": "Primary",
      "query_max_rows": 500,
      "query_command_timeout_seconds": 60,
      "snapshot_max_rows": 10000,
      "snapshot_command_timeout_seconds": 120
    },
    "warehouse": {
      "dsn": "http://user:pass@warehouse:8123/analytics",
      "description": "Warehouse"
    }
  }
}

Sonderzeichen in Anmeldedaten: Wenn der Benutzername oder das Passwort URL-reservierte Zeichen enthält, kodieren Sie diese in der DSN prozentual:

Zeichen

Kodierung

#

%23

?

%3F

/

%2F

@

%40

%

%25

Zum Beispiel werden Benutzername admin@org und Passwort p#ss? zu admin%40org:p%23ss%3F in der DSN: http://admin%40org:p%23ss%3F@host:8123/database.

Werkzeuge

Die Tool-Beschreibungen entsprechen den Docstrings der Tools in server.py, außer dass das Präfix [ClickHouse] hier weggelassen wird (es bleibt in den MCP-exponierten Metadaten erhalten). Der Parametertext entspricht jedem Field(description=…) desselben Tools.

Werkzeug

Beschreibung

Wichtige Parameter

list_profiles

Listet konfigurierte Profile auf. Jeder Eintrag enthält Name und optionale Beschreibung.

get_cluster_properties

Ruft Clustereigenschaften und Ausführungslimits ab. Gibt die ClickHouse-Serverversion sowie die erzwungenen Limits (max. Zeilen, Timeouts) für das Profil zurück.

profile — Profilname; verwendet Standardprofil, wenn nicht angegeben. Quelle: profiles.

run_query

Führt schreibgeschütztes SELECT oder WITH … SELECT aus. Eine Anweisung; DML, DDL, SET, SYSTEM und ähnliches werden abgelehnt. Gibt {data, row_count} zurück, wobei data ein RFC 4180 CSV-String ist. Übergeben Sie snapshot=true, um das Ergebnis auf der Festplatte zu speichern und stattdessen {snapshot_uri, row_count} zu erhalten; rufen Sie die CSV über die Snapshot-Ressourcen-URI ab. Max-Zeilen-Limit; bei Überlauf werden truncated und row_limit gesetzt. Gleiche SQL-Validierung wie analyze_query.

sql (erforderlich) — Schreibgeschütztes SELECT oder WITH … SELECT. Eine Anweisung; verwenden Sie qualifizierte db.table oder Datenbank. Treiber-Platzhaltersyntax für Parameter. parameters — Benannte Parameter für Treiber-Platzhalter (z. B. %(name)s oder {name:Type}). database — Standarddatenbank der Sitzung für nicht qualifizierte Namen. Quelle: databases. profile — Profilname; verwendet Standardprofil, wenn nicht angegeben. Quelle: profiles. snapshot — Wenn true, wird das vollständige Ergebnis als CSV-Datei gespeichert und eine Ressourcen-URI (chx://snapshots/{id}) anstelle von Inline-Daten zurückgegeben. Verwenden Sie dies für Abfragen, die das interaktive Zeilenlimit (1 000) überschreiten könnten. Snapshot-Limits gelten (Standard 10 000 Zeilen, harte Obergrenze 50 000). Einträge verfallen nach 7 Tagen.

run_show

Führt eine SHOW-Introspektionsanweisung aus. Eine Anweisung pro Aufruf; INTO OUTFILE wird abgelehnt. Interaktive Zeilenlimits gelten (Standard 500, harte Obergrenze 1 000). Gleiches Timeout wie run_query.

sql (erforderlich) — Einzelne SHOW-Anweisung (z. B. SHOW DATABASES, SHOW CREATE TABLE). Kein INTO OUTFILE. parameters — Benannte Parameter für Treiber-Platzhalter (z. B. %(name)s oder {name:Type}). database — Standarddatenbank der Sitzung für nicht qualifizierte Namen. Quelle: databases. profile — Profilname; verwendet Standardprofil, wenn nicht angegeben. Quelle: profiles.

analyze_query

Führt EXPLAIN für schreibgeschütztes SELECT oder WITH … SELECT aus. Gibt Plan-, Pipeline- und/oder Syntaxtext zurück. Standardtypen: Plan und Pipeline. Verwendet Abfrage-Timeout und optionale Datenbank; keine Max-Zeilen-Obergrenze im Gegensatz zu run_query.

sql (erforderlich) — Schreibgeschütztes SELECT oder WITH … SELECT für EXPLAIN. Eine Anweisung; gleiche Validierung wie run_query. parameters — Benannte Parameter für Treiber-Platzhalter (z. B. %(name)s oder {name:Type}). database — Standarddatenbank der Sitzung für nicht qualifizierte Namen. Quelle: databases. profile — Profilname; verwendet Standardprofil, wenn nicht angegeben. Quelle: profiles. types — EXPLAIN-Varianten: plan (Indizes), pipeline, syntax. Standard: plan und pipeline, wenn nicht angegeben.

list_databases

Listet Datenbanken auf. Zeilen aus system.databases, die für die Verbindung sichtbar sind.

profile — Profilname; verwendet Standardprofil, wenn nicht angegeben. Quelle: profiles.

list_tables

Listet Tabellen und Ansichten in einer Datenbank auf. Zeilen aus system.tables: name, engine, primary_key, sorting_key, partition_key, total_rows, total_bytes für die Abfrageplanung.

database — Aufzulistende Datenbank; Client-Standard, wenn nicht angegeben. Quelle: databases. profile — Profilname; verwendet Standardprofil, wenn nicht angegeben. Quelle: profiles.

list_columns

Listet Spalten für eine Tabelle oder Ansicht auf. Zeilen aus system.columns für die aufgelöste Datenbank und Tabelle.

table (erforderlich) — Tabellen- oder Ansichtsname oder database.table. Quelle: tables. database — Datenbank, wenn die Tabelle nicht qualifiziert ist; wird ignoriert, wenn die Tabelle einen Punkt enthält. Client-Standard, wenn nicht angegeben. Quelle: databases. profile — Profilname; verwendet Standardprofil, wenn nicht angegeben. Quelle: profiles.

Ressourcen

Der Server stellt dieselben Discovery- und Metadaten wie die obigen Tools über URI-adressierbare Ressourcen bereit (profil-zuerst-Hierarchie). Die description jeder Ressource entspricht dem jeweiligen Tool (list_profiles, get_cluster_properties, list_databases, list_tables, list_columns), plus Src:-Tags für URI-Pfadparameter. Alle Ressourceninhalte sind JSON (application/json), außer Snapshots, die CSV (text/csv) zurückgeben. Verwenden Sie das Pfadsegment default für das Standardprofil oder die Standarddatenbank.

Die Ressourcenbeschreibungen entsprechen description=… auf @mcp.resource in server.py (gleiche Präfix-Auslassung wie oben).

URI

Beschreibung

chx://profiles

Listet konfigurierte Profile auf. Jeder Eintrag enthält Name und optionale Beschreibung.

chx://profiles/{profile}/cluster-properties

Cluster-Eigenschaften und Ausführungslimits abrufen. Gibt die ClickHouse-Serverversion sowie erzwungene Limits (max. Zeilen, Timeouts) für das Profil zurück. Src: profiles.

chx://profiles/{profile}/databases

Datenbanken auflisten. Zeilen aus system.databases, die für die Verbindung sichtbar sind. Src: profiles.

chx://profiles/{profile}/databases/{database}/tables

Tabellen und Ansichten in einer Datenbank auflisten. Zeilen aus system.tables: name, engine, primary_key, sorting_key, partition_key, total_rows, total_bytes für die Abfrageplanung. Src: profiles, dbs.

chx://profiles/{profile}/databases/{database}/tables/{table}/columns

Spalten für eine Tabelle oder Ansicht auflisten. Zeilen aus system.columns für die aufgelöste Datenbank und Tabelle. Src: profiles, dbs, tables.

chx://snapshots/{id}

Ein Abfrageergebnis-Snapshot per ID abrufen. Gibt das vollständige Ergebnis als CSV-String zurück (Kopfzeile + Datenzeilen). Einträge verfallen nach 7 Tagen. Src: run_query with snapshot=true.

Sicherheit

Nur lesender SQL-Zugriff: run_query erlaubt SELECT / WITH … SELECT; run_show erlaubt eine einzelne SHOW-Anweisung pro Aufruf. INTO OUTFILE ist bei run_show nicht erlaubt. Interaktive Abfragen erzwingen eine enge Zeilenbegrenzung (Standard 500, harte Obergrenze 1 000); für größere Exporte verwenden Sie snapshot=true (Standard 10 000, harte Obergrenze 50 000). Parametrisierte Abfragen werden unterstützt, wo der Treiber es erlaubt (%(name)s- oder {name:Type}-Syntax). Verwenden Sie Umgebungsvariablen für Verbindungsdaten – committen Sie niemals Geheimnisse.

MCP-Host-Beispiele

Codeausschnitte für gängige MCP-Clients mit uvx mcp-clickhousex (kein Klonen erforderlich; stellen Sie sicher, dass uv in Ihrem PATH ist). Ersetzen Sie die Verbindungsdetails nach Bedarf.

Cursor

{
  "mcpServers": {
    "clickhouse": {
      "command": "uvx",
      "args": ["mcp-clickhousex"],
      "env": {
        "MCP_CLICKHOUSE_DSN": "http://default:@localhost:8123/default"
      }
    }
  }
}

Codex

[mcp_servers.clickhouse]
command = "uvx"
args = ["mcp-clickhousex"]

[mcp_servers.clickhouse.env]
MCP_CLICKHOUSE_DSN = "http://default:@localhost:8123/default"

OpenCode

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "clickhouse": {
      "type": "local",
      "enabled": true,
      "command": ["uvx", "mcp-clickhousex"],
      "environment": {
        "MCP_CLICKHOUSE_DSN": "http://default:@localhost:8123/default"
      }
    }
  }
}

Claude Code

{
  "mcpServers": {
    "clickhouse": {
      "command": "uvx",
      "args": ["mcp-clickhousex"],
      "env": {
        "MCP_CLICKHOUSE_DSN": "http://default:@localhost:8123/default"
      }
    }
  }
}

Copilot

{
  "inputs": [],
  "servers": {
    "clickhouse": {
      "type": "stdio",
      "command": "uvx",
      "args": ["mcp-clickhousex"],
      "env": {
        "MCP_CLICKHOUSE_DSN": "http://default:@localhost:8123/default"
      }
    }
  }
}

Speicherorte der Konfigurationsdateien: Cursor .cursor/mcp.json, Codex/Copilot/OpenCode variieren je nach Client; siehe die MCP-Dokumentation Ihres Clients.

Tests

Tests erfordern eine laufende ClickHouse-Instanz. Die Testsuite erstellt eine Beispieltabelle in der Standarddatenbank, befüllt sie und löscht sie danach.

# Run all tests (unit + functional + e2e)
uv run pytest tests/ -v

Das Test-Framework verwendet MCP_TEST_CLICKHOUSE_DSN, um die ClickHouse-Instanz zu finden. Wenn nicht gesetzt, fällt es auf http://admin:password123@localhost:8123/default zurück. Setzen Sie die Variable, um Tests auf einen anderen Server zu richten, ohne Ihre Produktions-MCP_CLICKHOUSE_DSN zu beeinflussen:

export MCP_TEST_CLICKHOUSE_DSN="http://user:pass@testhost:8123/default"
uv run pytest tests/ -v

Roadmap

Derzeit keine geplanten Funktionen. Eröffnen Sie ein Issue, um Verbesserungen vorzuschlagen.

Mitwirken

Eröffnen Sie Issues oder PRs; folgen Sie dem vorhandenen Stil und fügen Sie wo angemessen Tests hinzu.

Lizenz

MIT. Siehe LICENSE.

Available Tools

8 tools
analyze_queryA
Read-only

[ClickHouse] Explain read-only SELECT or WITH … SELECT.

Returns plan, pipeline, and/or syntax text. Default types plan and pipeline. Uses query timeout and optional database; no max-rows cap unlike run_query.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesRead-only SELECT or WITH … SELECT for EXPLAIN. One statement; same validation as run_query.
typesNoEXPLAIN variants: plan (indexes), pipeline, syntax. Default plan and pipeline if omitted.
profileNoProfile name; uses default profile when omitted. Src: profiles.
databaseNoSession default database for unqualified names. Src: databases.
parametersNoNamed parameters for driver placeholders (e.g. %(name)s or {name:Type}).

Output Schema

ParametersJSON Schema
NameRequiredDescription
planNoEXPLAIN PLAN output.
syntaxNoEXPLAIN SYNTAX output.
pipelineNoEXPLAIN PIPELINE output.

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description adds behavioral context beyond readOnlyHint and openWorldHint annotations, such as query timeout, optional database, and the absence of max-rows cap. No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences, front-loaded with core purpose, and each sentence provides distinct information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given output schema existence and high parameter coverage, description covers key aspects: purpose, defaults, and comparison. Minor missing details like timeout value are acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds value by specifying default types (plan and pipeline) and mentioning query timeout, which is not in schema. Slight improvement over baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool performs EXPLAIN on read-only SELECT/WITH SELECT, returning plan/pipeline/syntax. Distinguishes from sibling run_query by noting no max-rows cap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides context on when to use (for EXPLAIN) and comparison to run_query. Implicitly limits to read-only queries but lacks explicit alternatives for DDL or other analysis tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_cluster_propertiesA
Read-only

[ClickHouse] Get cluster properties and execution limits.

Returns ClickHouse server version plus enforced limits (max rows, timeouts) for the profile.

ParametersJSON Schema
NameRequiredDescriptionDefault
profileNoProfile name; uses default profile when omitted. Src: profiles.

Output Schema

ParametersJSON Schema
NameRequiredDescription
limitsYes
versionYesClickHouse server version string.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=true, and the description adds context about specific returned data (version, limits). No contradiction. Does not mention any side effects or authorization needs, but read-only nature covers safety.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no fluff. First sentence states purpose, second describes output. Information is front-loaded and every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and simple input, the description provides all necessary context. Annotations cover safety, and the description adequately explains the tool's scope and return content.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and describes the profile parameter well. The description does not add extra details beyond the schema, which is adequate for a single optional parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'Get cluster properties and execution limits' and specifies it returns 'ClickHouse server version plus enforced limits', which is a specific verb and resource. It distinguishes from sibling tools like run_query and list_profiles.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implied usage as a read-only check for server properties and limits, but no explicit when-to-use or when-not-to-use guidance compared to siblings like list_profiles.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_columnsA
Read-only

[ClickHouse] List columns for a table or view.

Rows from system.columns for the resolved database and table.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYesTable or view name, or database.table. Src: tables.
profileNoProfile name; uses default profile when omitted. Src: profiles.
databaseNoDatabase when table is unqualified; ignored if table contains a dot. Client default when omitted. Src: databases.

Output Schema

ParametersJSON Schema
NameRequiredDescription
rowsYesRow values aligned with the columns list.
columnsYesOrdered list of column names. Each row aligns with these names by index.

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=true, so the description's mention of using system.columns adds some context but does not reveal additional behavioral traits beyond what annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just two sentences, no redundancy, and the key purpose is front-loaded. Every word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only list tool with full parameter documentation, an output schema, and clear annotations, the description sufficiently covers the context and functionality without needing to explain return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the tool description does not add any extra meaning beyond the existing parameter descriptions, such as explaining the 'Src' references or providing examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List columns for a table or view' with a specific verb and resource. It includes the context '[ClickHouse]' and mentions the data source 'Rows from system.columns', making it distinct from sibling tools like list_tables or list_databases.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for listing columns of a table or view, but it does not provide explicit guidance on when to use this tool vs alternatives, nor does it mention any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_databasesB
Read-only

[ClickHouse] List databases.

Rows from system.databases visible to the connection.

ParametersJSON Schema
NameRequiredDescriptionDefault
profileNoProfile name; uses default profile when omitted. Src: profiles.

Output Schema

ParametersJSON Schema
NameRequiredDescription
rowsYesRow values aligned with the columns list.
columnsYesOrdered list of column names. Each row aligns with these names by index.

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true. Description adds the detail that it queries system.databases and depends on connection visibility. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences, no wasted words, front-loaded with purpose and context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only tool with one optional parameter and an output schema, the description is adequate. Provides source table and visibility context, but could mention output shape briefly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with parameter 'profile' already documented. Description adds no extra meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'List' and resource 'databases', includes context '[ClickHouse]' and source 'system.databases'. Differentiates from siblings like 'list_tables' implicitly but no explicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Mentions that rows are from system.databases and visible to the connection, but provides no guidance on when to use this tool vs alternatives like list_tables or run_show. Lacks explicit when-to-use or when-not-to-use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_profilesA
Read-only

[ClickHouse] List configured profiles.

Each entry includes name and optional description.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds value beyond annotations by specifying that output includes name and optional description. Annotations already declare readOnlyHint=true, so the read-only nature is known. No additional behavioral traits (e.g., ordering, filtering) are disclosed, but the description does not contradict annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: two sentences that front-load the purpose and follow with a key output detail. Every word earns its place with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and the presence of an output schema, the description is mostly complete. It explains what the tool does and what output to expect. It could optionally mention the source of profiles (e.g., system.profiles), but the current level is adequate for a simple listing tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters, so schema description coverage is 100%. The description does not need to add parameter semantics. It provides a baseline adequate for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List configured profiles') and the resource ('profiles'). The output details are mentioned (name and optional description). However, it does not explicitly differentiate from sibling list tools (e.g., list_databases, list_tables) beyond the resource name, lacking a contrastive statement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, common use cases, or when not to use it. The tool is simple, but the description does not help an agent decide between this and other list tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesA
Read-only

[ClickHouse] List tables and views in a database.

Rows from system.tables: name, engine, primary_key, sorting_key, partition_key, total_rows, total_bytes for query planning.

ParametersJSON Schema
NameRequiredDescriptionDefault
profileNoProfile name; uses default profile when omitted. Src: profiles.
databaseNoDatabase to list; client default when omitted. Src: databases.

Output Schema

ParametersJSON Schema
NameRequiredDescription
rowsYesRow values aligned with the columns list.
columnsYesOrdered list of column names. Each row aligns with these names by index.

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, and the description adds context about the specific columns returned. However, it does not disclose any behavioral traits beyond that, but given the annotations, this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise: two sentences that front-load the purpose and return value. No unnecessary words or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only list tool with an output schema and well-documented parameters, the description is nearly complete. A minor gap: it does not clarify behavior when database is omitted (client default), but overall it is sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (profile, database). The description does not add extra meaning beyond what the schema provides, meeting the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists tables and views in a database, specifying the source (system.tables) and the columns returned. It effectively distinguishes from sibling tools like list_databases and list_columns by focusing on tables.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., run_show or analyze_query). The description merely states functionality without providing context on preferred scenarios or limitations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_queryA
Read-only

[ClickHouse] Execute read-only SELECT or WITH … SELECT.

One statement; DML, DDL, SET, SYSTEM, and similar are rejected. Max-rows cap; overflow sets truncated and row_limit. Same SQL validation as analyze_query.

Returns {data, row_count} where data is an RFC 4180 CSV string. Pass snapshot=true to persist the result to disk and receive a {snapshot_uri, row_count} instead; fetch the CSV via the snapshot resource URI.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesRead-only SELECT or WITH … SELECT. One statement; use qualified db.table or database. Driver placeholder syntax for parameters.
profileNoProfile name; uses default profile when omitted. Src: profiles.
databaseNoSession default database for unqualified names. Src: databases.
snapshotNoWhen true, persist the full result as a CSV file and return a resource URI (chx://snapshots/{id}) instead of inline data. Use for queries that may exceed the interactive row limit (1 000). Snapshot limits apply (default 10 000 rows, hard ceiling 50 000). Entries expire after 7 days.
parametersNoNamed parameters for driver placeholders (e.g. %(name)s or {name:Type}).

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true and openWorldHint=true. Description aligns fully and adds rich behavioral details: max-rows cap, truncation with row_limit flag, CSV return format, snapshot persistence with expiration and limits. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is a single, well-structured paragraph with each sentence serving a distinct purpose: resource and verb, constraints, limits, return format, and snapshot alternative. No fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters, 100% schema coverage, and an output schema (not shown but indicated), the description covers purpose, constraints, limits, return format, and snapshot behavior comprehensively. No gaps given the context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% description coverage, but description adds value by explaining the return format (CSV string and snapshot URI pattern) which is not in the input schema. Also reiterates constraints on sql parameter. Overall meaningfully supplements schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it executes read-only SELECT or WITH SELECT on ClickHouse. It specifies the resource ([ClickHouse] queries) and verb (execute read-only). Distinguishes from siblings like run_show and analyze_query by stating specific SQL types and validation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states that only read-only queries are allowed, and DML/DDL/SET etc. are rejected. Mentions same validation as analyze_query, linking to a sibling. Clear context for when to use, but does not explicitly exclude alternatives or provide when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_showA
Read-only

[ClickHouse] Execute SHOW introspection statement.

One statement per call; INTO OUTFILE rejected. Interactive row limits apply (default 500, hard ceiling 1 000). Same timeout as run_query.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesSingle SHOW statement (e.g. SHOW DATABASES, SHOW CREATE TABLE). No INTO OUTFILE.
profileNoProfile name; uses default profile when omitted. Src: profiles.
databaseNoSession default database for unqualified names. Src: databases.
parametersNoNamed parameters for driver placeholders (e.g. %(name)s or {name:Type}).

Output Schema

ParametersJSON Schema
NameRequiredDescription
rowsYesRow values aligned with the columns list.
columnsYesOrdered list of column names. Each row aligns with these names by index.
row_limitNoThe enforced maximum number of rows returned for this query.
truncatedNoWhether the result set was truncated due to the enforced row limit.

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark as read-only, and the description adds critical behavioral details: row limits (500 default, 1000 hard ceiling), INTO OUTFILE rejection, and timeout alignment with run_query. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each earning its place: purpose, constraints on statement, limits. Front-loaded and efficient with zero redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description sufficiently covers all behavioral aspects for a read-only introspection tool. Includes limits, timeout, and statement restrictions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds value by explaining the sql parameter constraint (single statement, no INTO OUTFILE) and implicitly relates to row limits. Modest but helpful addition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it executes SHOW introspection statements, distinguishing from siblings like run_query. It specifies constraints (single statement, no INTO OUTFILE), making the purpose specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context for when to use (SHOW statements) and constraints (row limits, timeout). Lacks explicit when-not-to-use alternatives, but the sibling tool names imply run_query for other queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 8 tool updatesv0.8.0
    • First observedanalyze_query
    • First observedget_cluster_properties
    • First observedlist_columns
    • First observedlist_databases
    • First observedlist_profiles
    • First observedlist_tables
    • First observedrun_query
    • First observedrun_show

TDQS

A4/5.0

Scored across 8 tools

Disambiguation5/5

Each tool has a distinct purpose: listing profiles, cluster properties, running SELECT queries, running SHOW statements, analyzing queries, and listing databases, tables, and columns. No overlap in functionality.

Naming Consistency4/5

Uses snake_case consistently, but mixes verb prefixes: 'list_', 'get_', 'run_', 'analyze_'. The pattern is somewhat predictable within categories (metadata listing uses 'list_', execution uses 'run_'), but not fully uniform.

Tool Count5/5

8 tools is well-scoped for a read-only ClickHouse client. Covers metadata discovery, query execution, and analysis without unnecessary tools.

Completeness4/5

Covers essential read-only operations: metadata listing, SELECT, SHOW, and EXPLAIN. Lacks DDL/DML support, but that is intentional. Minor gap: no tool to retrieve table DDL or status.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    An MCP server for ClickHouse with enhanced filtering for database and table discovery, supporting LIKE/NOT LIKE patterns and both ClickHouse and chDB tools.
    3
    Apache 2.0
  • A
    license
    A
    quality
    D
    maintenance
    A DataOps-focused MCP server for ClickHouse that provides query optimization advice, pipeline latency analysis, and data quality monitoring, with read-only safety.
    8
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A read-only MCP server for exploratory data analysis across PostgreSQL, MySQL, and ClickHouse databases, providing safe, read-only access with comprehensive analysis capabilities.
    10
    6
    MIT