lightdash-analytics

Query governed metrics and create charts through the Lightdash MCP server.

6.1k|768|Updated Mar 19, 2021
One-click install
npx skills add https://github.com/lightdash/lightdash --skill lightdash-analytics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lightdash-analytics
Source: https://github.com/lightdash/lightdash/tree/main/plugins/lightdash/skills/lightdash-analytics
Command: npx skills add https://github.com/lightdash/lightdash --skill lightdash-analytics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Business questions often require querying a governed semantic layer rather than raw tables, and doing this manually risks inventing wrong metric names, field IDs, or filter values. This Skill guides an AI agent to discover explores, run validated metric queries, and create charts and dashboards through the Lightdash MCP server without bypassing governance.

Core Features & Use Cases

  • Governed metric queries: Discover explores and fields first, then run metric queries against the Lightdash semantic layer instead of guessing raw SQL.
  • Chart and dashboard creation: Inspect existing content, validate queries, and create charts or dashboards through the server's creation workflow.
  • Content-as-code workflow: For dbt or BI-as-code changes, work in a branch with the Lightdash CLI to preview, validate, review, and merge changes.
  • Use Case: A product manager asks "What was weekly revenue by region last quarter?" The agent lists explores, inspects fields, runs a metric query, polls for the result, and renders a chart with the metric, time period, and filters stated.

Quick Start

Ask the agent to answer a business question using the Lightdash MCP server, for example to show monthly active users by plan tier as a chart.

Frequently Asked Questions about lightdash-analytics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Lightdash metrics with an AI agent?

Use the Lightdash MCP server to list available explores, inspect the fields, then run a metric query with run_metric_query. Always discover the schema first rather than inventing explore names, field IDs, or filter values.

How do I create a Lightdash chart or dashboard programmatically?

Inspect the relevant schema and existing content first, validate the query, then use the MCP server's creation workflow. You can render a completed metric query as a chart with render_chart.

When should I use run_sql instead of a metric query in Lightdash?

Prefer run_metric_query for anything the semantic layer can express. Use run_sql only when the requested analysis cannot be represented through a governed explore, since raw SQL bypasses the governed metric definitions.

What happens if a Lightdash metric query is still running?

Poll get_query_result with the returned query UUID until the query completes. An empty result should be treated as a valid answer, not a failed query.

Can I make dbt or content-as-code changes through Lightdash?

Yes, work in a branch and use the Lightdash CLI workflow: preview the change, validate it, review it, then merge. Do not deploy or start AI writeback unless the user explicitly requests that external change.