Logo vun Lightdash MCP Server

Lightdash MCP Server

Communautéit
poddubnyoleg

mcp server for lightdash

Editeurpoddubnyoleg
Repositorylightdash_mcp
SproochPython
Forks
7
Stären
23
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    Lightdash MCP Server stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    23 Stären an 7 Forks aus dem verlinkte Repository.

Lightdash MCP Server

License: MIT Python 3.10+ MCP PyPI GitHub stars

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

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)

bash
pip install lightdash-mcp

Quick Start with uvx

bash
uvx lightdash-mcp

Quick Start with pipx

bash
pipx run lightdash-mcp

Install from Source

bash
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:

bash
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.serviceAccountTokenCreator on itself
  • The runtime service account needs roles/iap.httpsResourceAccessor on the Cloud Run service

User credentials (ADC) (e.g. gcloud auth application-default login):

  • Set IAP_SA to the service account email to impersonate for signing the JWT
  • The user needs roles/iam.serviceAccountTokenCreator on the target service account
  • The target service account needs roles/iap.httpsResourceAccessor on the Cloud Run service

Configuration

Environment Variables

The server requires the following environment variables:

VariableRequiredDescriptionExample
LIGHTDASH_TOKEN✅Your Lightdash Personal Access Tokenldt_abc123...
LIGHTDASH_URL✅Base URL of your Lightdash Instancehttps://app.lightdash.cloud
CF_ACCESS_CLIENT_ID❌Cloudflare Access Client ID (if behind CF Access)-
CF_ACCESS_CLIENT_SECRET❌Cloudflare Access Client Secret (if behind CF Access)-
LIGHTDASH_PROJECT_UUID❌Default project UUID (falls back to first available project)3fc2835f-...
IAP_ENABLED❌Enable Google Cloud IAP authentication (true/1)true
IAP_SA❌Service account email for IAP when using user credentials (ADC)sa@project.iam.gserviceaccount.com

Getting Your Lightdash Token

  1. Log into your Lightdash instance
  2. Go to Settings → Personal Access Tokens
  3. Click Generate new token
  4. Copy the token (starts with ldt_)

Usage with Claude Desktop

Add the following to your claude_desktop_config.json:

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:

json
{
  "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.json if it contains secrets — add it to .gitignore.

Usage with Other MCP Clients

Export the environment variables before running:

bash
export LIGHTDASH_TOKEN="ldt_your_token_here"
export LIGHTDASH_URL="https://app.lightdash.cloud"
lightdash-mcp

Available Tools

📊 Discovery & Metadata

ToolDescription
list-projectsList all available Lightdash projects
get-projectGet detailed information about a specific project
list-exploresList all available explores/tables in a project
get-explore-schemaGet detailed schema for a specific explore (dimensions, metrics, joins)
list-spacesList all spaces (folders) in the project
get-custom-metricsGet custom metrics defined in the project

📈 Chart Management

ToolDescription
list-chartsList all saved charts, optionally filtered by name
search-chartsSearch for charts by name or description
get-chart-detailsGet complete configuration of a specific chart
create-chartCreate a new saved chart with metric query and visualization config
update-chartUpdate an existing chart's configuration (name, description, queries, visualization)
run-chart-queryExecute a chart's query and retrieve the data
delete-chartDelete a saved chart

📋 Dashboard Management

ToolDescription
list-dashboardsList all dashboards in the project
create-dashboardCreate a new dashboard (empty or with tiles)
duplicate-dashboardClone an existing dashboard with a new name
get-dashboard-tilesGet all tiles from a dashboard with optional full config
get-dashboard-tile-chart-configGet complete chart configuration for a specific dashboard tile
get-dashboard-codeGet the complete dashboard configuration as code
create-dashboard-tileAdd a new tile (chart, markdown, or loom) to a dashboard
update-dashboard-tileUpdate tile properties (position, size, content)
rename-dashboard-tileRename a dashboard tile
delete-dashboard-tileRemove a tile from a dashboard
update-dashboard-filtersUpdate dashboard-level filters
run-dashboard-tilesExecute one, multiple, or all tiles on a dashboard concurrently

🔍 Query Execution

ToolDescription
run-chart-queryExecute a saved chart's query and return data
run-dashboard-tilesRun queries for dashboard tiles (supports bulk execution)
run-raw-queryExecute an ad-hoc metric query against any explore

🗂️ Resource Management

ToolDescription
create-spaceCreate a new space to organize charts and dashboards
delete-spaceDelete 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
└── LICENSE

Development

Adding a New Tool

The server automatically discovers and registers tools from the tools/ directory. To add a new tool:

  1. Create a new file in lightdash_mcp/tools/ (e.g., my_new_tool.py)

  2. Define the tool:

    python
    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 result
  3. Restart 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 modules
  • Imports each module (excluding utility modules)
  • Registers tools by their TOOL_DEFINITION.name

Testing

You can test individual tools by importing them:

python
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_TOKEN is correct and starts with ldt_
  • Check that the token hasn't expired
  • Ensure you have the necessary permissions in Lightdash

Connection Errors

If you see connection errors:

  • Verify LIGHTDASH_URL is correct
  • For Lightdash Cloud: use https://app.lightdash.cloud
  • For self-hosted: use https://your-domain.com
  • If behind Cloudflare Access, ensure CF_ACCESS_CLIENT_ID and CF_ACCESS_CLIENT_SECRET are set
  • If behind Google Cloud IAP, ensure IAP_ENABLED=true is set, install with pip install lightdash-mcp[iap], and verify the service account has serviceAccountTokenCreator on itself

Tool Not Found

If a tool isn't showing up:

  • Check that the file is in the tools/ directory
  • Ensure the file has a TOOL_DEFINITION variable
  • Verify the file isn't in the exclusion list in tools/__init__.py
  • Restart the MCP server

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add your changes with appropriate tests
  4. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions:

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "poddubnyoleg-lightdash_mcp": {
      "command": "uvx",
      "args": [
        "lightdash-mcp"
      ]
    }
  }
}

Lightdash MCP Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Lightdash MCP Server verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Lightdash MCP Server als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu Lightdash MCP Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "poddubnyoleg-lightdash_mcp": {
      "command": "npx",
      "args": [
        "-y",
        "lightdash-mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu Lightdash MCP Server. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu Lightdash MCP Server.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Lightdash MCP Server?
Lightdash MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat Lightdash MCP Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server Lightdash MCP Server benotzt?

Lightdash MCP Server ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Lightdash MCP Server MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Lightdash MCP Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat Lightdash MCP Server MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Lightdash MCP Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech Lightdash MCP Server MCP mat TypingMind?

Lightdash MCP Server leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt Lightdash MCP Server MCP an TypingMind zur Verfügung?

Lightdash MCP Server stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Lightdash MCP Server MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Lightdash MCP Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇