ClickHouse · Codex
Add the ClickHouse MCP server to Codex
Query and explore ClickHouse clusters and chDB.
Official serverLocalDatabases
1. Add the server
Run in your terminal
# ~/.codex/config.toml [mcp_servers.clickhouse] command = "uvx" args = ["mcp-clickhouse"] [mcp_servers.clickhouse.env] CLICKHOUSE_HOST = "<your CLICKHOUSE_HOST>" CLICKHOUSE_USER = "<your CLICKHOUSE_USER>"
2. Sign in
Run codex mcp login <name> to complete OAuth for a remote server. ClickHouse runs locally and needs CLICKHOUSE_HOST, CLICKHOUSE_USER. Replace the placeholder values above with your own before starting Codex.
3. Try it
Ask Codex for something ClickHouse can do. Query and explore ClickHouse clusters and chDB. Approve the first tool call and check the result before allowing write actions automatically.
- · Each server is a [mcp_servers.<name>] table in config.toml.
- · Use enabled_tools or disabled_tools to keep the tool list short.
FAQ
- How do I add the ClickHouse MCP server to Codex?
- Run: # ~/.codex/config.toml …. Run codex mcp login <name> to complete OAuth for a remote server.
- Is this the official ClickHouse MCP server?
- Yes. It is published by ClickHouse as io.github.ClickHouse/mcp-clickhouse in the official MCP registry.
- Does the ClickHouse MCP server need an API key?
- Yes. It runs locally and requires CLICKHOUSE_HOST, CLICKHOUSE_USER.
Links
ClickHouse in other clients
More databases for Codex
Work at ClickHouse?
Feature ClickHouse across the directory and its category from $49/month.
Reviewed Oct 5, 2026. Command generated from the registry record and checked against Codex's documented syntax.