dsh-vision-mcp
Allows AI agents to analyze images, extract text, and compare images using an OpenAI-compatible vision API endpoint.
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-mcp extract all text from the image at C:/shots/photo.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 服务器:给任何 MCP 客户端的 agent 装上眼睛——DeepSeek Harness、Claude Desktop、Codex CLI、Cursor 通用。视觉大脑是你自己的 OpenAI 兼容视觉端点(默认对接本机 chatgpt2api,也可指向任何标准 vision API),主模型无需自带视觉能力。
任意 MCP 客户端(stdio JSON-RPC)
│
┌───────▼────────────────────┐ HTTP POST /v1/chat/completions
│ dsh-vision-mcp │ ──────────────────────────────→ OpenAI 兼容视觉端点
│ analyze_image/extract_text/│ {image_url: dataURL} (chatgpt2api :8000
│ compare_images │ 或任何标准 vision API)
└────────────────────────────┘快速开始
git clone https://github.com/alwaysalone1/dsh-vision-mcp.git
cd dsh-vision-mcp
npm install && npm run build
# 环境体检:端点可达性 + key 校验 + 模型列表
export VISION_API_KEY='<你的 chatgpt2api auth-key>'
npm run doctorRelated MCP server: Vision MCP
接入各客户端
以下配置通用:command 跑构建产物,env 传入视觉后端的地址与 key。
DeepSeek Harness(packages/mcp 桥,一行 patch,工具名为 mcp__vision__analyze_image 等):
- insert:
- id: vision-mcp
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: vision
transport: stdio
command: node
args: ['D:/path/to/dsh-vision-mcp/dist/index.js']
env:
VISION_API_BASE: http://127.0.0.1:8000
VISION_API_KEY: !!js process.env.VISION_API_KEYClaude Desktop / 通用 JSON(claude_desktop_config.json 的 mcpServers,Cursor 的 mcp.json 同构):
{
"mcpServers": {
"dsh-vision": {
"command": "node",
"args": ["D:/path/to/dsh-vision-mcp/dist/index.js"],
"env": {
"VISION_API_BASE": "http://127.0.0.1:8000",
"VISION_API_KEY": "<your-key>"
}
}
}
}Codex CLI(~/.codex/config.toml):
[mcp_servers.dsh-vision]
command = "node"
args = ["D:/path/to/dsh-vision-mcp/dist/index.js"]
env = { "VISION_API_BASE" = "http://127.0.0.1:8000", "VISION_API_KEY" = "your-key" }工具
工具 | 作用 | 参数 |
| 理解图片:描述内容、回答问题、定位界面元素(可问"红色按钮的坐标") |
|
| OCR:按原始排版提取全部文字(代码/公式/多语言) |
|
| 对比两张图片的相同与不同 |
|
source 四种写法任选:本地文件路径(如 C:/shots/1.png)、http(s):// 图片 URL、data:image/png;base64,...、裸 base64。格式按文件头魔数判定(PNG/JPEG/GIF/WebP/BMP),不看扩展名。
模型选择
默认使用 gpt-5-6(账号池里最强的推理+视觉对话模型)。三种调整方式:
每次调用传
model参数临时覆盖(如gpt-5-6-mini省额度);全局默认:环境变量
VISION_MODEL(如设为auto交由后端路由);注意
gpt-image-2是生图模型,不用于识图。
配置(环境变量)
变量 | 默认 | 说明 |
| 必填 | 视觉后端的 Bearer key(chatgpt2api 的 |
|
| OpenAI 兼容端点地址 |
|
| 全局默认模型 |
|
| 单次请求硬超时(账号池繁忙时可调大) |
|
| 单图字节上限(编码前) |
|
| 传输错误/429/5xx 的重试次数(退避递增) |
排障
token_expired—— 账号池上游 token 过期:到 chatgpt2api 面板刷新/重登账号(配置里有auto_relogin_after_refresh)。HTTP 502 / TLS connect error —— 池子的上游代理(WARP/Privoxy)不健康:检查 chatgpt2api 的稳定代理运行时面板。
HTTP 401 ——
VISION_API_KEY与后端auth-key不一致。请求超时 —— 调大
VISION_TIMEOUT_MS;池子空闲时通常 10-30 秒内返回。格式不识别 —— 图片按文件头判定;损坏或非图片文件会被拒绝。
隐私与边界
发给视觉端点的图片会到达其后端模型(默认为你自己的 chatgpt2api 账号池→ChatGPT):不要用公共 vision API 处理敏感截图。
本服务器只做工具桥接:无状态、不落盘、不写日志文件(诊断仅到 stderr)。
开发
npm run typecheck # 严格模式类型检查
npm run build # 产物到 dist/
npm run smoke # 真实 stdio 端到端冒烟(需 VISION_API_KEY + 测试图)
npm run doctor # 环境体检许可
Available Tools
3 toolsanalyze_image识图分析A
理解一张图片:描述内容、回答关于图片的问题、定位界面元素。不传 prompt 时输出完整描述。
Inputs: source (required), model, prompt.
compare_images图片对比C
对比两张图片的相同与不同之处,可附带关注点。
Inputs: sourceA (required), sourceB (required), model, prompt.
extract_text图片文字提取A
OCR:提取图片中的全部文字,按原始排版输出(支持代码、公式、多语言)。
Inputs: source (required), model.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools target distinct operations: general understanding/Q&A, OCR-only extraction, and pairwise comparison. There is mild overlap because analyze_image with a text-related prompt could plausibly perform OCR, but the descriptions clearly steer text extraction to extract_text.
All tools follow the same snake_case verb_noun convention (analyze_image, extract_text, compare_images). Verb choices are predictable and self-explanatory.
Three tools is on the lean side but each covers a genuinely distinct vision capability, so the set is well-scoped rather than padded. A small focused surface fits a vision-analysis server.
The core vision workflow — describe/answer, OCR, and diffing — is covered with no dead ends. Minor gaps exist around region-level operations (crop/zoom on a sub-area) and structured element detection beyond prompt-driven localization.
Maintenance
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Edit, translate, remove, and extract text inside images via Remote HTTP MCP with OAuth 2.1.
Generate detailed AI image prompts from image URLs or base64 data using a remote MCP server.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- AlicenseAqualityCmaintenanceGive MCP-compatible AI agents image analysis, metadata inspection, cropping, OCR, and image comparison through any OpenAI-compatible vision model.6MIT
- AlicenseAqualityCmaintenanceEnables any MCP client to perform image understanding and OCR via any OpenAI-compatible vision-language model. Supports local, private inference without images leaving the machine.2MIT
- AlicenseAqualityDmaintenanceProvides image recognition capabilities to MCP clients by integrating with OpenAI-compatible vision models, supporting local images, URLs, multi-image comparison, and model listing.4MIT
- AlicenseNot gradedqualityCmaintenanceProvides vision capabilities to text-only LLMs via MCP, enabling image understanding, Q&A, OCR, and image processing through cloud multimodal APIs.MIT