dsh-vision-mcp
Allows using local Ollama vision models (e.g., qwen2.5vl:7b, llama3.2-vision) via the OpenAI-compatible endpoint to describe images or extract text without needing an external API key.
Allows using OpenAI-compatible vision models (e.g., GPT-4o, GPT-4o-mini) to describe images, perform OCR, or extract information from images, returning text descriptions to the main model.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dsh-vision-mcpDescribe what's in this image: /home/user/screenshot.png"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DSH-vision-mcp · 识图 MCP(零依赖)
给本身不支持图片输入的模型(DeepSeek、纯文本模型等)装上"眼睛"的 MCP 服务器。
主模型调用 MCP 工具 img2text → 服务器读取图片(本地路径 / URL / data URL / base64)→ 转发给外部 OpenAI 兼容视觉 API(GPT-4o、Qwen-VL、GLM-4V、本地 Ollama 等)→ 把视觉模型返回的文字描述交回主模型继续推理。
主模型(纯文本) --img2text(image, prompt)--> dsh-vision-mcp
│ 读取图片 → base64
▼
外部视觉 API(VISION_API_BASE + VISION_MODEL)
│ 文字描述
▼
主模型拿到文字描述,继续推理/回答零依赖:仅用 Node.js 内置模块(Node ≥ 18,含
fetch),无需npm install标准 MCP stdio 协议,兼容 Claude Code / Cursor / Claude Desktop / Cline 等一切 MCP 客户端
支持 OpenAI 兼容协议的任意厂商与自建网关,
prompt可自定义(通用描述 / OCR / 报错分析等)
一行安装(npm / GitHub)
# 方式一:npm 全局安装(发布到 npm 后)
npm i -g dsh-vision-mcp
# 方式二:直接从 GitHub 安装(无需等 npm 发布)
npm i -g github:你的用户名/dsh-vision-mcp
# 方式三:不安装,临时跑(npx)
npx dsh-vision-mcp安装后生成 dsh-vision-mcp 命令,在任意 MCP 客户端里这样配置:
{
"mcpServers": {
"dsh-vision": {
"command": "dsh-vision-mcp",
"env": {
"VISION_PROVIDERS": "[{\"name\":\"qwen\",\"base\":\"https://dashscope.aliyuncs.com/compatible-mode/v1\",\"model\":\"qwen3-vl-flash\",\"apiKey\":\"sk-xxx\"}]"
}
}
}
}也可以不装包,直接用
node跑仓库里的server.js:"command": "node", "args": ["/path/to/server.js"]。
Related MCP server: DeepSeek Eyes
文件
文件 | 说明 |
| MCP 服务器本体(stdio 传输,零依赖,含 bin 入口) |
| DSH 图片降级补丁脚本(bin: |
| npm 包定义(两个 bin) |
| DSH 集成条目(MCP server 注册 + 视觉模型链配置) |
测试工具(mock-api / test-client / concurrent-test)为本地开发件,不随仓库分发;开发验证见
docs/DEVELOPER.md(本地文档)。
环境变量
变量 | 必填 | 默认 | 说明 |
| 是 |
| OpenAI 兼容 API 地址(不含 |
| 是 |
| 视觉模型名 |
| 否* | 空 | API 密钥;本地 Ollama 等免 key 服务可省略 |
| 否 |
| 最大输出 token |
| 否 |
| 采样温度 |
| 否 |
| 请求超时(毫秒) |
快速验证(本地 mock,无需任何 key)
本地开发件(docs/DEVELOPER.md 有完整说明):从开发备份取回 mock-api.js / test-client.js / test.png 后:
# 终端 1:启动 mock 视觉 API
node mock-api.js
# 终端 2:跑端到端测试(initialize → tools/list → tools/call)
$env:VISION_API_BASE='http://localhost:9876/v1'
$env:VISION_MODEL='mock-vision-1'
node test-client.js .\test.png预期输出:7 项 [PASS],工具返回 MOCK_VISION_OK ... received_image_base64_chars=96,
证明"图片 base64 已送达视觉 API、文字描述已回传"的链路是通的。
接入 MCP 客户端
Claude Code
claude mcp add dsh-vision -- node /绝对路径/server.js或写入 MCP 配置文件(~/.claude.json / 项目 .mcp.json):
{
"mcpServers": {
"dsh-vision": {
"command": "node",
"args": ["/path/to/dsh-vision-mcp/server.js"],
"env": {
"VISION_API_BASE": "https://api.openai.com/v1",
"VISION_MODEL": "gpt-4o",
"VISION_API_KEY": "sk-你的密钥"
}
}
}
}Cursor / Claude Desktop / Cline
在各自的 MCP 配置里按同样格式添加一个 stdio 类型 server:
command=node,args=[server.js 绝对路径],env 同上。
"对话框直插图片"的客户端适配
img2text 工具对任何标准 MCP 客户端到手即用:使用时机、图片附件引用格式([图片附件:名称] 图片文件:<绝对路径>)、prompt 规则、转述要求等行为规范已内置在工具描述里,任何 agent 看工具描述即懂,无需额外指令文件(无需 CLAUDE.md / AGENTS.md / rules)。
但在对话框直接粘贴/拖拽图片发送时,纯文本主模型收不了图片,各客户端需要一点额外适配才能"直插即读":
DSH(DeepSeek Harness)
需要打服务端图片降级补丁,一条命令(自动定位 DSH 的 bundle、幂等、改前备份、改后语法校验失败自动回滚):
dsh-vision-mcp-patch # 打补丁(安装后即有该命令;或 node patch-dsh.js)
dsh-vision-mcp-patch --check # 检查是否已打
dsh-vision-mcp-patch --restore # 回滚(从 .image-vision.bak 恢复)补丁把 prompt 准入从"拒绝"(MODEL_DOES_NOT_SUPPORT_IMAGES)改为图片降级:图片落盘为 durable attachment,消息中插入一行文本引用([图片附件:name(mediaType)] 图片文件:<绝对路径>),agent 按工具描述自动调 img2text —— 对话框直插图片即用。
补丁直接改
node_modules里的构建产物,DSH 升级会被覆盖,升级后重跑一次dsh-vision-mcp-patch即可。
Claude Code
主模型不支持图片时直插会被拒。工具描述已内置行为规范(agent 看到图片引用会自动调 img2text),但"直插图片自动落盘转引用"需要钩子(hook)把附件路径注入消息文本,思路同 DSH 降级:图片落盘 → 消息里出现 [图片附件:name] 文件:<绝对路径> → agent 调 img2text。
Cursor / 其他
工具描述已覆盖行为规范,无需额外指令;直插图片若被客户端拦截,同样需要钩子/脚本把附件转成路径文本。
各家视觉 API 配置示例(任选其一)
厂商 |
|
| key 变量 |
OpenCode Zen |
|
|
|
Lunora |
|
| key 写死在 providers 或环境变量 |
OpenAI |
|
|
|
通义千问 VL |
|
|
|
智谱 GLM-4V |
|
|
|
DeepSeek |
|
|
|
本地 Ollama |
|
| 免 key |
OpenRouter |
|
|
|
只要服务端实现了 OpenAI
POST /chat/completions且支持image_url内容块,即可接入。
多供应商 fallback(限流自动切换)
VISION_PROVIDERS 配置一组模型,调用时按顺序尝试:429 限流 / 5xx / 网络错误 / 超时 / 空内容自动换下一个,全部失败才报错;成功结果带 [provider: 名字] 标注。JSON 数组格式:
$env:VISION_PROVIDERS = '[{"name":"zen","base":"https://opencode.ai/zen/v1","model":"mimo-v2.5-free","apiKey":"zen-key"},
{"name":"glm","base":"https://open.bigmodel.cn/api/paas/v4","model":"GLM-4.6V-Flash","apiKey":"glm-key"},
{"name":"qwen","base":"https://dashscope.aliyuncs.com/compatible-mode/v1","model":"qwen3-vl-flash","apiKey":"qwen-key"}]'DSH 的 cordis.patch.yml 中已内置默认:zen(mimo-v2.5-free, key 读 OPENCODE_API_KEY) → glm(GLM-4.6V-Flash) 双套兜底;设置 VISION_PROVIDERS 环境变量可整体覆盖。
思考模式控制(读图建议关闭)
每个 provider 可加 "reasoning" 字段:"none"(关闭思考,读图更快更省)/ "low" / "medium" / "high"。设置后下发 reasoning_effort 且不再发 temperature(部分模型两者冲突)。全局兜底可用环境变量 VISION_REASONING。留空 = 按模型默认。
$env:VISION_PROVIDERS = '[{"name":"lunora","base":"https://api.uselunora.com/v1","model":"gemini-3-flash","apiKey":"lunora-key","reasoning":"none"}]'实测:Lunora(gemini-3-flash) 接受
reasoning_effort:"none"(响应 5.2s → 3.5s);智谱 GLM 不接受该参数(思考照开),故只对已验证的厂商配置关闭。
工具说明
img2text
参数 | 必填 | 说明 |
| 是 | 图片:本地绝对路径 / |
| 否 | 分析指令,如"详细描述"、"逐字提取全部文字(OCR)"、"这张报错截图的关键信息" |
| 否 | 覆盖最大输出 token |
默认提示词要求:逐字提取可见文字、描述布局与元素关系、完整还原截图/代码/图表中的信息,只描述可见内容。
实测结果
本地路径输入:
initialize✓tools/list✓tools/call✓(7 项全过,exit 0)data URL 输入 + 自定义 prompt:7 项全过,prompt 正确透传(exit 0)
图片以
data:mime;base64,...形式随请求送达视觉 API(mock 校验received_image_base64_chars=96= 70 字节 PNG)
现成的同类 MCP(不想自维护可选这些)
项目 | 特点 |
OpenAI 兼容视觉模型;describe / ocr / structured 三模式;path/url/base64/data_url 四来源 | |
OpenAI 兼容 API(Gemini / Qwen-VL / OpenAI / 自托管均可), | |
多国产模型(GLM-4.6V / DeepSeek-OCR / Qwen3-VL-Flash 等),大图自动裁剪,支持 HTTP 部署 | |
PyPI 安装, | |
单工具多 task(ocr/ui_review/table/diagram/chart…),markdown/json/plain_text 三种输出结构 | |
Anthropic / 智谱 / Ollama 三后端动态切换,多图对比 | |
Gemini→Grok→OpenRouter 自动 fallback,支持视频 |
Available Tools
1 toolimg2textA
读取图片并把内容转换为文字描述。接受本地文件路径、http(s) URL、data URL 或 base64。由外部视觉模型(VISION_PROVIDERS 配置的一组 OpenAI 兼容模型,自动 fallback)完成识别,返回纯文本,供本身不支持图片输入的模型理解图片。使用时机:① 你能直接查看图片时(原生多模态输入),无需调用本工具;② 用户提供图片路径/URL/图片附件引用(形如 "[图片附件:名称] 图片文件:<绝对路径>")且你无法直接看到图片内容时,立即调用本工具读取并转述内容,不要回复"无法查看图片";③ 用户要求分析/读取某张图片时。prompt 参数:用户有具体问题时传用户的问题;没有问题时不要传(server 使用默认提示词)。转述时保持简洁:先一句话概括图片是什么,再列关键信息(主要文字、重点元素),不要输出大段分析。
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | 图片来源:本地绝对路径 / http(s) URL / data URL / base64 字符串;图片附件引用中的 "图片文件:" 后即为绝对路径 | |
| prompt | No | 可选分析指令。用户有具体问题时传用户的问题;没有问题时不要传此参数(server 使用默认提示词) | |
| max_tokens | No | 可选,覆盖视觉模型最大输出 token 数 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full disclosure burden and substantially meets it: it reveals the external vision-model dependency (VISION_PROVIDERS OpenAI-compatible models with automatic fallback), the plain-text return type, and its purpose for non-multimodal models. It also prescribes output style behavior (one-sentence summary, then key details, no lengthy analysis). It does not cover error behavior or latency, but the fallback mechanism and non-mutating nature are clearly conveyed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Dense but well-structured: purpose, input formats, mechanism, numbered usage conditions (①②③), prompt guidance, and output-style instructions each get focused coverage with no fluff. The numbered lists make the routing logic easily scannable. Minor redundancy with schema text (image formats and max_tokens restated) keeps it just short of a 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 3-parameter tool with no annotations, no siblings, and no output schema, the description covers everything needed to invoke it correctly: accepted input formats, when to call, what the prompt parameter should contain, and how to relay the result. The only omitted aspect is explicit error handling, which the automatic-fallback note partially addresses.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3; the description adds genuine value for 'prompt' by specifying exactly when to pass the user question versus omitting it to use the server default. The 'image' parameter gains an operational hint that '图片文件:' in attachment references marks the absolute path. 'max_tokens' adds nothing beyond the schema, but overall the description exceeds the baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb-object pair ('读取图片并把内容转换为文字描述' — read an image and convert to text description), enumerates accepted input formats (local path, http(s) URL, data URL, base64), and clarifies the tool exists for models that lack native image input. It also differentiates from native multimodal viewing ('你能直接查看图片时...无需调用本工具'), so an agent can distinguish this path from alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Three numbered conditions give explicit when-to-call guidance: call immediately when a user supplies an image path/URL/attachment reference the model cannot see (explicitly instructing not to reply '无法查看图片'), skip the tool when the model can already view the image, and call when the user asks for image analysis. The prompt parameter also receives explicit passing rules ('用户有具体问题时传用户的问题;没有问题时不要传'). This is exemplary usage routing with exclusions and alternatives.
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 tool update
v1.2.0- First observed
img2text
TDQS
Scored across 1 tool
The server exposes only one tool, so there is no possibility of confusing it with another tool. Its purpose—converting an image to text—is clearly stated and unambiguous.
With a single tool, there are no naming conflicts or mixed conventions to penalize. 'img2text' is a concise, descriptive name that clearly communicates image-to-text conversion.
One tool feels minimal for a vision-oriented MCP server, even though the tool is focused and non-trivial. It is borderline: functional for a narrow use case, but the overall surface is thin.
The single tool covers the core image-to-text workflow well, supporting local paths, URLs, data URLs, and base64 input. A broader vision server might include additional operations like structured extraction or image comparison, but for its stated purpose there are no major dead ends.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for Hailuo (MiniMax) AI video generation
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables any LLM to describe images from file paths, URLs, or base64 data by forwarding them to a supported vision provider such as OpenAI, Anthropic, or local Ollama models.693 npm10MIT
- AlicenseAqualityCmaintenanceAn MCP server that grants image recognition to text-only models like DeepSeek by forwarding images to vision models and returning text descriptions. Supports clipboard, pasted session images, and batch folder image recognition.53MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that gives text-only LLMs like DeepSeek vision capabilities by converting images to text via vision APIs, enabling image description, OCR, and generation in MCP clients.1MIT
- FlicenseAqualityCmaintenanceMCP server that gives visual reference to MCP clients by calling an OpenAI-compatible vision API, enabling image description with optional auto-selection of the newest pasted image.1-