π This page is for engineering teams self-hosting their own Lightdash instance. If you want to use MCP with Lightdash Cloud, go to the Lightdash MCP guide.
Prerequisites
- A self-hosted Lightdash instance
- A valid
LIGHTDASH_LICENSE_KEYconfigured (setup guide)
Enable MCP
Set the following environment variable on your Lightdash deployment:Optional configuration
Set the variable on your deployment to override the default cap. For example, to allow up to 5000 rows per
run_sql call:
MCP URL format
Once enabled, the MCP endpoint is available at:<your-lightdash-host> with your instanceβs domain (e.g. lightdash.yourcompany.com).
Connect an AI assistant
Follow the same setup steps as Lightdash Cloud, using your self-hosted URL instead of a.lightdash.cloud address. See the Lightdash MCP installation guide for detailed instructions for each AI assistant (Claude, ChatGPT, Codex, Cursor, Claude Code).
For example, with Claude Code: