Skip to main content
Run the complete Agentic Data Stack locally with Docker Compose to ask questions of your data from the first login. One docker compose up command brings up LibreChat, the ClickHouse MCP server, ClickHouse, and Langfuse for observability.

Prerequisites

  • Docker with the Compose plugin (Compose v2 or later).
  • Git, to clone the repository.
  • A model provider API key (such as OpenAI, Anthropic, or Google). The agent needs a model to answer questions, so supply a key during setup or add one in the LibreChat UI before your first chat.

Stand up the stack

1

Clone the repository

git clone https://github.com/ClickHouse/agentic-data-stack
cd agentic-data-stack
The repository ships with a top-level docker-compose.yml, so the whole stack comes up with a single command. See Architecture for the full list of services.
2

Run the demo setup script

./scripts/prepare-demo.sh
This generates a .env file with credentials for every service, then offers an interactive menu to configure API keys for a chosen provider. You can also set these keys directly in the .env file. Any provider you skip stays set to user_provided, so you can add your own key in the LibreChat UI instead.On first startup, the stack creates an admin user from .env. The default login is admin@admin.com / password.
Run generate-env.sh with these variables before prepare-demo.sh:
USER_EMAIL="you@example.com" USER_PASSWORD="supersecret" USER_NAME="YourName" ./scripts/generate-env.sh
prepare-demo.sh then sees the existing .env and goes straight to API-key configuration.
3

Start the services in the background

docker compose up -d
Startup is ordered automatically. LibreChat boots only after the MCP server is healthy, so its connection to ClickHouse is ready on first load.
4

Open LibreChat and sign in

Once the stack is up, the services are available in your browser:Sign in to LibreChat with the admin credentials from your .env file.
5

Select a model

A model is selected by default. If you want to change it, open the model selector and choose the one you want to use.If you didn’t set a provider key during setup, add one in the UI.
Open the model selector and click Set API Key next to the provider.Paste your key in the dialog and click Submit. You can set an expiration, or keep the key from expiring.
6

Select the MCP server

The stack preconfigures its MCP servers in LibreChat’s librechat.yaml. In the message composer, click MCP Servers and select ClickHouse-Local.Select ClickHouse-Cloud instead to use a ClickHouse Cloud service.
7

Ask your first question

For example:
What databases and tables are available, and how many rows are in the largest table?
The agent uses the MCP server’s tools to list databases and tables, run read-only queries against ClickHouse, and build an answer from the results. You don’t need to write SQL.

Stop or reset the stack

Stop the services without deleting anything:
docker compose down
To tear down all containers and wipe every volume for a clean start, use the stack’s reset script:
./scripts/reset-all.sh

Architecture

docker-compose.yml is a thin entrypoint that includes four Compose files:
Compose fileDefines
langfuse-compose.ymlLangfuse and its backing services (ClickHouse, PostgreSQL, Redis, MinIO)
clickhouse-mcp-compose.ymlThe ClickHouse MCP server
librechat-compose.ymlLibreChat and its backing services (MongoDB, Meilisearch, pgvector, RAG API)
admin-panel-compose.ymlThe LibreChat Admin Panel
Two details make the single-command startup work:
  • Health checks and start order. Compose uses health checks to sequence startup. The MCP server waits for ClickHouse, and LibreChat waits for the MCP server.
  • Shared environment file. The .env holds each service’s credentials and connection values, set consistently so the services can reach each other. For example, the MCP server connects to ClickHouse with the ClickHouse credentials from .env. LibreChat is given LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, and LANGFUSE_BASE_URL, so every run is traced to Langfuse out of the box.
ClickHouse plays two roles in the stack: it’s both Langfuse’s storage backend and the database your agent queries through the MCP server.

Next steps

Last modified on June 12, 2026