Skip to main content
Glama
Dellety

Vision MCP for Reasonix

by Dellety

👁️ Vision MCP for DS

License: MIT Node.js MCP

给 DeepSeek V4 等纯文本模型补上视觉。

DS V4 推理强,但看不到图。本项目是一个 MCP Server,把视觉模型的图像/视频理解能力,作为工具暴露给任何 MCP 客户端 —— Reasonix、ZCode,一份代码多处通用。截图分析、UI 对比、OCR、视频解读,各司其职。

⚠️ 客户端兼容性:经测试,Reasonix / ZCode 可正常调用。WorkBuddy 存在工具触发不稳定的问题(其「图片输入」开关与 MCP 工具路由冲突),暂未列入支持,正在 workbuddy-compat 分支研究中。

基于 Loveacup/vision-mcp-server(MIT)改造,感谢原作者。

工作原理 · 快速开始 · 部署到其它电脑 · Profile 预设 · 工具


💡 工作原理

┌─────────────────────────────┐  MCP/stdio  ┌──────────────────────┐  HTTPS/Bearer  ┌─────────────────────┐
│ Reasonix / ZCode │ ◄────────► │  Vision MCP for DS   │ ─────────────► │  视觉模型 (MiMo 等)  │
│      (DS V4,纯文本)         │             │  (本机 node 进程)     │                │  opencode.ai/zen/go │
└─────────────────────────────┘             └──────────────────────┘                └─────────────────────┘
                                                       │
                                                       ▼
                                               ┌──────────────┐
                                               │ 本地文件系统   │  (图片/视频 → base64)
                                               └──────────────┘
  • DS V4 负责代码推理与任务编排。

  • 遇到截图/UI/图片时,客户端自动调用 vision MCP 的工具,由视觉模型提供理解。

  • 本地文件会被自动转成 base64 data URI,对客户端完全透明。

Related MCP server: Vision MCP Server

🚀 快速开始

1. 安装

git clone https://github.com/Dellety/vision-mcp-for-ds.git
cd vision-mcp-for-ds
npm install && npm run build

2. 配置

创建 .env(最简:选 profile + 填 key):

VISION_PROFILE=opencode                       # OpenCode Go 套餐,一个 key 接入多家模型
VISION_API_KEY=你的key                         # https://opencode.ai/go 订阅后获取

API Key 只走环境变量,不要写入任何提交到仓库的文件。

profile

供应商

默认模型

opencode (推荐/默认)

OpenCode Go 套餐

mimo-v2.5(也可 glm-5.2 / kimi-k3

zhipu

智谱 BigModel

glm-4.6v-flashxglm-4.6v-flash 免费)

openai

OpenAI

gpt-4o

qwen

阿里通义千问 VL

qwen-vl-max

local

本地模型

Qwen3-VL-32B(端点 localhost:8000

换模型不换供应商:加 VISION_MODEL=glm-5.2。 完全换端点:加 VISION_BASE_URL=...,或直接换 VISION_PROFILE

3. 接入客户端

三个客户端的 MCP 配置格式各不相同,按你用的客户端选一个。下面 /ABSOLUTE/PATH/TO 替换为实际部署路径(如 ~/vision-mcp-for-ds)。

[[plugins]]
name    = "vision"
type    = "stdio"
command = "node"
args    = ["/ABSOLUTE/PATH/TO/vision-mcp-for-ds/dist/index.js"]
env     = { VISION_PROFILE = "opencode", VISION_API_KEY = "你的key" }

还需在 ~/.reasonix/mcp-activation.json 里启用该 server(首次添加后 Reasonix 一般会自动写入):

{
  "version": 1,
  "overrides": [
    { "scope": "global", "source": "user_config", "server": "vision", "enabled": true }
  ]
}

mcp.servers 下添加(server 名可自定义):

"ds-vision": {
  "type": "stdio",
  "command": "node",
  "args": ["/ABSOLUTE/PATH/TO/vision-mcp-for-ds/dist/index.js"],
  "env": {
    "VISION_PROFILE": "opencode",
    "VISION_API_KEY": "你的key"
  },
  "timeoutMs": 20000
}

💡 首选方案:OpenCode 在插件市场推荐了社区视觉插件 opencode-see-image(在 opencode.jsoncplugin 字段添加即可),开箱即用。本方案对 OpenCode 只是备选——当你想用自己的视觉模型/key、或需要 OCR/视频/对比等插件不具备的工具时,再配我们的 server。

⚠️ OpenCode 的 mcp 配置不允许写入 API key 等资产信息。key 通过部署目录的 config.json 传入(见下方第 2 步)。

第 1 步:在 opencode.jsoncmcp 字段里添加(用 cwd 指向部署目录,让 server 能读到 config.json):

"vision": {
  "type": "local",
  "command": ["node", "/ABSOLUTE/PATH/TO/vision-mcp-for-ds/dist/index.js"],
  "cwd": "/ABSOLUTE/PATH/TO/vision-mcp-for-ds",
  "enabled": true,
  "timeout": 10000
  // 不写 environment —— key 走 config.json
}

第 2 步:在部署目录创建 config.json(从 config.example.json 复制后填 key):

cd /ABSOLUTE/PATH/TO/vision-mcp-for-ds
cp config.example.json config.json
# 编辑 config.json,填入 apiKey
{
  "profile": "opencode",
  "apiKey": "你的key"
}

标准 MCP stdio 配置,key 走 env:

{
  "mcpServers": {
    "vision": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/vision-mcp-for-ds/dist/index.js"],
      "env": {
        "VISION_PROFILE": "opencode",
        "VISION_API_KEY": "你的key"
      }
    }
  }
}

启动客户端,让 DS V4 分析一张本地图片即可验证。启动日志应为: Vision MCP for DS started (profile: opencode, model: mimo-v2.5, ...)

📦 部署到其它电脑

面向「目标机可直连公网」的场景,提供 tar 包一键部署(不发布 npm)。

源机打包:

npm run pack
# → dist/vision-mcp-for-ds-deploy-v1.3.0.tar.gz

目标机安装:

tar xzf vision-mcp-for-ds-deploy-v1.3.0.tar.gz -C ~
cd ~/vision-mcp-for-ds
npm ci --omit=dev              # 只装 2 个生产依赖(sdk + zod),秒级完成
./scripts/health-check.sh      # 自检:node 版本 / 依赖 / key / 端点可达

然后按上面「接入客户端」的对应章节配置你用的客户端。OpenCode 用户注意:还需在部署目录 cp config.example.json config.json 并填 key(OpenCode 不允许在 mcp 配置里写资产信息)。

生产依赖仅 @modelcontextprotocol/sdk + zod,纯 JS 无 native binding,跨平台安全。

🎯 Profile 预设

一个 profile 自带正确端点和默认模型,部署时只需选 profile + 填 key。配置优先级:

1. 显式环境变量 (VISION_BASE_URL / VISION_MODEL / ...)
2. config.json 中的显式字段
3. VISION_PROFILE 指向的预设(填充未指定的字段)
4. 兜底:profile=opencode

变量

默认

说明

VISION_PROFILE

opencode

预设供应商,见上表

VISION_BASE_URL

(见 profile)

OpenAI 兼容端点(覆盖 profile)

VISION_MODEL

(见 profile)

模型名(覆盖 profile)

VISION_API_KEY

(空)

API key,只走环境变量

VISION_MAX_TOKENS

4096

最大响应 tokens

VISION_TEMPERATURE

0.7

采样温度

🛠️ 工具

工具

说明

关键参数

🔍 analyze_image

自然语言分析图像

image(路径/URL)、promptdetail(low/high/auto)

📝 ocr_image

OCR 文字识别

imagelanguages(如 zh,en)、format(plain/markdown/json)

🔀 compare_images

对比 2–4 张图像

images[]prompt

🎬 analyze_video

视频内容分析(需视频模型)

videoprompt

支持格式: JPEG/PNG/GIF/WebP/BMP/SVG | MP4/AVI/MOV/MKV/WebM 输入: 本地路径(自动转 base64)或 URL

📁 项目结构

vision-mcp-for-ds/
├── src/
│   ├── index.ts              # MCP server 入口 + 工具注册
│   ├── config.ts             # 配置加载(env > config.json > profile)
│   ├── types.ts              # 类型定义
│   ├── tools/                # 4 个视觉工具
│   └── utils/                # API 客户端 + 文件处理
├── scripts/
│   ├── pack.sh               # 打包部署 tar
│   ├── health-check.sh       # 部署自检
│   └── verify-config.sh      # 配置解析验证
└── docs/superpowers/specs/   # 设计文档

📄 License

MIT

本项目基于 Loveacup/vision-mcp-server(MIT)改造,特此致谢原作者。 在原项目基础上增加了 Profile 多预设、多客户端通用化、安全重试与超时保护,并重命名为 vision-mcp-for-ds

Available Tools

4 tools
analyze_imageC

Analyze an image using a vision language model. Supports local file paths and URLs.

ParametersJSON Schema
NameRequiredDescriptionDefault
imageYesImage source: local file path or URL
promptNoAnalysis prompt / question about the imageDescribe this image in detail.
detailNoImage detail level for analysisauto

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist. The description mentions support for local paths and URLs but omits details about output format, file size limits, or side effects. It does not specify that the tool returns a text description or answer.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence with essential information, no redundancy. However, could be expanded to include key constraints without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given three parameters, no output schema, and no annotations, the description should explain the return format and limitations. It does not specify what the tool returns (e.g., a text description) or any constraints like file format support.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All parameters have schema descriptions (100% coverage). The description adds context for the 'image' parameter by noting local path and URL support, but does not enhance detail or prompt beyond their schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (Analyze) and resource (image), and specifies support for local file paths and URLs. It differentiates from sibling tools like analyze_video and ocr_image by mentioning vision language model, but does not explicitly contrast with compare_images.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., compare_images, ocr_image). No exclusions or prerequisites provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

analyze_videoB

Analyze video content using a vision language model. Requires a model with video support (e.g., Qwen3-VL).

ParametersJSON Schema
NameRequiredDescriptionDefault
videoYesVideo source: local file path or URL
promptNoAnalysis prompt / question about the videoDescribe what happens in this video.

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It only mentions model requirements, omitting details like processing speed, output format, potential errors (e.g., unsupported video formats), or whether videos are processed entirely. The agent lacks critical behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loading the primary action and then a key requirement. Every word is purposeful; no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (two parameters, no output schema), the description is adequate but could be improved by stating what the output is (e.g., returns text) and any limitations (e.g., video length). It leaves some context gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema describes both parameters (video and prompt) with clear documentation, covering 100% of properties. The description does not add additional semantics beyond the schema, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool analyzes video content using a vision language model. It implicitly distinguishes from sibling tools like analyze_image (images) and OCR (text in images) by specifying video support. However, it lacks explicit mention of the analysis type beyond general AI interpretation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description notes the requirement for a model with video support, implying conditions for use, but gives no explicit guidance on when to use this tool versus siblings (e.g., vs analyze_image for static frames). The context of sibling names provides some implicit differentiation, but the description does not state when-not-to-use or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

compare_imagesA

Compare 2-4 images and describe differences/similarities. Supports local file paths and URLs.

ParametersJSON Schema
NameRequiredDescriptionDefault
imagesYes2-4 image sources (file paths or URLs) to compare
promptNoComparison prompt / question about the imagesCompare these images and describe the differences and similarities.

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It fails to disclose any behavioral traits such as return format, side effects, auth needs, or limitations. For a tool with no annotations, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is two concise sentences with no wasted words. It is front-loaded with the main action and covers the key detail about supported input types.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple tool (2 params, no output schema, no annotations), the description is adequate but incomplete. It does not mention return format or potential limitations like unsupported image formats, which would be helpful for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%; both parameters have descriptions. The description adds no additional meaning beyond what the schema provides. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'compare 2-4 images and describe differences/similarities', which is a specific verb+resource combination. This distinguishes it from sibling tools like analyze_image (single image analysis) and ocr_image (text extraction).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for comparing images and supports file paths and URLs, but it does not provide explicit when-to-use or when-not-to-use guidance, nor does it mention alternatives. Usage context is implied, not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ocr_imageC

Extract text from an image using OCR. Supports plain text, Markdown, and JSON output formats.

ParametersJSON Schema
NameRequiredDescriptionDefault
imageYesImage source: local file path or URL
languagesNoHint for expected languages, e.g. 'zh,en'
formatNoOutput format for extracted textplain

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description should disclose behavioral traits. It only states it extracts text via OCR but does not mention read-only nature, error handling, performance, or authentication needs. The description adds no behavioral context beyond the basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, consisting of two short sentences that immediately convey the core purpose and output options. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 3 parameters and no output schema or annotations, the description lacks completeness. It does not explain potential failures, image format support, or how to interpret results. The missing context makes it less useful for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All parameters are covered in the input schema (100% coverage). The description adds minimal extra meaning by naming output formats, but this aligns with the format enum. No significant semantic enhancement beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action (extract text using OCR) and specifies supported output formats. It is specific enough to distinguish from sibling tools like analyze_image or compare_images, though it does not explicitly differentiate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance on when to use this tool. It lists output formats but does not compare against sibling tools or specify conditions for use (e.g., image quality, file size limits). There is no when-not-to-use advice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.1.0
    • First observedanalyze_image
    • First observedanalyze_video
    • First observedcompare_images
    • First observedocr_image

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct visual task: single image analysis, video analysis, image comparison, and OCR. There is no overlap or ambiguity.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with snake_case: analyze_image, analyze_video, compare_images, ocr_image.

Tool Count5/5

Four tools cover the essential visual analysis tasks without being too few or excessive, fitting the server's scope well.

Completeness5/5

The set includes single image analysis, video analysis, image comparison, and OCR, covering key visual capabilities with no obvious gaps.

Maintenance

ActivitySlowing
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers