Back to MCP directory
publicPublicdnsLocal runtime

lightdash-mcp-server

一个为Lightdash提供MCP协议兼容接口的服务器,使AI助手能通过标准化方式访问Lightdash数据。

article

README

🚀 Lightdash-MCP-Server

一个访问 LightdashMCP(模型上下文协议) 服务器。该服务器通过标准化接口提供与 Lightdash API 的 MCP 兼容访问,让 AI 助手能够与您的 Lightdash 数据进行交互。

smithery badge npm 版本

🚀 快速开始

📦 安装指南

通过 Smithery 安装

要通过 Smithery 自动安装 Lightdash MCP Server for Claude Desktop,可使用以下命令:

npx -y @smithery/cli install lightdash-mcp-server --client claude

手动安装

npm install lightdash-mcp-server

配置

  • LIGHTDASH_API_KEY:您的 Lightdash PAT(个人访问令牌)
  • LIGHTDASH_API_URL:API 的基础 URL

💻 使用示例

基础用法

  1. 启动 MCP 服务器。 直接运行:
npx lightdash-mcp-server

或者使用 Node.js 运行已安装的模块。

  1. 编辑您的 MCP 配置 JSON 文件,添加以下内容:
...
    "lightdash": {
      "command": "npx",
      "args": [
        "-y",
        "lightdash-mcp-server"
      ],
      "env": {
        "LIGHTDASH_API_KEY": "<your PAT>",
        "LIGHTDASH_API_URL": "https://<your 基础 URL>"
      }
    },
...

✨ 主要特性

可用工具:

  • list_projects - 列出 Lightdash 组织中的所有项目
  • get_project - 获取特定项目的详细信息
  • list_spaces - 列出项目中的所有空间
  • list_charts - 列出项目中的所有图表
  • list_dashboards - 列出项目中的所有仪表板
  • get_custom_metrics - 获取项目的自定义指标
  • get_catalog - 获取项目的目录结构
  • get_metrics_catalog - 获取项目的度量目录
  • get_charts_as_code - 获取项目的图表代码表示
  • get_dashboards_as_code - 获取项目的仪表板代码表示

🔧 技术细节

开发

可用脚本

  • npm run dev - 以开发模式启动服务器,并启用热重载
  • npm run build - 构建项目用于生产环境
  • npm run start - 启动生产服务器
  • npm run lint - 运行代码检查(ESLint 和 Prettier)
  • npm run fix - 自动修复代码问题
  • npm run examples - 运行示例脚本

贡献指南

  1. Fork 该仓库
  2. 创建功能分支
  3. 运行测试和代码检查:npm run lint
  4. 提交您的更改
  5. 推送到分支
  6. 创建 Pull Request
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client