TL;DR
Analytics Dashboard is a monitoring workflow that chains ClickHouse + Grafana to automate a common task. Connect ClickHouse to Grafana to build real-time analytics dashboards over billions of events with sub-second query times. Once configured, it runs through Claude Code, Cursor, Windsurf or any MCP-compatible AI agent.
Analytics Dashboard
Connect ClickHouse to Grafana to build real-time analytics dashboards over billions of events with sub-second query times.
How it works
Local CLI only
None of these MCPs are hosted yet. Install and run the recipe locally:
mcpizy recipe install clickhouse-grafana-analyticsWhy this combo?
ClickHouse processes billions of events with sub-second aggregation performance; Grafana renders that data as interactive dashboards. Together they create a product analytics platform that scales to any event volume — without the licensing cost of Mixpanel or Amplitude.
Without this workflow
Query a Postgres events table for daily active users. Times out after 45 seconds. Roll up data with a cron job into an aggregation table. Forget to update the cron job when you add a new metric.
With MCPizy
ClickHouse materializes rollups in real time. Grafana dashboard loads in under a second regardless of event volume.
Business value
Concrete ROI — not marketing fluff.
Time saved
- Product teams iterate on funnels live: sub-second queries enable 'what-if' exploration during standups
- Anomaly alerts catch broken tracking pixels within minutes — protects attribution data worth millions in ad spend decisions
- Full ownership of raw event data — no vendor lock-in, no quota surprises, no data silos
Workflow steps
- 1Configure ClickHouse Grafana data source
- 2Design materialized view for rollup metrics
- 3Build time-series panels for event volume
- 4Add funnel and retention panels
- 5Set alert on anomalous drop in events
Use cases
- Real-time DAU/WAU/MAU dashboards over raw event streams
- Funnel analysis that refreshes as conversions happen
- Anomaly detection alerting on event volume drops (e.g. tracking pixel down)
- Retention cohort analysis over months of behavioral data
Agent prompt (copy into Claude Code)
This prompt is the workflow. Paste into Claude Code, Cursor, or Windsurf.
You are an analytics-dashboard agent. Runs ad-hoc to set up or refresh Grafana analytics. Given an events table in ClickHouse: 1. Call clickhouse.describe_table(db, table) to get schema (event_name, user_id, timestamp, properties) 2. Generate materialized views for common rollups: - dau_mv: SELECT toDate(ts), uniqExact(user_id) GROUP BY day - funnel_mv: windowFunnel for a configurable set of events - retention_mv: retention function per cohort 3. Call clickhouse.execute(sql) to create/replace each MV with appropriate engine (AggregatingMergeTree) 4. Call grafana.create_dashboard via API with panels: - DAU/WAU/MAU time-series - Funnel conversion bars - Retention cohort heatmap - Event volume with anomaly band 5. Set alert on event_volume 1h drop > 40% vs 7d avg Use Grafana's clickhouse plugin for live queries (no pre-aggregation in Grafana).
Trigger & credentials
How this workflow fires and what env vars you need.
Run in Claude Code to bootstrap dashboards, then rely on Grafana for continuous queries
CLICKHOUSE_URLClickHouse HTTP endpoint
e.g. https://clickhouse.company.com:8443
CLICKHOUSE_USERClickHouse user with SELECT + CREATE MATERIALIZED VIEW
e.g. analytics
CLICKHOUSE_PASSWORDClickHouse password
e.g. change-me
CLICKHOUSE_DATABASETarget database name
e.g. events
GRAFANA_URLGrafana server URL
e.g. https://grafana.company.com
One-command deploy
Install everything — MCPs, prompt, env template — in a single call.
$ mcpizy recipe install clickhouse-grafana-analytics ✓ Installs all 2 MCP servers ✓ Writes prompt to ~/.mcpizy/prompts/clickhouse-grafana-analytics.md ✓ Generates .env.example in current directory ✓ Ready to paste into Claude Code
Requires mcpizy CLI v1.1+ — install via npm i -g mcpizy.
Quick install (MCPs only)
$ mcpizy install clickhouse && mcpizy install grafanaMore Monitoring recipes
Database Change Alerts
Get a Slack alert whenever a critical Supabase table row is created, updated, or deleted — ideal for audit trails.
Error Alerting Pipeline
Sentry new issues are de-duplicated, enriched with commit info, and routed to the right Slack channel based on project.
Database Monitoring Dashboard
Stream Postgres metrics — query latency, lock waits, vacuum stats — into Grafana for a live operations dashboard.
Alert Routing from Grafana
Grafana alerts are enriched with runbook links and routed to the correct Slack channel based on severity and team labels.
Frequently asked questions
What is this workflow?
Analytics Dashboard is a monitoring automation that uses ClickHouse + Grafana together via the Model Context Protocol. Connect ClickHouse to Grafana to build real-time analytics dashboards over billions of events with sub-second query times.
How long does setup take?
Setup takes around 30 min setup, sub-second analytics at any scale. You install the required MCP servers with `mcpizy install clickhouse && mcpizy install grafana`, connect your accounts, and the workflow is ready to run.
What does this workflow change in practice?
Product teams iterate on funnels live: sub-second queries enable 'what-if' exploration during standups; Anomaly alerts catch broken tracking pixels within minutes — protects attribution data worth millions in ad spend decisions.
Which MCP servers do I need for this?
You need 2 MCP servers: ClickHouse (mcpizy install clickhouse), Grafana (mcpizy install grafana). All are installable in one command via the MCPizy CLI and configured in your `.claude.json` or `.cursor/mcp.json`.
Does this work with Claude Code, Cursor, and Windsurf?
Yes. The workflow runs with any MCP-compatible AI agent — Claude Code, Claude Desktop, Cursor, Windsurf, VS Code with Copilot, and custom agents built on the MCP SDK. The MCP servers are identical across clients; only the config file path (`.claude.json` vs `.cursor/mcp.json`) changes.
Start building this workflow
Install the required MCPs from the directory and automate this in 30 min setup.
$ mcpizy install clickhouse && mcpizy install grafana
Free to install. Connect your accounts and this workflow runs itself.