Access Lightdash Data via API
MCP server giving AI assistants access to Lightdash projects, charts, dashboards, and metrics catalogs, in both stdio and HTTP modes.
Maintainer of this project? Claim this page to edit the listing.
0.0.12Add to Favorites
Why it matters
Integrate your AI assistants with Lightdash data. This MCP server provides a standardized interface to interact with your Lightdash projects, enabling AI to query and analyze your business intelligence.
Outcomes
What it gets done
List and retrieve details for Lightdash projects, spaces, charts, and dashboards.
Access custom metrics and project catalogs.
Export charts and dashboards as code.
Connect AI assistants to your Lightdash instance using PAT authentication.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-lightdash | bash Capabilities
Tools your agent gets
Get a list of all projects in your Lightdash organization
Get detailed information about a specific project
Get a list of all spaces in a project
Get a list of all charts in a project
Get a list of all dashboards in a project
Get custom metrics for a project
Get the catalog for a project
Get the metrics catalog for a project
Overview
Lightdash MCP Server
Gives AI assistants 10 tools to browse Lightdash projects, spaces, charts, dashboards, custom metrics, and catalogs, including exporting charts and dashboards as code, over stdio or HTTP transport. Use when an assistant needs to reference or browse existing Lightdash BI content; requires a Lightdash personal access token and API URL for an existing Lightdash deployment.
What it does
lightdash-mcp-server provides MCP-compatible access to Lightdash's API, letting an AI assistant interact with a Lightdash organization's BI content through a standardized interface. It exposes 10 tools: list_projects lists all projects in the organization, get_project gets details of a specific project, list_spaces lists all spaces in a project, list_charts and list_dashboards list a project's charts and dashboards, get_custom_metrics retrieves a project's custom metrics, get_catalog and get_metrics_catalog retrieve the general and metrics-specific catalogs for a project, and get_charts_as_code/get_dashboards_as_code retrieve a project's charts and dashboards represented as code.
The server supports two transport modes. Stdio (the default) starts the server via npx lightdash-mcp-server and is configured with command/args in an MCP client's configuration, with LIGHTDASH_API_KEY and LIGHTDASH_API_URL passed through the client's env block. HTTP transport starts the server with a -port flag, exposing it as a StreamableHTTPServerTransport endpoint at http://localhost:<port>/mcp; in this mode the client configuration uses a bare url field instead of command/args, and the API key and URL must instead be set as environment variables in the environment where the server itself runs, since they cannot be passed through the client configuration in HTTP mode. Programmatic HTTP access uses the MCP SDK's StreamableHTTPClientTransport pointed at the server's /mcp endpoint.
When to use - and when NOT to
Use this when an AI assistant needs to browse or reference a team's Lightdash projects, spaces, charts, dashboards, or metrics definitions - for example listing what dashboards exist in a project, pulling a project's metrics catalog, or exporting charts and dashboards as code for review. It requires a Lightdash Personal Access Token and API base URL to authenticate, so it depends on an existing Lightdash deployment and account rather than working standalone.
How to install
Installation via Smithery for Claude Desktop:
npx -y @smithery/cli install lightdash-mcp-server --client claude
Or manually:
npm install lightdash-mcp-server
Configuration requires LIGHTDASH_API_KEY (a Lightdash personal access token) and LIGHTDASH_API_URL (the Lightdash API base URL). For development, available scripts include hot-reloading dev modes for both stdio (npm run dev) and HTTP (npm run dev:http) transports, a production build (npm run build), linting via ESLint and Prettier (npm run lint, npm run fix), and a runnable examples script - the repository includes a complete example of connecting to the HTTP server programmatically in examples/list_spaces_http.ts.
Who it's for
Analytics and data teams using Lightdash who want an AI assistant to browse projects, charts, dashboards, and metrics catalogs, or pull chart/dashboard definitions as code, without leaving the assistant's interface.
Source README
lightdash-mcp-server
A MCP(Model Context Protocol) server that accesses to Lightdash.
This server provides MCP-compatible access to Lightdash's API, allowing AI assistants to interact with your Lightdash data through a standardized interface.
Features
Available tools:
list_projects- List all projects in the Lightdash organizationget_project- Get details of a specific projectlist_spaces- List all spaces in a projectlist_charts- List all charts in a projectlist_dashboards- List all dashboards in a projectget_custom_metrics- Get custom metrics for a projectget_catalog- Get catalog for a projectget_metrics_catalog- Get metrics catalog for a projectget_charts_as_code- Get charts as code for a projectget_dashboards_as_code- Get dashboards as code for a project
Quick Start
Installation
Installing via Smithery
To install Lightdash MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install lightdash-mcp-server --client claude
Manual Installation
npm install lightdash-mcp-server
Configuration
LIGHTDASH_API_KEY: Your Lightdash PATLIGHTDASH_API_URL: The API base URL
Usage
The lightdash-mcp-server supports two transport modes: Stdio (default) and HTTP.
Stdio Transport (Default)
- Start the MCP server:
npx lightdash-mcp-server
- Edit your MCP configuration json:
...
"lightdash": {
"command": "npx",
"args": [
"-y",
"lightdash-mcp-server"
],
"env": {
"LIGHTDASH_API_KEY": "<your PAT>",
"LIGHTDASH_API_URL": "https://<your base url>"
}
},
...
HTTP Transport (Streamable HTTP)
- Start the MCP server in HTTP mode:
npx lightdash-mcp-server -port 8080
This starts the server using StreamableHTTPServerTransport, making it accessible via HTTP at http://localhost:8080/mcp.
- Configure your MCP client to connect via HTTP:
For Claude Desktop and other MCP clients:
Edit your MCP configuration json to use the url field instead of command and args:
...
"lightdash": {
"url": "http://localhost:8080/mcp"
},
...
For programmatic access:
Use the streamable HTTP client transport:
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
const client = new Client({
name: 'my-client',
version: '1.0.0'
}, {
capabilities: {}
});
const transport = new StreamableHTTPClientTransport(
new URL('http://localhost:8080/mcp')
);
await client.connect(transport);
Note: When using HTTP mode, ensure the environment variables LIGHTDASH_API_KEY and LIGHTDASH_API_URL are set in the environment where the server is running, as they cannot be passed through MCP client configuration.
See examples/list_spaces_http.ts for a complete example of connecting to the HTTP server programmatically.
Development
Available Scripts
npm run dev- Start the server in development mode with hot reloading (stdio transport)npm run dev:http- Start the server in development mode with HTTP transport on port 8080npm run build- Build the project for productionnpm run start- Start the production servernpm run lint- Run linting checks (ESLint and Prettier)npm run fix- Automatically fix linting issuesnpm run examples- Run the example scripts
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.