LI

Lightdash MCP Server: Interactive BI Dashboard Access

Explore Lightdash BI dashboards on the MCP server for interactive data analysis, real-time insights, and collaborative reporting.

Quick Install
npx -y @syucream/lightdash-mcp-server

Overview

The Lightdash MCP Server exposes Lightdash BI dashboards through a Model Context Protocol (MCP) compatible API. It acts as a small adapter layer between Lightdash and tools or agents that understand MCP, translating dashboard metadata and visualizations into structured model context that can be consumed programmatically. This enables interactive data analysis workflows, real-time insights, and collaborative reporting driven by tooling such as LLMs, automation scripts, or custom dashboards.

For developers, the server simplifies embedding Lightdash context into external applications. Instead of scraping or building custom connectors, you can run this server alongside your analytics stack to provide standardized endpoints for discovery, metadata inspection, and data retrieval. Typical scenarios include integrating dashboards into chat assistants, automating report generation, or enabling reproducible, context-aware BI queries.

Features

  • MCP-compatible endpoints for dashboard discovery and metadata
  • Read-only access to Lightdash projects, dashboards, and charts
  • Real-time access to chart queries and results via Lightdash API
  • Optional dashboard and chart filtering for tenancy or security
  • Simple HTTP interface with health and readiness checks
  • Docker-friendly for deployment in containerized environments
  • Basic authentication support via Lightdash API key (proxying Lightdash auth)

Installation / Configuration

Prerequisites: Node.js (>=16) or Docker, and access to a running Lightdash instance with an API key.

Clone the repository:

git clone https://github.com/syucream/lightdash-mcp-server.git
cd lightdash-mcp-server

Install dependencies and run locally:

# Using npm
npm install
# Start with environment variables set
LIGHTDASH_HOST=https://my-lightdash.example.com \
LIGHTDASH_API_KEY=pk_XXXXX \
PORT=8080 \
node dist/server.js

Run with Docker:

# Build image
docker build -t lightdash-mcp-server .
# Run container
docker run -e LIGHTDASH_HOST=https://my-lightdash.example.com \
           -e LIGHTDASH_API_KEY=pk_XXXXX \
           -e PORT=8080 \
           -p 8080:8080 \
           lightdash-mcp-server

Environment variables

VariableRequiredDescription
LIGHTDASH_HOSTyesBase URL for your Lightdash instance (e.g. https://app.lightdash.com)
LIGHTDASH_API_KEYyesAPI key for authenticating requests to Lightdash
PORTnoPort for this MCP server (default: 8080)
DASHBOARD_ALLOWLISTnoComma-separated dashboard UUIDs to expose (optional)
LOG_LEVELnoLogging verbosity (e.g. info, debug)

Tip: Use a read-only Lightdash API key for safety. When deploying, place this service behind your network ACLs or API gateway.

Available Resources

Common HTTP endpoints exposed by the server (adjust base path as configured):

  • GET /health — returns 200 OK when server is running
  • GET /mcp/describe — high-level MCP information and capabilities
  • GET /mcp/models — list of available dashboard models (projects/dashboards)
  • GET /mcp/models/:id — metadata for a specific dashboard (charts, filters)
  • POST /mcp/execute — request execution of a chart/query and receive results
  • GET /dashboards — convenience list of dashboards proxied from Lightdash
  • GET /dashboards/:id — raw Lightdash dashboard payload

Example: fetch available models

curl -H "Authorization: Bearer pk_XXXXX" \
  "http://localhost:8080/mcp/models"

Example: execute a chart (POST body contains MCP-style execution spec)

curl -X POST http://localhost:8080/mcp/execute \
  -H "Content-Type: application/json" \
  -d '{
    "model_id": "dashboard-uuid",
    "chart_id": "chart-uuid",
    "filters": { "date_range": "30d" }
  }'

Use Cases

  • LLM-driven data assistants: Provide an LLM with MCP model context so it can answer questions grounded in your Lightdash dashboards (e.g., “What was revenue last quarter?”) without manual context assembly.
  • Automated reporting: Periodically invoke /mcp/execute to pull chart results, format them, and distribute as daily summaries or scheduled reports.
  • Embedded analytics in apps: Use /mcp/models to fetch dashboard structure and render lightweight, interactive views in a web or mobile app that mirror Lightdash content.
  • Alerting and monitoring: Attach automation that queries key charts and raises alerts when metrics exceed thresholds (e.g., drop in conversion rate).
  • Collaborative analysis: Share a model descriptor with teammates or tools so everyone operates on the same dashboard metadata and query definitions.

Security note: The server forwards requests to Lightdash using the configured API key. Limit exposure, use least-privilege API keys, and consider network-level protections or API gateway authentication for production deployments.

For the full code, issues, and contribution guidelines, see the project repository on GitHub: https://github.com/syucream/lightdash-mcp-server.