Loading...

This MCP server enables interaction with ClickHouse and chDB databases, providing tools for querying, listing databases/tables, and health checks, with configurable authentication.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
This MCP server enables interaction with ClickHouse and chDB databases, providing tools for querying, listing databases/tables, and health checks, with configurable authentication.
This MCP server offers a reasonable level of safety when properly configured with authentication and secure connection settings. The greatest risks arise from disabling authentication or using the chDB tool with untrusted data sources. Exercise caution when configuring environment variables and granting access to the ClickHouse instance.
Performance is primarily determined by the ClickHouse cluster's resources and the complexity of the SQL queries. chDB performance depends on the size and location of the data being queried.
Cost considerations depend on the ClickHouse cluster's infrastructure and the volume of data being processed. chDB can reduce ETL costs by enabling direct querying of data sources.
{
"mcpServers": {
"mcp-clickhouse": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.10",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_HOST": "<clickhouse-host>",
"CLICKHOUSE_PORT": "<clickhouse-port>",
"CLICKHOUSE_USER": "<clickhouse-user>",
"CLICKHOUSE_PASSWORD": "<clickhouse-password>",
"CLICKHOUSE_ROLE": "<clickhouse-role>",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_VERIFY": "true",
"CLICKHOUSE_CONNECT_TIMEOUT": "30",
"CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30"
}
}
}
}CLICKHOUSE_HOSTCLICKHOUSE_PORTCLICKHOUSE_USERCLICKHOUSE_PASSWORDCLICKHOUSE_SECURECLICKHOUSE_VERIFYrun_select_queryExecutes a read-only SQL query on the ClickHouse cluster.
Queries are run with `readonly = 1`, preventing data modification.
list_databasesLists all databases on the ClickHouse cluster.
Read-only operation with no side effects.
list_tablesLists tables in a database with optional filtering and pagination.
Read-only operation with no side effects.
run_chdb_select_queryExecutes a SQL query using the chDB embedded ClickHouse engine.
Queries data directly from various sources, potentially including untrusted URLs or files.
Token
hybrid
This MCP server offers a reasonable level of safety when properly configured with authentication and secure connection settings. The greatest risks arise from disabling authentication or using the chDB tool with untrusted data sources. Exercise caution when configuring environment variables and granting access to the ClickHouse instance.
Autonomy is limited by the read-only nature of most tools. The chDB tool introduces some risk due to its ability to query external data sources.
Production Tip
Ensure proper monitoring and alerting are in place to detect connection issues or unexpected query results.
Authentication is required by default for HTTP/SSE transports, using a token-based authentication scheme. The stdio transport does not require authentication.
You can disable authentication by setting the `CLICKHOUSE_MCP_AUTH_DISABLED` environment variable to `true`. This is only recommended for local development.
The health check endpoint returns a 200 OK status with the ClickHouse version if the server is healthy and can connect to ClickHouse. It returns a 503 Service Unavailable status if the server cannot connect to ClickHouse.
The required environment variables are `CLICKHOUSE_HOST`, `CLICKHOUSE_USER`, and `CLICKHOUSE_PASSWORD`.
You can enable chDB by setting the `CHDB_ENABLED` environment variable to `true` and providing a path to the data directory using `CHDB_DATA_PATH`.
Yes, you can enable both ClickHouse and chDB by configuring the appropriate environment variables for each.
`CLICKHOUSE_SECURE` enables or disables HTTPS connection, while `CLICKHOUSE_VERIFY` enables or disables SSL certificate verification. It is recommended to keep both enabled for secure connections.