Lightdash MCP Server
Published · Updated
At a glance
- Category
- Data & analytics
- GitHub repository
- lightdash/lightdash
- Watch out for
- Queries are read-only, limited to metric queries and SQL SELECT, and run_metric_query silently clamps anything above 5,000 rows with no export tool.
Lightdash runs its MCP server inside the Lightdash app itself, so there is nothing to install. Every Lightdash Cloud instance exposes it at https://<your_instance_name>.lightdash.cloud/api/v1/mcp over Streamable HTTP, and self-hosted deployments serve it at /api/v1/mcp on their own host. The code lives in the open-source lightdash/lightdash repository, which describes the product as BI that ships analytics through Git, CI, MCP and the Lightdash CLI.
The point of the server is that the agent queries your semantic layer rather than guessing at raw tables. It can find metrics and dimensions defined in your dbt project, run metric queries, read and edit charts and dashboards, and even open pull requests against the dbt project. What the agent sees is limited by the signed-in user's Lightdash permissions.
Interactive clients sign in with OAuth 2.0 (dynamic client registration is supported). For headless use you can send a personal access token or service account token in the Authorization header, and optional headers such as X-Lightdash-Project pin the session to one project.
How it connects
Your AI app
An assistant or agent that supports MCP
Lightdash MCP Server
Runs as
- Remote (HTTP)
Gives the agent
- Project and model discovery
- Semantic-layer queries
- Raw SQL
- Charts and dashboards
- dbt writeback
- Data apps, deliveries and agents
Lightdash
Signs in with
- OAuth / browser sign-in
What it can do
- Project and model discovery
- get_context shows the active project and agent, list_projects lists what you can reach, and grep_fields searches metrics and dimensions by business terms.
- Semantic-layer queries
- run_metric_query runs a query against defined metrics with a default cap of 5,000 rows, and get_query_result polls long-running queries by queryUuid.
- Raw SQL
- run_sql executes SQL against the warehouse, returning 500 rows by default and up to 5,000, for users with the manage SqlRunner permission.
- Charts and dashboards
- find_content, read_content, create_content and edit_content search, read, build and patch charts, dashboards and documents; edits use RFC 6902 JSON Patch. render_chart draws results in MCP App clients.
- dbt writeback
- run_ai_writeback starts an asynchronous run that opens a PR against the dbt or YAML project, and get_ai_writeback_status returns the run status and PR URL.
- Data apps, deliveries and agents
- generate_data_app and iterate_data_app build data apps, create_scheduled_delivery schedules a chart or dashboard to Slack or email, and route_agent and list_agents work with Lightdash AI agents.
Setting it up
In Claude Code, run claude mcp add --transport http lightdash 'https://<your_instance_name>.lightdash.cloud/api/v1/mcp' (the instance name is usually app or eu1 on Cloud), then open /mcp, pick Lightdash, choose Authenticate and finish the browser sign-in. For Cursor, add {"mcpServers": {"lightdash": {"url": "https://<your_instance_name>.lightdash.cloud/api/v1/mcp"}}} to .cursor/mcp.json and connect it under Settings, MCP & Integrations. VS Code with Copilot uses the workspace-root .mcp.json with {"mcpServers": {"lightdash": {"type": "http", "url": "..."}}}; run MCP: List Servers, start Lightdash and sign in, then use it from Copilot agent mode. Codex takes codex mcp add lightdash --url '<endpoint>' followed by codex mcp login lightdash. In Claude Desktop, add a custom connector under Settings, Connectors with the same URL and leave the OAuth client ID and secret blank. Lightdash also shows client-specific config under Settings, MCP, Connect.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Answer a business question by finding the right metric with grep_fields and running it through run_metric_query instead of hand-writing SQL.
- Build a new dashboard from a conversation, then tweak a chart with edit_content.
- Add a missing metric to the dbt project and get a pull request back via run_ai_writeback.
- Set up a weekly Slack delivery of a dashboard with create_scheduled_delivery.
Limitations and things to watch
- Queries are read-only, limited to metric queries and SQL SELECT, and run_metric_query silently clamps anything above 5,000 rows with no export tool.
- run_sql executes arbitrary SQL, so Lightdash recommends giving it a read-only warehouse connection.
- Self-hosted instances need an Enterprise license with MCP enabled, and admins can turn MCP off, limit it to certain projects or block content changes.
- render_chart only displays in MCP App-capable clients and does not support SQL Runner results.
- OAuth refresh tokens last two weeks and are single-use; reusing one revokes every token from that sign-in.
Sources
Written from the project's own documentation, checked November 2026.
- docs.lightdash.com /references/integrations/lightdash-mcp
- github.com /lightdash/lightdash
- github.com /lightdash/lightdash/blob/main/README.md
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.