# Sloan / Guides / Clickhouse Chat Documentation – Python ## Included Files 1. sloan/guides/clickhouse-chat/clickhouse-chat.mdx ## clickhouse-chat Source: sloan/guides/clickhouse-chat/clickhouse-chat.mdx ## Quickstart: AI Chat with ClickHouse *Use your LLM client to explore your ClickHouse with Sloan MCP tools.* This will walk you through using Sloan CLI to connect Sloan MCP tools to your ClickHouse database, allowing you to chat with your data in your client of choice. We'll use the ClickHouse Playground as our example database, but you can use any ClickHouse database. - **OS**: macOS or Linux (WSL supported for Windows) - **Node**: [version 20+](https://nodejs.org/en/download) (LTS recommended) - **Client**: [Cursor](https://www.cursor.com/) or [Claude Desktop](https://claude.ai/download) or [Windsurf](https://windsurf.ai/download). For this particular use-case, we recommend Claude Desktop. ### Install Sloan CLI ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan ``` ### Configure your Sloan MCP ```bash filename="Terminal" copy sloan connect clickhouse --connection-string "https://explorer:@play.clickhouse.com:443/?database=default" --mcp cursor-project ``` You need a ClickHouse connection URL. Format looks like this: ``` http://username:password@host:port/?database=database_name ``` Want to test without your own ClickHouse? Use the [ClickHouse Playground](https://clickhouse.com/docs/getting-started/playground) with the connection string above. It has sample datasets (read-only) you can experiment with. ```txt copy https://explorer:@play.clickhouse.com:443/?database=default ``` 1. Log into your [ClickHouse Cloud console](https://clickhouse.cloud/) 2. Go to your service details page 3. Find "Connect" or "Connection Details" section 4. Copy the HTTPS endpoint and your username/password - Check your ClickHouse config file (usually `/etc/clickhouse-server/config.xml`) - Look for `` (default: 8123) and `` (default: 8443) - Check users config in `/etc/clickhouse-server/users.xml` or users.d/ directory - Default user is often `default` with no password - Check your docker-compose.yml or docker run command for environment variables - Look for `CLICKHOUSE_USER`, `CLICKHOUSE_PASSWORD`, `CLICKHOUSE_DB` - Default is usually `http://default:@localhost:8123/?database=default` - **Can't connect?** Try `curl http://your-host:8123/ping` to test connectivity - **Authentication failed?** Verify username/password with `clickhouse-client --user=username --password=password` - **Database not found?** Run `SHOW DATABASES` to see available databases - **Permission denied?** Check user permissions with `SHOW GRANTS FOR username` **Still stuck?** Check the [ClickHouse documentation](https://clickhouse.com/docs/en/getting-started/install) for your specific deployment method. ### Chat Open your Claude Desktop client. We recommend starting the chat with a context setting question like "tell me about the data I have available to me in ClickHouse". You can check that the MCP is correctly configured by looking at `claude > settings > developer > sloan`. It should say "running". You can can also look at `search and tools` beneath the chat window, you should see `sloan` in the list of MCPs—if you click into it, you should see the tools that are enabled. ### What's next? Try [creating a Moose Project from your ClickHouse database](https://docs.fiveonefour.com/sloan/quickstart/clickhouse-proj). That way, you can use Sloan MCP tools to create new primitives, like ingestion paths, data models, egress APIs, and more! Or try [deploying your project to Boreal](https://www.fiveonefour.com/boreal), our hosting platform for Moose projects. ## Other Quickstart Guides