Redash MCP连接器
模型上下文协议(MCP)服务器,它将Redash与像Claude这样的AI助手集成在一起,使它们能够通过自然语言查询数据、管理可视化内容以及与仪表板交互。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"redash": {
"args": [
"-y",
"@suthio/redash-mcp"
],
"command": "npx",
"env": {
"REDASH_API_KEY": "your-api-key",
"REDASH_URL": "https://your-redash-instance.com"
}
}
}
}
该服务需要配置环境变量:REDASH_API_KEY、REDASH_MAX_RESULTS、REDASH_TIMEOUT、REDASH_URL
可用工具 (10 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
list-queries 2 个参数
List all available queries in Redash
该工具无需必填参数,直接调用即可
get-query 1 个参数 需填 1 项
Get details of a specific query
必填参数:queryId
create-query 7 个参数 需填 3 项
Create a new query in Redash
必填参数:name、data_source_id、query
update-query 10 个参数 需填 1 项
Update an existing query in Redash
必填参数:queryId
archive-query 1 个参数 需填 1 项
Archive (soft-delete) a query in Redash
必填参数:queryId
list-data-sources
List all available data sources in Redash
该工具无需必填参数,直接调用即可
execute-query 2 个参数 需填 1 项
Execute a Redash query and return results
必填参数:queryId
list-dashboards 2 个参数
List all available dashboards in Redash
该工具无需必填参数,直接调用即可
get-dashboard 1 个参数 需填 1 项
Get details of a specific dashboard
必填参数:dashboardId
get-visualization 1 个参数 需填 1 项
Get details of a specific visualization
必填参数:visualizationId
服务介绍
Redash MCP 服务器
用于将 Redash 与 Claude 等 AI 助手集成的 Model Context Protocol (MCP) 服务器。
特性
- 通过 Redash API 连接到 Redash 实例
- 将可用查询和仪表板作为资源列出
- 执行查询并检索结果
- 创建和管理查询(创建、更新、归档)
- 列出用于创建查询的数据源
- 获取仪表板详情和可视化内容
前提条件
- Node.js (v18 或更高版本)
- npm 或 yarn
- 访问 Redash 实例
- Redash API 密钥
环境变量
服务器需要以下环境变量:
REDASH_URL: 您的 Redash 实例 URL(例如,https://redash.example.com)REDASH_API_KEY: 您的 Redash API 密钥
可选变量:
REDASH_TIMEOUT: API 请求的超时时间(以毫秒为单位,默认值:30000)REDASH_MAX_RESULTS: 返回的最大结果数量(默认值:1000)
安装
-
克隆此仓库:
git clone https://github.com/suthio/redash-mcp.git cd redash-mcp -
安装依赖项:
npm install -
使用您的 Redash 配置创建一个
.env文件:REDASH_URL=https://your-redash-instance.com REDASH_API_KEY=your_api_key -
构建项目:
npm run build -
启动服务器:
npm start
在 Claude for Desktop 中使用
要在此 MCP 服务器中使用 Claude for Desktop,请在您的 Claude for Desktop 配置文件中进行配置:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
添加以下配置(根据需要编辑路径):
{
"mcpServers": {
"redash": {
"command": "npx",
"args": [
"-y",
"@suthio/redash-mcp"
],
"env": {
"REDASH_API_KEY": "your-api-key",
"REDASH_URL": "https://your-redash-instance.com"
}
}
}
}
可用工具
查询管理
list-queries: 列出 Redash 中所有可用的查询get-query: 获取特定查询的详细信息create-query: 在 Redash 中创建新查询update-query: 更新 Redash 中现有的查询archive-query: 归档(软删除)查询list-data-sources: 列出所有可用的数据源
查询执行
execute-query: 执行查询并返回结果
仪表板管理
list-dashboards: 列出所有可用的仪表板get-dashboard: 获取仪表板详情和可视化内容get-visualization: 获取特定可视化的详细信息
开发
以开发模式运行:
npm run dev
版本历史
- v1.1.0: 添加了查询管理功能(创建、更新、归档)
- v1.0.0: 初始发布
许可证
MIT