关于 Dremio MCP server
Dremio MCP server 是一个为 LLM 接入 Dremio 而设计的 MCP 服务,可通过本地安装(配合 Claude Desktop)或 Kubernetes 远程部署运行。它面向需要让模型查询与分析 Dremio 数据的用户。
主要功能
- 01本地命令行安装与配置文件管理
- 02远程 Streaming HTTP 部署,提供 Helm Chart
- 03支持 OAuth 与外部令牌提供方认证
- 04三种运行模式:数据探索、系统自省、Prometheus 指标
- 05日志写入平台标准目录,可选 JSON 格式
适用场景
- 01让 Claude Desktop 查询并探索 Dremio 中的表和数据
- 02在 Kubernetes 集群中以远程服务形式部署 Dremio MCP 服务
- 03分析 Dremio 工作负载并结合 Prometheus 指标排查问题
MCP 相关
该项目是一个 MCP 服务,向 Claude Desktop 等 MCP 客户端暴露 Dremio 相关工具,并支持本地和远程两种连接方式。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
Dremio MCP 服务
目录
简介
此代码仓库提供了一个模型上下文协议(MCP)服务,帮助将大模型与 Dremio 集成。如果你刚接触 MCP 和 MCP 服务,可以参加 Dremio University 上的 Dremio MCP Server 课程(DremioU)。如果你已经熟悉这些概念,请继续阅读下文。
%%{init:
{
"themeVariables": {
"fontFamily": "Inter"
}
}
}%%
architecture-beta
group ws(cloud)[Workstation]
service cf(database)[Config] in ws
service mcp(server)[Dremio MCP Server] in ws
service claude(cloud)[Claude Desktop] in ws
mcp:B <-- T:cf
claude:R <--> L:mcp
group dremio(cloud)[Dremio]
service de(server)[Dremio Engine] in dremio
mcp:R <--> L:de
安装
Dremio MCP 服务可以通过两种方式部署:
远程 / 流式 HTTP 部署
对于 Kubernetes 环境中的生产部署,请使用 Helm chart:
使用 Helm 快速开始
# Build Docker image
docker build -t dremio-mcp:0.1.0 .
# Production deployment with OAuth (Recommended)
helm install my-dremio-mcp ./helm/dremio-mcp \
--set dremio.uri=https://dremio.example.com:9047
# Development/Testing with PAT (Not for production)
helm install my-dremio-mcp ./helm/dremio-mcp \
--set dremio.uri=https://dremio.example.com:9047 \
--set dremio.pat=<your-pat>
主要功能
- ✅ OAuth + 外部令牌提供程序身份验证(推荐用于生产环境)
- ✅ 面向 Web 部署的流式 HTTP 模式
- ✅ 水平 Pod 自动扩缩,支持扩展
- ✅ 集成 Prometheus 指标
- ✅ 支持带 TLS/SSL 的 Ingress
- ✅ 安全最佳实践(非 root 用户、只读文件系统)
文档
- Helm Chart README - 完整的安装和配置指南
- 身份验证指南 - OAuth + 外部令牌提供程序的实现
- 配置示例 - 生产和开发示例
本地安装(桌面端/开发)
MCP 服务在运行大模型前端(例如 Claude)的机器上本地运行。安装步骤很简单:
- 克隆或下载此代码仓库。
- 安装 uv 包管理器(注意,MCP 服务需要 Python 3.11 或更高版本)
- 如果是首次安装,请在安装完成后重启终端
- 运行下方命令,确保已安装 Python。结果应显示 Python 3.11 或更高版本(如果尚未安装 Python,请按照此处的说明操作,或者直接运行
uv python install)
$ uv python find
- 运行下方命令并验证输出是否如示例所示,以进行基本检查。
# cd <toplevel git dir> or add `--directory <toplevel git dir>`
# to the command below
$ uv run dremio-mcp-server --help
Usage: dremio-mcp-server [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────────╮
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy │
│ it or customize the installation. │
│ --help -h Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────╮
│ run Run the DremioAI MCP server │
│ tools Support for testing tools directly │
│ config Configuration management │
╰──────────────────────────────────────────────────────────────────────────────────╯
初始设置
调用 MCP 服务之前,需要进行两项配置。
- 服务配置文件:包含连接 Dremio 并与其通信的详细信息
- 大模型配置文件:用于配置大模型桌面应用(目前为 Claude),使其能够识别 MCP 服务
快速入门
最快的设置方式是:
- 按照下文所述创建 dremio 配置文件,并准备好以下值
$ uv run dremio-mcp-server config create dremioai \
--uri <dremio uri> \
# the endpoint portion of the URL for your environment
--pat <dremio pat> \
# https://docs.dremio.com/current/security/authentication/personal-access-tokens/#using-a-pat
# required for cloud: add your project ID if setting up for dremio cloud
# --project-id <dremio project id>
注意:uri 是与您的环境关联的 API 端点:
- 对于位于美国区域的 Dremio 云(https://app.dremio.cloud),使用
https://api.dremio.cloud,或使用简写prod - 对于位于 EMEA 区域的 Dremio 云(https://app.eu.dremio.cloud),使用
https://api.eu.dremio.cloud,或使用简写prodemea - 对于 SW/K8S 部署,使用 https://<coordinator‑host>:<9047 or custom port>
注意:出于安全考虑,如果您不希望 PAT 泄露到 shell 历史记录文件中,请创建一个包含 PAT 的文件,并将其作为参数传给 dremio 配置。
示例:
$ uv run dremio-mcp-server config create dremioai \
--uri <dremio uri> \
--pat @/path/to/tokenfile \
- 下载并安装 Claude Desktop(Claude)
注意:Claude 有系统要求,例如 node.js。请参阅 Claude 官方文档,确认您的系统满足要求。
- 使用以下命令创建 Claude 配置文件
$ uv run dremio-mcp-server config create claude
- 使用以下命令验证配置文件
$ uv run dremio-mcp-server config list --type claude
Default config file: '/Users/..../Library/Application Support/Claude/claude_desktop_config.json' (exists = True)
{
'globalShortcut': '',
'mcpServers': {
'Dremio': {
'command': '/opt/homebrew/Cellar/uv/0.6.14/bin/uv',
'args': [
'run',
'--directory',
'...../dremio-mcp',
'dremio-mcp-server',
'run'
]
}
}
}
$ uv run dremio-mcp-server config list --type dremioai
Default config file: /Users/..../.config/dremioai/config.yaml (exists = True)
dremio:
enable_search: false
pat: ....
uri: ....
tools:
server_mode: FOR_DATA_PATTERNS
大功告成! 您可以启动 Claude 并开始使用 MCP 服务
演示(本地安装)

下方其余文档将详细介绍配置文件
配置详情
MCP 服务配置文件
此文件默认位于 $HOME/.config/dremioai/config.yaml,但可以在运行时使用 --cfg 选项为 dremio-mcp-server 指定其他位置
格式
# The dremio section contains 3 main things - the URI to connect, PAT to use
# and optionally the project_id if using with Dremio Cloud
dremio:
uri: https://.... # the Dremio URI
pat: "@~/ws/tokens/idl.token" # PAT can be put in a file and used here with @ prefix
project_id: <string> Project ID required for Dremio Cloud
enable_search: <bool> # Optional: Enable semantic search
allow_dml: <bool> # Optional: Allow MCP Server to create views in Dremio
tools:
server_mode: FOR_DATA_PATTERNS # the serverm
# Optionally the MCP server can also connect and use a prometheus configuration if it
# has been enabled for your Dremio cluster (typically useful for SW installations)
#prometheus:
#uri: ...
#token: ...
模式
共有 3 种模式
FOR_DATA_PATTERNS- 常规模式,MCP 服务允许大模型查看表和数据,以发现模式并支持其他用例FOR_SELF- 此模式允许 MCP 服务检查 Dremio 系统,包括工作负载分析等。FOR_PROMETHEUS- 如果您配置了 prometheus,此模式允许 MCP 服务连接到该配置,以利用与 Dremio 相关的指标增强洞察
多个模式可以用 , 分隔后指定
LLM(Claude)配置文件
注意:此内容仅适用于本地安装
要设置 Claude 配置文件(请参阅此示例),请编辑 Claude 桌面配置文件
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
然后添加此部分
{
"globalShortcut": "",
"mcpServers": {
"Dremio": {
"command": "uv",
"args": [
"run",
"--directory", "<toplevel git directory>"
"dremio-mcp-server",
"run"
]
}
}
}
这将使用 MCP 服务配置文件的默认位置。也可以在上方的 args 部分中,在 run 后传入 "--config-file", "<custom config file>"
日志记录
Dremio MCP 服务会根据操作系统惯例,自动将日志文件写入特定于平台的目录。这有助于排查问题并监控服务运行情况。
日志文件位置
根据您的操作系统,日志文件存储在以下位置:
Linux
- 目录:
~/.local/share/dremioai/logs/ - 完整路径:
~/.local/share/dremioai/logs/dremioai.log - 遵循 XDG 规范:如果设置了
$XDG_DATA_HOME环境变量,则会遵循该变量
macOS
- 目录:
~/Library/Logs/dremioai/ - 完整路径:
~/Library/Logs/dremioai/dremioai.log
Windows
- 目录:
%LOCALAPPDATA%\dremioai\logs\ - 完整路径:
%LOCALAPPDATA%\dremioai\logs\dremioai.log - 常见位置:
C:\Users\<username>\AppData\Local\dremioai\logs\dremioai.log
控制文件日志记录
默认情况下,MCP 服务会将日志写入上述日志文件。您可以使用以下环境变量和命令行选项进行进一步控制:
- 使用 JSON 格式:设置
JSON_LOGGING=1,或传入--enable-json-logging,以生成结构化 JSON 日志 - 禁用文件日志记录:传入
--no-log-to-file,以禁用将日志写入文件
示例:
$ uv run dremio-mcp-server run --no-log-to-file --enable-json-logging
# OR
$ uv run dremio-mcp-server run --enable-json-logging
如果日志目录不存在,系统会自动创建,因此无需手动设置。
更多文档
-
架构:详细介绍 Dremio MCP 服务的架构,包括组件交互和数据流。
-
工具:可用工具的综合指南,包括:
- 工具类别和类型
- 使用示例
- 开发指南
- 集成支持
-
设置:完整的配置参考,涵盖:
- Dremio 连接设置
- 工具配置
- 框架集成
- 环境变量
附加信息
本仓库旨在成为开源软件,鼓励任何形式的贡献,例如添加功能、报告问题和提交修复。这不属于 Dremio 产品支持的一部分。
测试
本项目使用 pytest 进行测试。运行测试:
# Run all tests
$ uv run pytest tests
GitHub Actions 会在拉取请求和向 main 分支推送时自动运行测试。
贡献
详情请参阅我们的贡献指南,了解如何:
- 设置开发环境
- 进行贡献
- 遵循代码风格指南
- 满足文档要求
- 运行测试
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。