# How to connect ClickHouse to Claude

```json
{
  "title": "How to connect ClickHouse to Claude",
  "toolkit": "ClickHouse",
  "toolkit_slug": "clickhouse",
  "framework": "Claude Cowork",
  "framework_slug": "claude-cowork",
  "url": "https://composio.dev/toolkits/clickhouse/framework/claude-cowork",
  "markdown_url": "https://composio.dev/toolkits/clickhouse/framework/claude-cowork.md",
  "updated_at": "2026-11-06T09:00:53.791Z"
}
```

## Introduction

Claude is Anthropic's AI assistant, available on the web, in the desktop app, and on mobile. Cowork is its agent for knowledge work, and it runs on all of those surfaces too. Connected to your apps, Claude can work with your files and services to accomplish complex tasks on your behalf.
This guide walks you through the easiest and most secure way to connect your ClickHouse account to Claude via Composio Connect, enabling it to show total user signups for last week, summarize top 5 products by revenue, insert a new sales record into database, and more such actions on your behalf without compromising your account security.
Setup is the same on Claude Web, Desktop, and Cowork, and you only need to do it once. The connector is tied to your account, so it's available in all three.

## Also integrate ClickHouse with

- [Claude Code](https://composio.dev/toolkits/clickhouse/framework/claude-code)
- [Cursor](https://composio.dev/toolkits/clickhouse/framework/cursor)
- [ChatGPT](https://composio.dev/toolkits/clickhouse/framework/chatgpt)
- [Antigravity](https://composio.dev/toolkits/clickhouse/framework/antigravity)
- [OpenAI Agents SDK](https://composio.dev/toolkits/clickhouse/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/clickhouse/framework/claude-agents-sdk)
- [Codex](https://composio.dev/toolkits/clickhouse/framework/codex)
- [Grok Build](https://composio.dev/toolkits/clickhouse/framework/grok-build)
- [VS Code](https://composio.dev/toolkits/clickhouse/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/clickhouse/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/clickhouse/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/clickhouse/framework/hermes-agent)
- [Atomic Agent](https://composio.dev/toolkits/clickhouse/framework/atomic-agent)
- [Google ADK](https://composio.dev/toolkits/clickhouse/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/clickhouse/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/clickhouse/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/clickhouse/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/clickhouse/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/clickhouse/framework/crew-ai)
- [Pydantic AI](https://composio.dev/toolkits/clickhouse/framework/pydantic-ai)
- [AutoGen](https://composio.dev/toolkits/clickhouse/framework/autogen)

## Connect ClickHouse to Claude Cowork

### Connecting ClickHouse to Claude Web, Desktop, and Cowork
Two ways to add the Composio connector. Pick whichever you prefer.
### 1. Add with one click
Click the button. Claude opens with the Composio connector filled in. Click Add, then go to step 2.
[Add to Claude](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Composio&connectorUrl=https%3A%2F%2Fconnect.composio.dev%2Fmcp)
### Add manually
In Claude Desktop, click Customize in the left sidebar, then select Connectors and click the + icon at the top.
Click Add custom connector and paste in the Composio MCP server URL:

```bash
https://connect.composio.dev/mcp
```

## What is the ClickHouse MCP server, and what's possible with it?

The ClickHouse MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your ClickHouse account. It provides structured and secure access to your databases, tables, schemas, and analytical data, so your agent can discover databases, list tables, inspect schemas, and run SQL queries on your behalf.
- Database discovery: Have your agent list the databases available in your ClickHouse instance before starting an analysis.
- Table exploration: Let the agent list tables across your ClickHouse databases to find the data needed for a task.
- Database schema review: Direct your agent to review a complete database schema, including its tables and optional column definitions.
- Detailed table inspection: Instruct your agent to examine a table's columns, data types, keys, and optional sample data before writing SQL.
- SQL query execution: Have your agent run SQL queries and return the results for real-time analytics and big data analysis.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `CLICKHOUSE_EXECUTE_QUERY` | Execute ClickHouse Query | Execute a SQL query in ClickHouse, including statements that can modify data or schema, and return its results. JSONEachRow results have synthesized statistics; other non-JSON formats are returned as text in a single result row. |
| `CLICKHOUSE_GET_DATABASE_SCHEMA` | Get Database Schema | Get a schema overview of a ClickHouse database, including its tables and optionally their column definitions. Requested column definitions may be unavailable if the column lookup fails. |
| `CLICKHOUSE_GET_PLAY_INTERFACE` | Get ClickHouse Play Interface | Get the ClickHouse Play web user interface for interactive query execution. Returns HTML page with Monaco Editor for writing queries and visualizing results. |
| `CLICKHOUSE_GET_TABLE_SCHEMA` | Get Table Schema | Get detailed schema information for a specific table including column definitions, types, keys, and optionally sample data. This is essential for AI agents to understand table structure before constructing queries. |
| `CLICKHOUSE_LIST_DATABASES` | List ClickHouse Databases | List all databases in the ClickHouse instance. Useful for discovering available databases before querying tables. |
| `CLICKHOUSE_LIST_TABLES` | List ClickHouse Tables | List tables in ClickHouse databases. Returns information about tables including their engine, size, and row count. |

## Supported Triggers

None listed.

## Troubleshooting

### 1. Why does Claude not use the Composio connector for ClickHouse?

The connector can show as connected, but Claude must use it in each ClickHouse conversation.
- Click + at the lower left of the chat, or type /.
- Hover Connectors.
- Turn on Composio.
- Ask Claude to connect to ClickHouse again.

### 2. Why does Claude show an MCP server error before ClickHouse connects?

Claude can show Couldn't reach the MCP server or Authorization with the MCP server failed when you add the connector for ClickHouse.
- Check that the connector URL is https://connect.composio.dev/mcp.
- Connectors run from Anthropic's cloud, so your device network is usually not the problem.
- Add the connector again from Customize > Connectors, then ask Claude to connect ClickHouse.
- If it fails again, send the error and the ofid_ reference id to support@composio.dev.

### 3. Why does the ClickHouse authorization link not work?

The Composio connector is one server. Your ClickHouse account connects separately when Claude asks for it.
- If the browser does not open, or the link expires, ask Claude to retry the ClickHouse connection.
- Composio creates a fresh ClickHouse authorization link.
- Open that link in your browser and finish the ClickHouse sign-in.

### 4. Why do ClickHouse actions fail after they worked before?

The ClickHouse connection can expire or lose permission.
- Ask Claude to inspect the ClickHouse connection.
- If the connection is unhealthy, disconnect it when Claude prompts you.
- Reconnect the ClickHouse account and retry the action.
- If Claude shows a permission prompt, approve it before Claude changes data in ClickHouse.
- If the action still fails with a permission error, check that the connected account has that permission in ClickHouse itself.

### 5. How do I switch to a different ClickHouse account?

Claude can manage the ClickHouse connection for you.
- Ask Claude to disconnect or delete the current ClickHouse account.
- Ask Claude to connect ClickHouse again.
- Open the new Composio authorization link for ClickHouse.
- Sign in with the other ClickHouse account in the browser.
- After the account connects, ask Claude to retry the ClickHouse task.

### 6. Why is my ClickHouse connection missing in Claude Desktop or on a Team plan?

The connector belongs to your Claude account, so your ClickHouse connection works in Claude Web, Desktop, and Cowork.
- In Claude Desktop, open Customize > Connectors.
- Next to Composio, click ⋮ and click Clear cache.
- If ClickHouse tools still do not appear, click ⋮, disconnect, remove the connector, and add it again.
- On Team or Enterprise, an Owner or Primary Owner must enable the connector before you can connect ClickHouse.

## Creating MCP Server - Stand-alone vs Composio SDK

The ClickHouse MCP server connects Claude Web, Desktop, and Cowork to your ClickHouse account through Composio. Once connected, Claude can use the available ClickHouse tools and triggers to complete tasks on your behalf.

## Complete Code

None listed.

## How to build ClickHouse MCP Agent with another framework

- [Claude Code](https://composio.dev/toolkits/clickhouse/framework/claude-code)
- [Cursor](https://composio.dev/toolkits/clickhouse/framework/cursor)
- [ChatGPT](https://composio.dev/toolkits/clickhouse/framework/chatgpt)
- [Antigravity](https://composio.dev/toolkits/clickhouse/framework/antigravity)
- [OpenAI Agents SDK](https://composio.dev/toolkits/clickhouse/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/clickhouse/framework/claude-agents-sdk)
- [Codex](https://composio.dev/toolkits/clickhouse/framework/codex)
- [Grok Build](https://composio.dev/toolkits/clickhouse/framework/grok-build)
- [VS Code](https://composio.dev/toolkits/clickhouse/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/clickhouse/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/clickhouse/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/clickhouse/framework/hermes-agent)
- [Atomic Agent](https://composio.dev/toolkits/clickhouse/framework/atomic-agent)
- [Google ADK](https://composio.dev/toolkits/clickhouse/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/clickhouse/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/clickhouse/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/clickhouse/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/clickhouse/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/clickhouse/framework/crew-ai)
- [Pydantic AI](https://composio.dev/toolkits/clickhouse/framework/pydantic-ai)
- [AutoGen](https://composio.dev/toolkits/clickhouse/framework/autogen)

## Related Toolkits

- [Firecrawl](https://composio.dev/toolkits/firecrawl) - Firecrawl automates large-scale web crawling and data extraction. It helps organizations efficiently gather, index, and analyze content from online sources.
- [Tavily](https://composio.dev/toolkits/tavily) - Tavily offers powerful search and data retrieval from documents, databases, and the web. It helps teams locate and filter information instantly, saving hours on research.
- [Exa](https://composio.dev/toolkits/exa) - Exa is a data extraction and search platform for gathering and analyzing information from websites, APIs, or databases. It helps teams quickly surface insights and automate data-driven workflows.
- [Serpapi](https://composio.dev/toolkits/serpapi) - SerpApi is a real-time API for structured search engine results. It lets you automate SERP data collection, parsing, and analysis for SEO and research.
- [Excel](https://composio.dev/toolkits/excel) - Microsoft Excel is a robust spreadsheet application for organizing, analyzing, and visualizing data. It's the go-to tool for calculations, reporting, and flexible data management.
- [Peopledatalabs](https://composio.dev/toolkits/peopledatalabs) - Peopledatalabs delivers B2B data enrichment and identity resolution APIs. Supercharge your apps with accurate, up-to-date business and contact data.
- [Snowflake](https://composio.dev/toolkits/snowflake) - Snowflake is a cloud data warehouse built for elastic scaling, secure data sharing, and fast SQL analytics across major clouds.
- [Posthog](https://composio.dev/toolkits/posthog) - PostHog is an open-source analytics platform for tracking user interactions and product metrics. It helps teams refine features, analyze funnels, and reduce churn with actionable insights.
- [21risk](https://composio.dev/toolkits/_21risk) - 21RISK is a web app built for easy checklist, audit, and compliance management. It streamlines risk processes so teams can focus on what matters.
- [Abstract](https://composio.dev/toolkits/abstract) - Abstract provides a suite of APIs for automating data validation and enrichment tasks. It helps developers streamline workflows and ensure data quality with minimal effort.
- [AccuWeather](https://composio.dev/toolkits/accu_weather) - AccuWeather is a global weather service providing current conditions, forecasts, MinuteCast precipitation, alerts, and lightning data. Use it for fast, localized forecasts and real-time weather alerts.
- [Adafruit IO](https://composio.dev/toolkits/adafruit_io) - Adafruit IO is Adafruit's cloud platform for connected device and IoT project data. It helps you store, visualize, and act on sensor feeds without running your own backend.
- [Addressfinder](https://composio.dev/toolkits/addressfinder) - Addressfinder is a data quality platform for verifying addresses, emails, and phone numbers. It helps you ensure accurate customer and contact data every time.
- [Agentql](https://composio.dev/toolkits/agentql) - Agentql is a toolkit that connects AI agents to the web using a specialized query language. It enables structured web interaction and data extraction for smarter automations.
- [Agenty](https://composio.dev/toolkits/agenty) - Agenty is a web scraping and automation platform for extracting data and automating browser tasks—no coding needed. It streamlines data collection, monitoring, and repetitive online actions.
- [Ahrefs MCP](https://composio.dev/toolkits/ahrefs_mcp) - Ahrefs MCP is Ahrefs' hosted MCP server for SEO data and insights. Use it to access backlinks, organic metrics, keyword research, and competitor analysis.
- [Ambee](https://composio.dev/toolkits/ambee) - Ambee is an environmental data platform providing real-time, hyperlocal APIs for air quality, weather, and pollen. Get precise environmental insights to power smarter decisions in your apps and workflows.
- [Ambient weather](https://composio.dev/toolkits/ambient_weather) - Ambient Weather is a platform for personal weather stations with a robust API for accessing local, real-time, and historical weather data. Get detailed environmental insights directly from your own sensors for smarter apps and automations.
- [Amplitude](https://composio.dev/toolkits/amplitude) - Amplitude is a digital analytics platform for product and behavioral data insights. It helps teams analyze user journeys and make data-driven decisions quickly.
- [Amplitude MCP](https://composio.dev/toolkits/amplitude_mcp) - Amplitude MCP is Amplitude's product analytics service for tracking user behavior and product metrics. Use it to centralize product data and manage charts, dashboards, cohorts, experiments, and taxonomy.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and ClickHouse MCP?

With a standalone ClickHouse MCP server, the agents and LLMs can only access a fixed set of ClickHouse tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from ClickHouse and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with Claude Cowork?

Yes, you can. Claude Cowork fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right ClickHouse tools.

### Can I manage the permissions and scopes for ClickHouse while using Tool Router?

Yes, absolutely. You can configure which ClickHouse scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your ClickHouse data and credentials are handled as safely as possible.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
