Lightdash MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Lightdash MCP Servershow me the top 10 customers by revenue"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Lightdash MCP Server
Connect Claude, Cursor, and other AI assistants to your Lightdash analytics using the Model Context Protocol (MCP).
A Model Context Protocol (MCP) server for interacting with Lightdash, enabling LLMs to discover data, create charts, and manage dashboards programmatically.
Features
This MCP server provides a comprehensive set of tools for the full data analytics workflow:
Discovery: Explore data catalogs, find tables/explores, and understand schemas
Querying: Execute queries with full filter, metric, and aggregation support
Chart Management: Create, read, update, and delete charts with complex visualizations
Dashboard Management: Build and manage dashboards with tiles, filters, and layouts
Resource Organization: Create and manage spaces for content organization
Related MCP server: Cursor DB MCP Server
Installation
Prerequisites
Python 3.10+
A Lightdash instance (Cloud or self-hosted)
Lightdash Personal Access Token (obtain from your Lightdash profile settings)
Quick Start with pip (Recommended)
pip install lightdash-mcpQuick Start with uvx
uvx lightdash-mcpQuick Start with pipx
pipx run lightdash-mcpInstall from Source
git clone https://github.com/poddubnyoleg/lightdash_mcp.git
cd lightdash_mcp
pip install .Google Cloud IAP Support
If your Lightdash instance is behind Google Cloud Identity-Aware Proxy (e.g. Cloud Run with --iap), install with the iap extra:
pip install lightdash-mcp[iap]
# or from source
pip install .[iap]Set IAP_ENABLED=true. The server will sign a JWT (audience {LIGHTDASH_URL}/*) via the IAM Credentials API and attach it as Proxy-Authorization: Bearer <jwt> on every request. The Authorization: ApiKey header is preserved for Lightdash.
Both service account credentials and user credentials (Application Default Credentials / ADC) are supported:
Service account credentials (default in Cloud Run, GCE, etc.):
The runtime service account needs
roles/iam.serviceAccountTokenCreatoron itselfThe runtime service account needs
roles/iap.httpsResourceAccessoron the Cloud Run service
User credentials (ADC) (e.g. gcloud auth application-default login):
Set
IAP_SAto the service account email to impersonate for signing the JWTThe user needs
roles/iam.serviceAccountTokenCreatoron the target service accountThe target service account needs
roles/iap.httpsResourceAccessoron the Cloud Run service
Configuration
Environment Variables
The server requires the following environment variables:
Variable | Required | Description | Example |
| ✅ | Your Lightdash Personal Access Token |
|
| ✅ | Base URL of your Lightdash Instance |
|
| ❌ | Cloudflare Access Client ID (if behind CF Access) | - |
| ❌ | Cloudflare Access Client Secret (if behind CF Access) | - |
| ❌ | Default project UUID (falls back to first available project) |
|
| ❌ | Enable Google Cloud IAP authentication ( |
|
| ❌ | Service account email for IAP when using user credentials (ADC) |
|
Getting Your Lightdash Token
Log into your Lightdash instance
Go to Settings → Personal Access Tokens
Click Generate new token
Copy the token (starts with
ldt_)
Usage with Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"lightdash": {
"command": "uvx",
"args": ["lightdash-mcp"],
"env": {
"LIGHTDASH_TOKEN": "ldt_your_token_here",
"LIGHTDASH_URL": "https://app.lightdash.cloud",
"LIGHTDASH_PROJECT_UUID": "your-project-uuid"
}
}
}
}Usage with Claude Code (CLI)
Create or edit .mcp.json in your project root:
{
"mcpServers": {
"lightdash": {
"type": "stdio",
"command": "lightdash-mcp",
"env": {
"LIGHTDASH_URL": "https://your-lightdash-instance.com",
"LIGHTDASH_TOKEN": "ldt_your_token_here",
"LIGHTDASH_PROJECT_UUID": "your-project-uuid"
}
}
}
}Restart Claude Code and run /mcp to verify the server shows as connected.
Note: Don't commit
.mcp.jsonif it contains secrets — add it to.gitignore.
Usage with Other MCP Clients
Export the environment variables before running:
export LIGHTDASH_TOKEN="ldt_your_token_here"
export LIGHTDASH_URL="https://app.lightdash.cloud"
lightdash-mcpAvailable Tools
📊 Discovery & Metadata
Tool | Description |
| List all available Lightdash projects |
| Get detailed information about a specific project |
| List all available explores/tables in a project |
| Get detailed schema for a specific explore (dimensions, metrics, joins) |
| List all spaces (folders) in the project |
| Get custom metrics defined in the project |
📈 Chart Management
Tool | Description |
| List all saved charts, optionally filtered by name |
| Search for charts by name or description |
| Get complete configuration of a specific chart |
| Create a new saved chart with metric query and visualization config |
| Update an existing chart's configuration (name, description, queries, visualization) |
| Execute a chart's query and retrieve the data |
| Delete a saved chart |
📋 Dashboard Management
Tool | Description |
| List all dashboards in the project |
| Create a new dashboard (empty or with tiles) |
| Clone an existing dashboard with a new name |
| Get all tiles from a dashboard with optional full config |
| Get complete chart configuration for a specific dashboard tile |
| Get the complete dashboard configuration as code |
| Add a new tile (chart, markdown, or loom) to a dashboard |
| Update tile properties (position, size, content) |
| Rename a dashboard tile |
| Remove a tile from a dashboard |
| Update dashboard-level filters |
| Execute one, multiple, or all tiles on a dashboard concurrently |
🔍 Query Execution
Tool | Description |
| Execute a saved chart's query and return data |
| Run queries for dashboard tiles (supports bulk execution) |
| Execute an ad-hoc metric query against any explore |
🗂️ Resource Management
Tool | Description |
| Create a new space to organize charts and dashboards |
| Delete an empty space |
Project Structure
.
├── pyproject.toml # Package configuration
├── lightdash_mcp/ # Main package
│ ├── __init__.py # Package init
│ ├── server.py # MCP server entry point
│ ├── lightdash_client.py # Lightdash API client
│ └── tools/ # Tool implementations
│ ├── __init__.py # Auto-discovery and tool registry
│ ├── base_tool.py # Base tool interface
│ └── *.py # Individual tool implementations
├── README.md
└── LICENSEDevelopment
Adding a New Tool
The server automatically discovers and registers tools from the tools/ directory. To add a new tool:
Create a new file in
lightdash_mcp/tools/(e.g.,my_new_tool.py)Define the tool:
from pydantic import BaseModel, Field from .base_tool import ToolDefinition from .. import lightdash_client as client class MyToolInput(BaseModel): param1: str = Field(..., description="Description of param1") TOOL_DEFINITION = ToolDefinition( name="my-new-tool", description="Description of what this tool does", input_schema=MyToolInput ) def run(param1: str) -> dict: """Execute the tool logic""" result = client.get(f"/api/v1/some/endpoint/{param1}") return resultRestart the server - the tool will be automatically registered
Tool Registry
Tools are automatically discovered via tools/__init__.py, which:
Scans the
tools/directory for Python modulesImports each module (excluding utility modules)
Registers tools by their
TOOL_DEFINITION.name
Testing
You can test individual tools by importing them:
from tools import tool_registry
# List all registered tools
print(tool_registry.keys())
# Test a specific tool
result = tool_registry['list-projects'].run()
print(result)Troubleshooting
Authentication Errors
If you see 401 Unauthorized errors:
Verify your
LIGHTDASH_TOKENis correct and starts withldt_Check that the token hasn't expired
Ensure you have the necessary permissions in Lightdash
Connection Errors
If you see connection errors:
Verify
LIGHTDASH_URLis correctFor Lightdash Cloud: use
https://app.lightdash.cloudFor self-hosted: use
https://your-domain.comIf behind Cloudflare Access, ensure
CF_ACCESS_CLIENT_IDandCF_ACCESS_CLIENT_SECRETare setIf behind Google Cloud IAP, ensure
IAP_ENABLED=trueis set, install withpip install lightdash-mcp[iap], and verify the service account hasserviceAccountTokenCreatoron itself
Tool Not Found
If a tool isn't showing up:
Check that the file is in the
tools/directoryEnsure the file has a
TOOL_DEFINITIONvariableVerify the file isn't in the exclusion list in
tools/__init__.pyRestart the MCP server
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Add your changes with appropriate tests
Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues and questions:
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/poddubnyoleg/lightdash_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server