DINO-X

官方

由Dino-X驱动的先进计算机视觉与目标检测MCP服务器,使AI代理能够分析图像、检测目标、识别关键点并执行视觉理解任务。

你可以用 DINO X MCP 做什么?

  • 检测场景中的所有物体 — 让助手使用 detect-all-objects 识别图像中每个物体的类别和边界框。
  • 通过文本提示查找物体 — 通过 detect-objects-by-text 请求检测图像中的特定项目(例如“人.汽车”)。
  • 估计人体姿态关键点 — 使用 detect-human-pose-keypoints 获取图像中人物的17个身体关键点和边界框。
  • 生成带注释的可视化结果 — 使用 visualize-detection-result(仅限 STDIO 模式)生成绘制了检测结果的图像。

文档

DINO-X MCP 服务器

License npm version npm downloads PRs Welcome MCP Badge GitHub stars

English | 中文

DINO-X 官方 MCP 服务器 — 由 DINO-X 和 Grounding DINO 模型驱动 — 为您的多模态应用带来细粒度对象检测与图像理解能力。

您的浏览器不支持 video 标签。

为什么选择 DINO-X MCP?

使用 DINO-X MCP,您可以:

  • 细粒度理解:全图检测、对象检测以及区域级描述。

  • 结构化输出:获取对象类别、数量、位置和属性,用于视觉问答和多步推理任务。

  • 可组合性:与其他 MCP 服务器无缝协作,构建端到端的视觉智能体或自动化流水线。

传输模式

DINO-X MCP 支持两种传输模式:

功能STDIO(默认)流式 HTTP
运行环境本地本地或云端
传输方式标准 I/OHTTP(流式响应)
输入来源file://https://https://
可视化支持(本地保存标注图像)暂不支持

快速开始

1. 准备一个 MCP 客户端

任何兼容 MCP 的客户端均可使用,例如:

2. 获取您的 API 密钥

在 DINO-X 平台申请:申请 API 密钥(新用户可获得免费额度)。

3. 配置 MCP

选项 A:官方托管流式 HTTP(推荐)

添加到您的 MCP 客户端配置中,并替换为您的 API 密钥:

{
  "mcpServers": {
    "dinox-mcp": {
      "url": "https://mcp.deepdataspace.com/mcp?key=your-api-key"
    }
  }
}

选项 B:本地使用 NPM 包(STDIO)

首先安装 Node.js

  • nodejs.org 下载安装程序

  • 或使用命令:

# macOS / Linux
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# or
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

# load nvm into current shell (choose the one you use)
source ~/.bashrc || true
source ~/.zshrc  || true

# install and use LTS Node.js
nvm install --lts
nvm use --lts

# Windows (one of the following)
winget install OpenJS.NodeJS.LTS
# or with Chocolatey (in admin PowerShell)
iwr -useb https://raw.githubusercontent.com/chocolatey/chocolatey/master/chocolateyInstall/InstallChocolatey.ps1 | iex
choco install nodejs-lts -y

配置您的 MCP 客户端:

{
  "mcpServers": {
    "dinox-mcp": {
      "command": "npx",
      "args": ["-y", "@deepdataspace/dinox-mcp"],
      "env": {
        "DINOX_API_KEY": "your-api-key-here",
        "IMAGE_STORAGE_DIRECTORY": "/path/to/your/image/directory"
      }
    }
  }
}

注意:请将 your-api-key-here 替换为您真实的密钥。

选项 C:本地从源码运行

确保已安装 Node.js(参见选项 B),然后:

# clone
git clone https://github.com/IDEA-Research/DINO-X-MCP.git
cd DINO-X-MCP

# install deps
npm install

# build
npm run build

配置您的 MCP 客户端:

{
  "mcpServers": {
    "dinox-mcp": {
      "command": "node",
      "args": ["/path/to/DINO-X-MCP/build/index.js"],
      "env": {
        "DINOX_API_KEY": "your-api-key-here",
        "IMAGE_STORAGE_DIRECTORY": "/path/to/your/image/directory"
      }
    }
  }
}

CLI 标志与环境变量

  • 常用标志

    • --http:以流式 HTTP 模式启动(否则默认为 STDIO)
    • --stdio:强制使用 STDIO 模式
    • --dinox-api-key=...:设置 API 密钥
    • --enable-client-key:允许通过 URL ?key= 传递 API 密钥(仅限流式 HTTP)
    • --port=8080:HTTP 端口(默认 3020)
  • 环境变量

    • DINOX_API_KEY(必需/条件必需):DINO-X 平台 API 密钥
    • IMAGE_STORAGE_DIRECTORY(可选,STDIO):保存标注图像的目录
    • AUTH_TOKEN(可选,HTTP):如果设置,客户端必须发送 Authorization: Bearer <token>

    示例:

# STDIO (local)
node build/index.js --dinox-api-key=your-api-key

# Streamable HTTP (server provides a shared API key)
node build/index.js --http --dinox-api-key=your-api-key

# Streamable HTTP (custom port)
node build/index.js --http --dinox-api-key=your-api-key --port=8080

# Streamable HTTP (require client-provided API key via URL)
node build/index.js --http --enable-client-key

使用 ?key= 时的客户端配置:

{
  "mcpServers": {
    "dinox-mcp": {
      "url": "http://localhost:3020/mcp?key=your-api-key"
    }
  }
}

结合注入 Authorization: Bearer <token> 的网关使用 AUTH_TOKEN

AUTH_TOKEN=my-token node build/index.js --http --enable-client-key

使用 supergateway 的客户端示例:

{
  "mcpServers": {
    "dinox-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "supergateway",
        "--streamableHttp",
        "http://localhost:3020/mcp?key=your-api-key",
        "--oauth2Bearer",
        "my-token"
      ]
    }
  }
}

工具

能力工具 ID传输方式输入输出
全场景对象检测detect-all-objectsSTDIO / HTTP图像 URL类别 + 边界框 +(可选)描述
文本提示对象检测detect-objects-by-textSTDIO / HTTP图像 URL + 英文名词(多个用点分隔,例如 person.car目标对象边界框 +(可选)描述
人体姿态估计detect-human-pose-keypointsSTDIO / HTTP图像 URL17 个关键点 + 边界框 +(可选)描述
可视化visualize-detection-result仅 STDIO图像 URL + 检测结果数组标注图像的本地路径

🎬 使用案例

🎯 场景📝 输入✨ 输出
检测与定位💬 提示:
Detect and visualize the
fire areas in the forest

🖼️ 输入图像:
1-1
1-2
对象计数💬 提示:
Please analyze this
warehouse image, detect
all the cardboard boxes,
count the total number

🖼️ 输入图像:
2-1
2-2
特征检测💬 提示:
Find all red cars
in the image

🖼️ 输入图像:
4-1
4-2
属性推理💬 提示:
Find the tallest person
in the image, describe
their clothing

🖼️ 输入图像:
5-1
5-2
全场景检测💬 提示:
Find the fruit with
the highest vitamin C
content in the image

🖼️ 输入图像:
6-1
6-3

答案:猕猴桃(93mg/100g)
姿态分析💬 提示:
Please analyze what
yoga pose this is

🖼️ 输入图像:
3-1
3-3

常见问题

  • 支持的图像来源?
    • STDIO:file://https://
    • 流式 HTTP:仅 https://
  • 支持的图像格式?
    • jpg、jpeg、webp、png

开发与调试

开发过程中使用监视模式自动重新构建:

npm run watch

使用 MCP Inspector 进行调试:

npm run inspector

许可证

Apache License 2.0