Dremio连接AI助手协议

一个连接AI助手(如Claude)与Dremio湖仓的模型上下文协议服务器,支持语义层管理、数据探索、查询执行和作业分析。

  • by AlexMercedCoder
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 AlexMercedCoder/dremio-local-mcp

使用说明

项目概述 dremio-local-mcp

关于Git Repo的完整文档请点击此处

这 dremio-local-mcp 是一个模型上下文协议(MCP)服务器,它将人工智能助手(如克劳德)连接到你的德雷米奥湖畔。

特性

  • 语义层管理:直接从聊天中创建视图、更新wiki和标记数据集。
  • 数据探索:列出数据集、检查模式和包上下文以进行分析。
  • 查询执行:安全运行SQL查询(破坏性查询需要确认)。
  • 工作分析:分析工作概况以提高绩效。

安装

pip install dremio-local-mcp

配置

此工具使用标准的Dremio CLI配置格式。您可以使用管理您的Dremio凭据 德雷米奥 - CLI 实用程序(推荐)或通过YAML文件手动。

选项1:使用dremio-cli

首先,安装CLI(如果还没有):

pip install dremio-cli

然后为您的环境创建一个配置文件:

对于Dremio Cloud:

# Create a profile named 'default'
dremio profile create --name default --type cloud --token <your-pat-token> --project-id <your-project-id> --base-url https://api.dremio.cloud

对于Dremio软件:

# Create a profile named 'software'
dremio profile create --name software --type software --base-url http://localhost:9047 --username <user> --password <pass>

(对于软件, verify_ssl 默认为 true.添加 --no-verify-ssl 如果使用自签名证书)

选项2:手动YAML

创建或编辑 ~/.dremio/profiles.yaml 手动:

default_profile: cloud
profiles:
  cloud:
    base_url: "https://api.dremio.cloud"
    token: "your-pat-token"
    project_id: "your-project-id"
    verify_ssl: true
  software:
    base_url: "http://localhost:9047"
    username: "admin"
    password: "password123"
    verify_ssl: false

### Supported Authentication Flows

This MCP server supports all authentication flows available in `dremio-cli` (v1.10.0+):

1.  **Cloud (PAT)**: Requires `token` and `project_id`.
2.  **Software (PAT)**: Requires `token` and `base_url`.
3.  **Software (User/Pass)**: Requires `username`, `password`, and `base_url`.
4.  **Service (OAuth2 Credentials)**: Requires `client_id`, `client_secret`, and `base_url`.

> [!TIP]
> **Service/Credentials Flow**: If you are using the Client Credentials flow (common for service accounts), it is recommended to explicitly set the scope in your profile to ensure full access.
>
> ```yaml
> service_profile:
>   type: "software" # or "cloud"
>   base_url: "https://dremio.org/api/v3"
>   auth:
>     type: "oauth"
>     client_id: "your-client-id"
>     client_secret: "your-client-secret"
>     # scope: "dremio.all" # NOTE: dremio-cli v1.11.0 currently ignores this key and defaults to dremio.all on retry
> ```

用法

启动服务器

dremio-local-mcp start --profile default

连通性测试

dremio-local-mcp test --profile default

Claude桌面配置

生成配置块:

dremio-local-mcp config --profile default

将输出复制到您的 claude_desktop_config.json.

文档