CCM
/MCP
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Claude Code Marketplaces

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Skill index
  • MCP index
  • Marketplace index
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by mertbuilds.com

Independent project, not affiliated with Anthropic
alyiox avatar

ClickHouse

alyiox/mcp-clickhousex
13 toolsauthSTDIOregistry active
Summary

Connects Claude to ClickHouse for read-only database exploration and analytics. Exposes tools to run SELECT queries with parameterized inputs, inspect metadata across databases and tables, and analyze query plans. Enforces strict no-write policies and rejects DML or DDL statements. Supports multiple connection profiles via environment variables or config file, plus snapshot mode for large result sets that exceed the interactive 1,000 row ceiling. Query results return as CSV with configurable timeouts and row limits. Useful when you need Claude to explore table structures, validate query logic, or pull analytical data from ClickHouse without risking schema changes.

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Lid closed, agents working
Lid closed, agents working
Keeps your Mac awake while Claude Code, Codex or Cursor works. Lets it sleep when they are done.
Try free for 7 days →
Block distraction from your iPhone for freeBlock distraction from your iPhone for free
Block distraction from your iPhone for free
Block distracting apps from your iPhone permanently without a 3rd party app. Free and open source.
Block now (100% free) →
Granola, the best AI meeting recorder
Granola, the best AI meeting recorder
Notes, actions and memory. Without a meeting bot. First month 100% off.
Download for free →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
Open Steps
Open Steps
Free an open-source skills that make AI coding agents easier to understand, verify, and control.
Download for free →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Lid closed, agents working
Lid closed, agents working
Keeps your Mac awake while Claude Code, Codex or Cursor works. Lets it sleep when they are done.
Try free for 7 days →
Block distraction from your iPhone for freeBlock distraction from your iPhone for free
Block distraction from your iPhone for free
Block distracting apps from your iPhone permanently without a 3rd party app. Free and open source.
Block now (100% free) →
Granola, the best AI meeting recorder
Granola, the best AI meeting recorder
Notes, actions and memory. Without a meeting bot. First month 100% off.
Download for free →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
Open Steps
Open Steps
Free an open-source skills that make AI coding agents easier to understand, verify, and control.
Download for free →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →

Tools

Public tool metadata for what this MCP can expose to an agent.

13 tools
get_clickpipeReturns the specified ClickPipe.3 params

Returns the specified ClickPipe.

Parameters* required
clickPipeIdstring
ID of the requested ClickPipe
organizationIdstring
ID of the organization that owns the service
serviceIdstring
ID of the service that owns the ClickPipe
get_organizationsRetrieves all accessible ClickHouse Cloud organizations.

Retrieves all accessible ClickHouse Cloud organizations.

No parameter schema in public metadata yet.

run_select_queryExecutes a SELECT query against a ClickHouse service. Runs a read-only SELECT query on the specified ClickHouse service via the Query API endpoint. This function provides direct access to database content through SQL queries while ensuring that only read operations are permitted.3 params

Executes a SELECT query against a ClickHouse service. Runs a read-only SELECT query on the specified ClickHouse service via the Query API endpoint. This function provides direct access to database content through SQL queries while ensuring that only read operations are permitted.

Parameters* required
querystring
A valid ClickHouse SQL SELECT query string
serviceIdstring
The unique identifier of the ClickHouse service
timeoutSecondsinteger
Maximum time in seconds to wait for the query to complete. Defaults to 300 (5 minutes), maximum is 3600 (1 hour). Use lower values for simple queries and higher values for complex analytical queries.
list_databasesRetrieves all databases available in a ClickHouse service.1 params

Retrieves all databases available in a ClickHouse service.

Parameters* required
serviceIdstring
list_tablesRetrieves a comprehensive list of tables in a ClickHouse database, including columns.4 params

Retrieves a comprehensive list of tables in a ClickHouse database, including columns.

Parameters* required
databasestring
Name of the database to list tables from
likestring
Optional SQL LIKE pattern to filter tables by name (e.g., "events_%")
notLikestring
Optional SQL LIKE pattern to exclude tables by name
serviceIdstring
The unique identifier of the ClickHouse service
get_services_listRetrieves all services in a ClickHouse Cloud organization.1 params

Retrieves all services in a ClickHouse Cloud organization.

Parameters* required
organizationIdstring
ID of the organization whose services are to be listed
get_organization_detailsReturns details of a single organization. The auth key must belong to the organization.1 params

Returns details of a single organization. The auth key must belong to the organization.

Parameters* required
organizationIdstring
ID of the organization to retrieve
get_service_detailsReturns a service that belongs to the organization.2 params

Returns a service that belongs to the organization.

Parameters* required
organizationIdstring
ID of the organization
serviceIdstring
ID of the service to retrieve
list_clickpipesRetrieves all ClickPipes configured for a specific service.2 params

Retrieves all ClickPipes configured for a specific service.

Parameters* required
organizationIdstring
ID of the organization
serviceIdstring
ID of the service to list ClickPipes for
list_service_backupsReturns a list of all backups for the service. The most recent backups comes first in the list.2 params

Returns a list of all backups for the service. The most recent backups comes first in the list.

Parameters* required
organizationIdstring
ID of the organization
serviceIdstring
ID of the service to list backups for
get_organization_costRetrieves billing and usage cost data for a ClickHouse Cloud organization. Returns a grand total and a list of daily, per-entity organization usage cost records for the organization in the queried time period (maximum 31 days).3 params

Retrieves billing and usage cost data for a ClickHouse Cloud organization. Returns a grand total and a list of daily, per-entity organization usage cost records for the organization in the queried time period (maximum 31 days).

Parameters* required
from_datestring
Start date for the report, e.g. 2024-12-19 (YYYY-MM-DD)
organizationIdstring
The unique identifier of the organization
to_datestring
End date (inclusive) for the report, e.g. 2024-12-20 (YYYY-MM-DD). Cannot be more than 30 days after from_date.
get_service_backup_detailsReturns a single backup info.3 params

Returns a single backup info.

Parameters* required
backupIdstring
ID of the backup
organizationIdstring
ID of the organization that owns the service
serviceIdstring
ID of the service
get_service_backup_configurationReturns the service backup configuration.2 params

Returns the service backup configuration.

Parameters* required
organizationIdstring
ID of the organization that owns the service
serviceIdstring
ID of the service

MCP ClickHouse Tool

CI PyPI Python 3.13+ License: MIT

A read-only-by-default Model Context Protocol (MCP) server for ClickHouse that provides schema discovery, read-only queries, execution-plan analysis, opt-in writes, and profile-based access to multiple servers from a single toolset deployment.

Read-only is enforced by the engine, not by SQL text matching: the query tools' clients carry ClickHouse's readonly=1, so writes, external table functions and query-level SETTINGS are refused by the server being queried. Writes live behind a separate tool that is not registered at all until a profile asks for it.

Requirements: Python 3.13+, a running ClickHouse instance, and connection details via environment variables or a config file.

Quick start

Set a DSN and run the server with MCP Inspector:

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

Configuration

A profile is one ClickHouse connection: a DSN plus the row and timeout caps that apply to it. A profile named default always exists; every tool takes an optional profile to reach another, and list_profiles reports what is configured.

Settings come from three sources, merged field by field, later winning:

  1. the user-scoped config.json — any number of profiles;
  2. MCP_CLICKHOUSE_PROFILES_<NAME>_<FIELD> environment variables — any number of profiles;
  3. flat MCP_CLICKHOUSE_<FIELD> environment variables — the default profile only.

Because the merge is per field rather than per profile, a config.json can carry the full set while a flat MCP_CLICKHOUSE_DSN repoints the default profile at a local server, leaving its other fields intact. With none of the three present, default falls back to http://default:@localhost:8123/default.

Each setting has one field name, spelled three ways — MCP_CLICKHOUSE_<FIELD>, MCP_CLICKHOUSE_PROFILES_<NAME>_<FIELD>, or the field lowercased as a JSON key:

FieldDefaultHard ceiling
DSNhttp://default:@localhost:8123/default—
DESCRIPTIONnone—
QUERY_MAX_ROWS5001 000
QUERY_COMMAND_TIMEOUT_SECONDS30300
SNAPSHOT_MAX_ROWS10 00050 000
SNAPSHOT_COMMAND_TIMEOUT_SECONDS120300
ALLOW_WRITEfalse—
WRITE_COMMAND_TIMEOUT_SECONDS60600

Caps are per profile. A value above its ceiling is clamped at startup; a value that is not an integer falls back to the default, and a value that is not a boolean leaves ALLOW_WRITE off.

Single connection: flat environment variables are the shortest path.

# Connection DSN.
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 caps, defaults shown.
export MCP_CLICKHOUSE_QUERY_MAX_ROWS="500"
export MCP_CLICKHOUSE_QUERY_COMMAND_TIMEOUT_SECONDS="30"
export MCP_CLICKHOUSE_SNAPSHOT_MAX_ROWS="10000"
export MCP_CLICKHOUSE_SNAPSHOT_COMMAND_TIMEOUT_SECONDS="120"

# Optional write access, off by default; also controls whether run_command
# is advertised at all.
export MCP_CLICKHOUSE_ALLOW_WRITE="false"
export MCP_CLICKHOUSE_WRITE_COMMAND_TIMEOUT_SECONDS="60"

Multiple connections: use the user-scoped config.json, which keeps credentials out of the host's process environment.

  • Unix-like: ~/.config/mcp-clickhousex/config.json
  • Windows: %USERPROFILE%\.config\mcp-clickhousex\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"
    },
    "writer": {
      "dsn": "http://etl:pass@warehouse:8123/analytics",
      "description": "Warehouse, write-enabled",
      "allow_write": true,
      "write_command_timeout_seconds": 120
    }
  }
}

Nothing stops one profile from both reading and writing, but a separate write-enabled profile is the shape worth copying: it gives the writes their own DSN, so the credentials behind them can be scoped to what they actually need while the read profiles stay on a login whose grants stop at SELECT.

Profile names are case-insensitive and must be alphanumeric — no underscores or hyphens, since the structured env form splits on _ (MCP_CLICKHOUSE_PROFILES_WAREHOUSE_DSN is profile warehouse, field DSN). A name that breaks the rule is skipped, as is a config.json that is missing, unreadable, or not shaped {"profiles": {…}}; the server starts on whatever sources remain rather than failing.

DSN syntax: scheme://user:password@host:port/database. An https:// or clickhouses:// scheme enables TLS, and query-string parameters reach the driver (?connect_timeout=10) — except readonly, which the server always applies last, from the profile's ALLOW_WRITE.

URL-reserved characters in the username or password must be percent-encoded — # → %23, ? → %3F, / → %2F, @ → %40, % → %25. Username admin@org with password p#ss? becomes http://admin%40org:p%23ss%3F@host:8123/database.

Tools and resources

All tools accept an optional profile; when omitted, the default profile is used.

Tools

ToolDescriptionKey params
list_profilesList configured connection profiles. Call first when picking a non-default profile. Returns name, description and allow_write per profile.—
run_queryExecute one read-only SELECT (CTEs allowed) or SHOW statement. Returns rows inline as CSV, or a chx://snapshots/{id} URI when snapshot=true. Inline limit: 500 rows (hard ceiling 1 000). Snapshot limit: 10 000 rows (hard ceiling 50 000). No INTO OUTFILE.sql, parameters, database, profile, snapshot
analyze_queryEXPLAIN a read-only SELECT; returns plan, pipeline or syntax, no result rows. SHOW is not an EXPLAIN target.sql, parameters, database, profile, types
run_commandExecute one write statement (DDL/DML). Advertised only when some profile sets ALLOW_WRITE (off by default); still refused at call time when the target profile is locked. Returns written_rows, written_bytes and query_id. Marked destructive; intended for human-supervised use.sql, parameters, database, profile
  • types — EXPLAIN variants: plan (indexes), pipeline, syntax. Defaults to plan and pipeline.
  • parameters — Named parameters for driver placeholders, %(name)s or {name:Type}.
  • database — Session default database for unqualified names; otherwise qualify as db.table.

Catalog discovery has no dedicated tool: list databases, tables and columns — and read sizes (total_rows, total_bytes) and keys (primary_key, sorting_key, partition_key) — with run_query over system.databases, system.tables and system.columns, which take ordinary WHERE predicates where SHOW takes only LIKE. SHOW earns its place for DDL a listing cannot give you — SHOW CREATE TABLE/VIEW/DICTIONARY for codecs, TTLs and the full column list.

Results are RFC 4180 CSV: the first row is the header, the rest are data. NULL is written as \N, ClickHouse's own CSV null representation, so it stays distinct from the empty string.

A plan's Indexes section is not authoritative about a table's keys: it names only the key columns the query used, so a query that skips the leading key column reports a shorter key than the table has. Confirm from system.tables, which answers in a few dozen tokens where SHOW CREATE TABLE spends several hundred to say the same thing.

The row caps that applied to a call arrive with its result as truncated and row_limit.

Resources

URIDescription
chx://profilesList configured connection profiles, including allow_write (application/json). Same data as list_profiles.
chx://snapshots/{id}Fetch a query result snapshot as CSV; id comes from the snapshot_uri that run_query returns. Expires after 7 days.

Security

Every client this server opens carries ClickHouse's own readonly=1, so the engine — not just the server's SQL checks — refuses:

  • writes of any kind (INSERT, DDL, ALTER … UPDATE, SYSTEM, GRANT);
  • the external table functions url(), s3(), remote(), mysql() and friends, so a query cannot reach a host outside the configured profile;
  • query-level SETTINGS, so the row and time caps cannot be raised by the SQL an agent supplies, and INTO OUTFILE is refused.

readonly=2 is deliberately not used: it permits SETTINGS changes, which would make those caps advisory. The tradeoff is that benign per-query tuning (SETTINGS max_threads = …) is refused too.

On top of that, run_query accepts SELECT / WITH … SELECT / SHOW and analyze_query only the first two, one statement per call. Interactive queries enforce a tight row cap (default 500, hard ceiling 1 000); for larger extracts use snapshot=true (default 10 000, hard ceiling 50 000).

Writes are opt-in, and invisible until then. run_command runs on a client carrying readonly=0, so it executes arbitrary DDL and DML — and, with readonly lifted, the external table functions come back too. Unless at least one configured profile sets ALLOW_WRITE (default false), the tool is not registered at all: it never appears in tools/list, so a read-only deployment spends no context on it and offers no write surface an agent could be talked into. Once any profile opts in, the tool is advertised server-wide and is still refused at call time on profiles that remain locked; list_profiles reports allow_write per profile so an agent can pick a writable one.

ALLOW_WRITE is a soft, application-level guard, not a security boundary — it constrains this server, not the database. For a genuine read-only guarantee, connect with a login whose ClickHouse grants stop at SELECT, and keep write-enabled profiles pointed at credentials scoped to only what they need. run_command carries destructive and openWorld tool annotations so hosts can gate it behind confirmation, but honoring those annotations is the host's choice. ClickHouse has no transaction to roll back in here: a statement that lands, stays.

Use environment variables or the config file for connection credentials — never commit secrets.

MCP host examples

Snippets use uvx mcp-clickhousex (no clone required; ensure uv is on your PATH). Replace connection details as needed; the env block is unnecessary when the DSN already comes from config.json or the environment.

Claude Code and Cursor read the same mcpServers shape:

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

Codex (TOML):

[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"
      }
    }
  }
}

GitHub Copilot:

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

Tests

Tests require a running ClickHouse instance; the suite creates a sample table in the default database, seeds it, and drops it after.

uv run pytest tests/ -v

The harness locates the instance through MCP_TEST_CLICKHOUSE_DSN, falling back to http://admin:password123@localhost:8123/default. Set it to point tests at another server without touching your production MCP_CLICKHOUSE_DSN.

The suite configures two profiles on that one instance — a read-only default and a write-enabled writable — so both halves of the write gate are exercised: run_command is advertised because a profile opts in, and is still refused against the profile that does not.

Contributing

Open issues or PRs; follow existing style and add tests where appropriate.

License

MIT

Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Lid closed, agents working
Lid closed, agents working
Keeps your Mac awake while Claude Code, Codex or Cursor works. Lets it sleep when they are done.
Try free for 7 days →
Block distraction from your iPhone for freeBlock distraction from your iPhone for free
Block distraction from your iPhone for free
Block distracting apps from your iPhone permanently without a 3rd party app. Free and open source.
Block now (100% free) →
Granola, the best AI meeting recorder
Granola, the best AI meeting recorder
Notes, actions and memory. Without a meeting bot. First month 100% off.
Download for free →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
Open Steps
Open Steps
Free an open-source skills that make AI coding agents easier to understand, verify, and control.
Download for free →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →

Configuration

MCP_CLICKHOUSE_DSNsecret

Optional shortcut DSN for the default profile, for example http://user:password@host:8123/database. For multiple profiles, use ~/.config/mcp-clickhousex/config.json or MCP_CLICKHOUSE_PROFILES_<NAME>_DSN.

Categories
Databases
Registryactive
Packagemcp-clickhousex
TransportSTDIO
AuthRequired
UpdatedApr 30, 2026
View on GitHub

More from alyiox

  • Microsoft SQL Server5
  • Walmart Connect Advertising APIs1
  • Atlassian Attachments

Related Databases MCP Servers

View all →
annasmazhar avatar
Pyspark Mcp

annasmazhar/pyspark_mcp

SQL to PySpark conversion, AWS Glue job generation, and Spark code optimization.
ansvar-systems avatar
Canadian Law Mcp

ansvar-systems/canadian-law-mcp

Canadian federal law database — PIPEDA, CASL, cybercrime, corporate law with full-text search
ansvar-systems avatar
Chinese Law Mcp

ansvar-systems/chinese-law-mcp

Chinese law database — cybersecurity, data protection, commercial law with full-text search
ansvar-systems avatar
Singapore Law Mcp

ansvar-systems/singapore-law-mcp

Singapore law database — PDPA, Cybersecurity Act, Computer Misuse Act with full-text search
ansvar-systems avatar
South Korea Law Mcp

ansvar-systems/south-korea-law-mcp

South Korean law database — PIPA, ICT network security, credit information with full-text search
ansvar-systems avatar
Thailand Law Mcp

ansvar-systems/thailand-law-mcp

Thai law database — PDPA, Computer Crime Act, Cybersecurity Act, ETA with full-text search