dsh-vision
dsh-vision is an MCP server that gives AI agents visual understanding capabilities through an OpenAI-compatible vision model (default: Zhipu GLM).
vision_analyze: Ask questions about images, photos, screenshots, UI layouts, charts, and schematics.
vision_ocr: Extract text from images.
vision_video: Understand videos and answer questions about their content.
vision_document: Ask questions about documents (PDF, DOC/DOCX, XLS/XLSX, PPT/PPTX, TXT, MD, CSV).
Accepts inputs via HTTP(S) URLs, local file paths,
file://URIs, or base64 data URIs.Optional per-call model override,
max_tokens, andthinking(reasoning chain) support.use_searchonvision_analyzeadds web/datasheet search with cross-checking for Zhipu endpoints.Supports both stdio and streamable-http transports for local harness and remote/web use.
Provides vision understanding tools (image analysis, OCR, video understanding, document QA) via OpenAI-compatible chat completions endpoints, including OpenAI's API.
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 提取这张图片中的所有文字"
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
支持 OpenAI 协议的 vision MCP 服务器:为 dsh 及其他 harness 提供视觉理解工具。图片/视频/文档理解通过任意 OpenAI 兼容的 chat-completions 端点完成,默认指向智谱 GLM 视觉模型。
工具:
vision_analyze(图片/图表问答)、vision_ocr(文字提取)、vision_video(视频理解)、vision_document(文档问答)输入支持:http(s) URL、本地文件路径、
file://URI、data:...;base64,...URI传输:
stdio(harness 默认)与streamable-http(远程/Web 场景)后端:OpenAI 协议 chat-completions;图片走标准
image_url,视频/文档/思考链为智谱扩展(见下方兼容性说明)
安装
git clone <repo> dsh-vision
cd dsh-vision
uv sync # 建 .venv 并安装依赖Related MCP server: glm-vision-mcp
配置(环境变量)
变量 | 默认值 | 说明 |
| — | API Key(必填)。回退顺序: |
|
| OpenAI 兼容端点 |
|
| 默认模型(图片/视频可用 |
|
| 请求超时(秒) |
|
| 本地图片大小上限 / 单次图片数量 |
|
| 本地视频大小上限 / 单次视频数量 |
|
| 本地文档大小上限 / 单次文档数量 |
|
| 智谱文档解析工具: |
|
| 解析后的文档文本喂给模型的最大字符数 |
|
| streamable-http 模式下的监听参数 |
运行
# stdio(harness 用)
$env:VISION_API_KEY = "<你的智谱 API Key>"
uv run dsh-vision # 或 .venv\Scripts\dsh-vision.exe
# streamable-http
uv run dsh-vision --transport streamable-http --host 127.0.0.1 --port 8000工具用法
vision_analyze — 图片/图表问答
参数 | 类型 | 说明 |
|
| 图片引用:URL / 本地路径 / data URI(照片、截图、UI、图表、曲线图、原理图均可) |
|
| 给视觉模型的指令或问题,越具体越好 |
|
| 可选模型覆盖(如 |
|
| 可选回复长度上限 |
|
| 开启推理链(智谱 |
|
| 搜索增强(仅智谱端点):① 提取图中可查证的关键信息与厂商标志/型号 → ② 多路搜索(含厂商官网定向 datasheet 查询,内置 TI/ADI/ST/NXP 等厂商映射)→ ③ 结合证据作答并逐项交叉比对,矛盾点标注来源。更准但慢(约 3-5 次 API 调用),适合冷门/专业内容 |
vision_ocr — 文字提取
参数 | 类型 | 说明 |
|
| 同 |
vision_video — 视频理解
参数 | 类型 | 说明 |
|
| 视频引用:URL / 本地路径(mp4/mov/avi/mkv/webm 等)/ data URI |
|
| 问题或指令,如"总结这个视频"、"第几秒出现人物?" |
| — | 同 |
vision_document — 文档问答
参数 | 类型 | 说明 |
|
| 文档引用:URL / 本地路径 / data URI(pdf/doc/docx/xls/xlsx/ppt/pptx/txt/md/csv) |
|
| 问题或指令,如"总结要点"、"第 2 页表格的最大值是多少?" |
| — | 同 |
智谱端点的文档走文件解析服务:本地/URL 文档先经解析器(lite 免费 / expert / prime,见配置)提取文本,再把文本与问题一起交给模型回答;扫描版 PDF 建议把 VISION_DOC_TOOL_TYPE 设为 expert(带 OCR)。其他 OpenAI 兼容端点使用通用 file_url 内容块直传。
失败时工具返回 [vision error] ... 文本而不是让 MCP 会话报错,方便模型自行修正重试。
use_search 实战示例:芯片型号识别
对元件照片(PCB/IC 实物图)这类冷门专业内容,use_search 的价值最明显:
{
"images": ["OPA1612A-IC.webp"],
"prompt": "图中是什么芯片?请给出完整型号和关键参数,并说明依据。",
"use_search": true
}实测(OPA1612A 音频运放,v0.4.0):厂商定向查询与交叉比对生效——模型主动发现并正确裁决了噪声/供电/THD+N 三处来源矛盾(采信 TI 官方值 1.1nV/√Hz 等);但通道数仍被一处错误搜索摘要带偏(说成单通道)。结论:搜索增强显著提升参数查证能力,但搜索摘要本身可能含幻觉,专业场景请以官方 datasheet 为准(后续改进见 TODO.md)。
兼容性说明
✅ 已实测:智谱 GLM ——
glm-4v-plus(图片/视频)、glm-4.6v(文档、复杂图表、thinking),均用真实图片、视频和数学建模竞赛 PDF 验证过。⚠️ 尚未用其他供应商测试:OpenAI、DeepSeek、Qwen/DashScope、本地 vLLM 等只是按 OpenAI 协议实现,没有实测。其中:
图片理解(
vision_analyze/vision_ocr)走标准image_url,兼容性预期较好;video_url、file_url内容块、thinking参数与use_search搜索增强都是智谱对 OpenAI 协议的扩展,其他供应商可能不支持或格式不同,使用前请先验证;智谱端点下
vision_document使用智谱文件解析服务(非 OpenAI 协议),仅适用于bigmodel.cn的 base_url。
欢迎在其他供应商上测试后反馈结果(issue/PR)。
接入 dsh
在 harness 的 MCP 配置中注册 stdio 服务器:
command: .venv\Scripts\dsh-vision.exe # 或 uv run --directory <项目路径> dsh-vision
env:
VISION_API_KEY: "<你的智谱 API Key>"(具体写入位置按 dsh-mcp-install 技能 / harness 文档执行。)
开发
uv run pytest # 单元测试 + stdio 端到端冒烟
uv build # 打包 wheel端到端脚本(需要智谱 API Key):
uv run python scripts/e2e_zhipu.py --mcp # 图片链路
uv run python scripts/e2e_media.py # 视频/文档/图表思考链路
uv run python scripts/e2e_doc.py <文件> <问题> # 文档问答
uv run python scripts/e2e_search.py # 搜索增强 vs 普通对比测试智谱视觉模型
到 open.bigmodel.cn 创建 API Key
设置
VISION_API_KEY后启动服务器调用工具,例如:
{"images": ["https://example.com/photo.png"], "prompt": "描述图片内容"}
{"videos": ["C:\\videos\\clip.mp4"], "prompt": "总结这个视频"}
{"files": ["https://example.com/report.pdf"], "prompt": "总结要点", "model": "glm-4.6v"}Available Tools
4 toolsvision_analyzeA
Analyze one or more images with a vision model.
Works for photos, screenshots, UI layouts, charts, plots, schematics, etc. For text extraction prefer vision_ocr.
Args: images: Image references. Each item may be an http(s) URL, a local file path, or a data:image/...;base64,... data URI. prompt: The question or instruction for the vision model. Be as specific as possible (e.g. "What does this chart show? List the axes and trends."). model: Optional model name override (e.g. glm-4.6v). Defaults to the server's configured VISION_MODEL. max_tokens: Optional cap on the response length. thinking: Enable the reasoning chain (Zhipu glm-4.6v+; ignored by other providers that don't support it). Useful for complex charts/docs.
Returns: The model's text answer.
Inputs: images (required), prompt (required), model, thinking, +1 more. Returns: result
vision_documentA
Ask questions about documents (pdf/doc/docx/xls/xlsx/ppt/pptx/txt/md/csv).
Great for reports, papers, spec sheets, and extracting data from complex tables and charts embedded in documents.
Args: files: Document references. Each item may be an http(s) URL, a local file path, or a data:application/...;base64 data URI. prompt: The question or instruction, e.g. "Summarize the key findings." / "What is the maximum value in the table on page 2?". model: Optional model name override (e.g. glm-4.6v). Defaults to the server's configured VISION_MODEL. max_tokens: Optional cap on the response length. thinking: Enable the reasoning chain (Zhipu glm-4.6v+; ignored by other providers that don't support it). Useful for complex charts/docs.
Returns: The model's text answer.
Inputs: files (required), prompt (required), model, thinking, +1 more. Returns: result
vision_ocrA
Extract all text from one or more images (OCR via vision model).
Args: images: Image references (http(s) URL, local file path, or data URI).
Returns: The extracted text.
Inputs: images (required). Returns: result
vision_videoA
Understand one or more videos with a vision model.
Args: videos: Video references. Each item may be an http(s) URL, a local file path (mp4/mov/avi/mkv/webm/...), or a data:video/...;base64 data URI. prompt: The question or instruction, e.g. "Summarize what happens in this video." / "At which second does the person enter the frame?". For temporal questions be explicit about time points. model: Optional model name override (e.g. glm-4.6v). Defaults to the server's configured VISION_MODEL. max_tokens: Optional cap on the response length. thinking: Enable the reasoning chain (Zhipu glm-4.6v+; ignored by other providers that don't support it). Useful for complex charts/docs.
Returns: The model's text answer.
Inputs: prompt (required), videos (required), model, thinking, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct input type: vision_analyze for images, vision_ocr for text extraction from images, vision_video for videos, and vision_document for documents. The description explicitly advises using vision_ocr over vision_analyze for text extraction, eliminating ambiguity.
All tools follow a consistent vision_ prefix and use lowercase snake_case. However, vision_analyze uses a verb while vision_ocr, vision_video, and vision_document use nouns or acronyms, creating a minor inconsistency in part of speech.
With 4 tools, the server is well-scoped for its domain of multimodal vision analysis. Each tool addresses a different input modality (images, OCR, videos, documents), leaving no obvious gaps while avoiding unnecessary bloat.
The set covers the core capabilities one would expect from a vision MCP server: general image analysis, OCR, video understanding, and document Q&A. No essential operations are missing for the stated purpose of analyzing visual content.
Maintenance
Related MCP Connectors
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for Qwen Image 3 AI image generation
MCP server for Hailuo (MiniMax) AI video generation
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for image recognition, supporting multiple vision backends (Anthropic, Zhipu, Ollama) to describe, answer questions, and analyze images.351 npm1MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that leverages Zhipu's free GLM-4.6V-Flash vision model to enable image, video, and file understanding (OCR, table parsing, defect detection, document Q&A, and more) across MCP-compatible clients like Codex and Claude Desktop.-
- FlicenseNot gradedqualityDmaintenanceMCP server that gives text-only models vision capabilities via free GLM vision models, supporting image description, OCR, chart/document analysis, and grounding with automatic model fallback.1-
- AlicenseBqualityDmaintenanceMCP server that provides image analysis, OCR text extraction, and image description using the GLM-4V Flash model from Zhipu AI.38MIT