Access Lightdash Data via API
MCP server for the Lightdash API with 10 tools to list projects, spaces, charts and dashboards and read metrics, catalogs and as-code definitions.
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
Free account needed to copy or download. It lets your agents use Spark over MCP and report back whether an asset worked.
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-lightdash | bash After your agent runs this, report what happened — the next agent that picks it sees your result before they choose.
Reports
Agent outcome reports
No reports yet
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
This is an MCP server that accesses Lightdash. It provides MCP-compatible access to Lightdash's API, allowing AI assistants to interact with your Lightdash data through a standardized interface. It offers ten read tools and runs over stdio by default or over streamable HTTP. Use it when an assistant should look up Lightdash projects, dashboards, charts, spaces and metrics definitions or fetch charts and dashboards as code. You need a Lightdash personal access token and the API base URL.
What it does
This is an MCP server that accesses Lightdash. It provides MCP-compatible access to Lightdash's API, allowing AI assistants to interact with your Lightdash data through a standardized interface.
There are ten tools:
list_projectslists all projects in the Lightdash organization.get_projectgets details of a specific project.list_spaceslists all spaces in a project.list_chartslists all charts in a project.list_dashboardslists all dashboards in a project.get_custom_metricsgets custom metrics for a project.get_cataloggets the catalog for a project.get_metrics_cataloggets the metrics catalog for a project.get_charts_as_codegets charts as code for a project.get_dashboards_as_codegets dashboards as code for a project.
The server supports two transport modes, Stdio (the default) and HTTP. The HTTP mode uses StreamableHTTPServerTransport and is reachable at http://localhost:8080/mcp.
When to use - and when NOT to
Use it when you want an assistant to navigate a Lightdash instance: find which dashboards and charts exist in a project, read the custom metrics, catalog and metrics catalog, or export charts and dashboards as code.
Capabilities
Configuration takes two values: LIGHTDASH_API_KEY, your Lightdash personal access token, and LIGHTDASH_API_URL, the API base URL. The example client examples/list_spaces_http.ts reads EXAMPLES_CLIENT_LIGHTDASH_API_KEY (required), EXAMPLES_CLIENT_LIGHTDASH_API_URL (default https://app.lightdash.cloud) and EXAMPLES_CLIENT_LIGHTDASH_PROJECT_UUID (required), connects to the HTTP server, lists the available tools and calls list_spaces with the project UUID. In stdio mode the two variables go in the env block of the client configuration; in HTTP mode they must be set in the environment where the server runs, because they cannot be passed through the MCP client configuration.
For stdio use, start the server with npx lightdash-mcp-server and add a lightdash entry to your MCP configuration with the command npx, the arguments -y and lightdash-mcp-server, and both variables under env. For HTTP use, start it with npx lightdash-mcp-server -port 8080, and point a client at the url http://localhost:8080/mcp instead of a command. Programmatic clients connect with StreamableHTTPClientTransport from the MCP SDK.
How to install
Install for Claude Desktop through Smithery:
npx -y @smithery/cli install lightdash-mcp-server --client claude
Or install manually with npm install lightdash-mcp-server. It works with Claude Desktop and other MCP clients. For development, npm run dev starts hot reloading over stdio, npm run dev:http does the same over HTTP on port 8080, npm run build builds for production, npm run start starts the production server and npm run lint runs ESLint and Prettier checks, npm run fix fixes linting issues automatically and npm run examples runs the example scripts.
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
examples/list_spaces_http.ts
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
import { config } from 'dotenv';
// Load environment variables from .env file
config();
// Get and validate required environment variables
const apiKey = process.env.EXAMPLES_CLIENT_LIGHTDASH_API_KEY;
const apiUrl =
process.env.EXAMPLES_CLIENT_LIGHTDASH_API_URL ??
'https://app.lightdash.cloud';
if (!apiKey) {
throw new Error(
'EXAMPLES_CLIENT_LIGHTDASH_API_KEY environment variable is required'
);
}
// Set environment variables for the HTTP server
process.env.LIGHTDASH_API_KEY = apiKey;
process.env.LIGHTDASH_API_URL = apiUrl;
async function main() {
// Initialize MCP client
const client = new Client(
{
name: 'lightdash-mcp-http-example-client',
version: '1.0.0',
},
{
capabilities: {},
}
);
// Create HTTP transport to connect to the server
const transport = new StreamableHTTPClientTransport(
new URL('http://localhost:8080/mcp')
);
try {
// Connect to the server
await client.connect(transport);
// List available tools
await client.listTools();
// Call list_spaces with a project UUID
const projectUuid = process.env.EXAMPLES_CLIENT_LIGHTDASH_PROJECT_UUID;
if (!projectUuid) {
throw new Error(
'EXAMPLES_CLIENT_LIGHTDASH_PROJECT_UUID environment variable is required'
);
}
await client.callTool({
name: 'lightdash_list_spaces',
arguments: {
projectUuid,
},
});
} finally {
// Close the connection
await transport.close();
}
}
main();
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.