# ClickHouse MCP server > Run read-only SQL, list databases and tables, describe columns, explain queries in ClickHouse. A hosted remote MCP server by usefulapi.io, an independent service (not affiliated with or endorsed by ClickHouse). - Server URL: https://clickhouse.usefulapi.io/mcp - Transport: Streamable HTTP, OAuth sign-in - Status: live - Page: https://usefulapi.io/clickhouse/ ## Connect - Claude (claude.ai, Desktop): Customize → Connectors → Add custom connector, name ClickHouse by UsefulAPI, URL https://clickhouse.usefulapi.io/mcp. Prefilled dialog: https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=ClickHouse%20by%20UsefulAPI&connectorUrl=https%3A%2F%2Fclickhouse.usefulapi.io%2Fmcp - Claude Code: `claude mcp add --transport http clickhouse https://clickhouse.usefulapi.io/mcp`, then run `/mcp` to log in. As a plugin: `claude plugin marketplace add https://usefulapi.io/claude/marketplace.json`, then `claude plugin install clickhouse@usefulapi`. - Codex: `codex mcp add clickhouse --url https://clickhouse.usefulapi.io/mcp`, then `codex mcp login clickhouse`. - ChatGPT: Plugins → Add custom MCP server, name ClickHouse by UsefulAPI, authentication OAuth. - Perplexity (Pro, Max, Enterprise): Plugins → Add custom → Add MCP connector → Remote, name ClickHouse by UsefulAPI, URL https://clickhouse.usefulapi.io/mcp, Advanced: OAuth, Streamable HTTP. - Cursor, VS Code and other MCP clients: add the URL as a remote MCP server. Add only the URL. Do not add an `Authorization` header or an API key to the client config. The server signs you in with OAuth: the login page asks for your **ClickHouse host name and port** and **ClickHouse user name**. If the config has such a header, remove it: some clients then send that header instead of the login token, and every call fails with 401. ## Before you connect The host is the public name of your server with its port, for example **abc.region.provider.clickhouse.cloud:8443** for ClickHouse Cloud. Use https on port 8443 (the default) or 443 only. Use a user that can read the databases you want to query. The server allows read statements only, whatever the user may do. ## Example requests - Which databases and tables do we have, and how many rows are in each table? - Describe the events table and tell me which columns are in the sorting key. - Count the orders per day for the last 30 days from the orders table. - Show the queries that have been running the longest right now. ## Pricing - Free: $0, 50 tool calls / month - Pro: $9/mo · $90/yr per user, 10,000 tool calls / month - Pro+: $39/mo · $390/yr per user, 100,000 tool calls / month Each paid plan covers this ClickHouse server only. ## Tools (11) ### Read only (7) - `clickhouse_get_server_info`: Get server info. Show the ClickHouse server version, the user this connection runs as, the server time zone and its uptime in seconds. Good first call to check the connection. ClickHouse HTTP interface: SELECT on the server. - `clickhouse_list_running_queries`: List running queries. List the queries running now (system.processes), slowest first, with the user, elapsed seconds, rows and memory read. The query text is cut to 500 characters. - `clickhouse_list_databases`: List databases. List the databases on the server with their engine and comment (system.databases). - `clickhouse_list_tables`: List tables. List tables with their database, engine, row count, size in bytes and comment (system.tables). Give a database to list only its tables. Stops at 1000 tables. - `clickhouse_describe_table`: Describe table. Show the columns of one table: type, default, whether the column is in the primary key or sorting key, and comment (system.columns). - `clickhouse_run_query`: Run a read-only query. Run one SELECT (or other read) statement and return the rows as JSON objects. The server refuses INSERT, CREATE, ALTER, DROP and any SETTINGS change. Results stop at 1 MiB; then truncated is true, so add a LIMIT or filter. - `clickhouse_explain_query`: Explain a query. Show the query plan of one SELECT statement (EXPLAIN) without running it for results. Use it to check which parts and indexes a query reads. ### Your UsefulAPI plan (4) - `clickhouse_usage_status`: Usage status (free-tier meter). Report the caller's current usage: the plan, calls used this month, the limit of the plan (the free monthly cap or the Pro fair use limit), remaining, and whether the limit is reached. Read-only; does not count against the meter. - `clickhouse_request_feature`: Request a missing feature. Tell UsefulAPI that the user needs something the ClickHouse tools cannot do yet (a missing tool, field or filter). Call it only when the user asks for something none of the tools can do, and tell the user that you send the request. Do not call it for errors or for normal requests. Do not include personal data, credentials or customer records. Stored with the product name and the client type (for example Claude or Cursor), without the user's account. At most 5 requests per day. Does not count against the meter. - `clickhouse_upgrade`: Upgrade to Pro or Pro+. Get a paid plan for ClickHouse (the free tier caps monthly usage). Pro: 10,000 tool calls a month, for normal use — plan "monthly" ($9/month) or "yearly" ($90/year, 2 months free). Pro+: 100,000 tool calls a month, for automations and heavy use — plan "plus" ($39/month) or "plus\_yearly" ($390/year). Without a plan, a free account gets both Pro and Pro+, each with a payment link, for the user to choose, and a Pro subscriber gets the Pro+ link; with a plan, one link. Exception: a free account at the free limit (and below Pro's) with no earlier subscription or trial for this server also gets a free 7-day Pro trial link, without a plan or next to the Pro link with plan "monthly". An existing Pro subscription changes to Pro+ in place: the reply gives a link to Stripe's page, which shows the exact charge (the price difference for the rest of the period; in a free Pro trial the full Pro+ price, as the trial ends) and changes the plan only when the user confirms there. This tool never charges. Cancel any time: the plan then runs to the end of the paid period, so it also suits a one-time job. A link opens Stripe Checkout in the browser; after payment the account upgrades automatically. Does not count against the meter. - `clickhouse_cancel_subscription`: Cancel the Pro subscription. Cancel the caller's ClickHouse Pro subscription at the end of the paid period (no refund for the current period; Pro continues until then, then the free tier applies). Requires confirm: true. Run clickhouse\_upgrade later to undo the cancel before the period ends. Does not count against the meter. ## FAQ ### What can I do with ClickHouse in Claude or ChatGPT? Explore the databases and tables of a server. Answer a question with one read-only SQL query. Check a query plan before you run a heavy query. Test a new connection and see the server version. See [what you can do](https://usefulapi.io/clickhouse/#uses) for the details. ### Is this an official ClickHouse product? No. UsefulAPI is an independent service. It is not affiliated with or endorsed by ClickHouse. The server calls the ClickHouse API with your own ClickHouse access, so it sees only the data that your account can see. ### Can I connect ClickHouse to Claude or ChatGPT? Yes. In Claude, add this server's URL as a custom connector. In ChatGPT, add it as a custom MCP server in Plugins. Then log in once. Cursor, VS Code, Claude Code and Codex work too. See [the setup steps](https://usefulapi.io/clickhouse/#connect). ### How is this different from a self-hosted ClickHouse MCP server? This server runs on UsefulAPI's infrastructure. You add its URL to your AI client and log in. You do not install or run anything, and you do not put a key in a config file. Because it is a remote server, Claude on the web and on mobile and ChatGPT on the web (on plans and workspaces that allow custom MCP servers) can connect to it directly. When we add or fix tools, the server changes for every user. Some clients must refresh the connection to show new tools. A self-hosted server runs on a computer or server that you manage, so you control where your credentials are kept. You install, update and host it yourself. Web clients such as claude.ai and ChatGPT can use it only through a public HTTPS address or a tunnel. ### What do I need to connect? The login page asks for your **ClickHouse host name and port** and **ClickHouse user name**. See [Before you connect](https://usefulapi.io/clickhouse/#setup) for where to find them. ### Do I put my ClickHouse key or an Authorization header in the client config? No. Add only the URL. Do not add an `Authorization` header or an API key to the client config. The server signs you in with OAuth: the login page asks for your **ClickHouse host name and port** and **ClickHouse user name**. If the config has such a header, remove it: some clients then send that header instead of the login token, and every call fails with 401. ### How do you keep my ClickHouse credentials? The login stores them encrypted in the authorization grant of your connection. The server uses them to call the ClickHouse API for you and to derive a private account id for usage metering. UsefulAPI does not show them on any page or in any reply. To stop all access, remove the connector and change or delete these credentials in ClickHouse. ### Can the AI change my ClickHouse data? All 7 ClickHouse tools are marked read-only. ### What does it cost? The Free plan gives 50 tool calls / month. Pro costs $9/mo or $90/yr, with 10,000 tool calls / month. Pro+ costs $39/mo or $390/yr, with 100,000 tool calls / month. These limits count tool calls to this UsefulAPI server (`clickhouse_usage_status` is free). They do not change the limits of the ClickHouse API, which still apply. Each subscription covers this ClickHouse server only. Cancel any time: your paid plan then runs to the end of the paid period. Run `clickhouse_usage_status` to see how many calls you used. ### How do I subscribe or cancel? Ask the AI to run `clickhouse_upgrade` and choose Pro or Pro+, billed monthly or yearly: it returns a Stripe Checkout link. If you already have Pro, ask to change it to Pro+. After you confirm, your existing subscription changes in place, keeps its billing interval and charges the price difference for the rest of the period immediately. To cancel, run `clickhouse_cancel_subscription`. Your paid plan continues to the end of the paid period. ### What if a ClickHouse tool that I need is missing? Tell the AI what you wanted to do. It can send the request with `clickhouse_request_feature`. We store the text with the server name, the type of AI client and the tool you tried, not with your account, and read every request when we plan new tools. You can send up to 5 requests per day. ### Which AI clients can I use? Any client that supports remote MCP servers (Streamable HTTP) with OAuth login: Claude (web and desktop), Claude Code, ChatGPT, Codex, Perplexity, Cursor, VS Code, Windsurf and others. ## Links - [ClickHouse MCP server page](https://usefulapi.io/clickhouse/) - [All servers](https://usefulapi.io/llms.txt) - [Terms of Service](https://usefulapi.io/terms/) - [Privacy Policy](https://usefulapi.io/privacy/) - Support: support@usefulapi.io