π 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: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:
Network requirements
If your Lightdash instance is behind a firewall or VPN, ensure the MCP client can reach your Lightdash host over HTTPS. See the network requirements section for additional domains that may need to be allowlisted depending on your AI assistant.Troubleshooting
| Symptom | Likely cause |
|---|---|
/api/v1/mcp returns an error or 404 | MCP_ENABLED is not set to true, or the license key is missing/invalid |
| OAuth flow fails | Ensure your Lightdash instance is reachable from the browser performing the OAuth redirect |
| AI assistant canβt connect | Check that the MCP URL is correct and the instance is accessible over HTTPS |