deepseek-vision-mcp
This server provides MCP tools to give text-only LLM agents vision and document understanding capabilities using Zhipu GLM-4.6V-Flash. It offers three tools:
Image Understanding (
vision_analyze_image): analyze local images (auto base64) or public URLs.Video Understanding (
vision_analyze_video): analyze public video URLs (local must be uploaded first).File Understanding (
vision_analyze_file): analyze public document URLs (PDFs, text files; local must be uploaded first).
All tools support an optional thinking mode for deeper inference. Responses are structured JSON with success fields (ok, content, thinking, usage) or error objects (ok:false, error with code and message). Error handling includes retries with exponential backoff (up to 3 times for 429/5xx/timeout), 60-second timeout, and categorized error codes (AUTH_ERROR, FILE_NOT_FOUND, TIMEOUT, API_ERROR, MODALITY_NOT_SUPPORTED).
Click on "Install 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., "@deepseek-vision-mcpAnalyze this image and describe what's in it: /tmp/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.
👁️ deepseek-vision-mcp
让纯文本大语言模型 Agent(如 DeepSeek 系)获得「眼睛」的 MCP 项目:通过标准 MCP 工具调用智谱 GLM-4.6V-Flash(免费视觉模型),完成图片 / 视频 / 文件三种模态的理解,并以纯文本结果回传给 Agent。
底层模型:智谱 GLM-4.6V-Flash(免费,128K 上下文,支持思考模式) 官方文档:https://docs.bigmodel.cn/cn/guide/models/free/glm-4.6v-flash
目录
Related MCP server: glm-vision-mcp
特性
三模态理解:图片 / 视频 / 文件(PDF、文本等)一次提问,纯文本返回
本地图片免上传:传本地路径自动转 base64,无需公网 URL;视频/文件模态接受公网 URL
思考模式:可选开启(
thinking=true),适合需要深度推理的视觉任务健壮性:3 次指数退避重试(429 / 5xx / 超时)、60s 超时、结构化错误返回(绝不向 Agent 抛未处理异常)
标准 MCP(stdio):兼容 Claude Code / Cursor / Cline / Continue / Windsurf / Claude Desktop / Reasonix 等任何 MCP 客户端
零成本:基于智谱免费模型,无需充值
架构设计
MCP 执行层 + Skill 决策层,职责分离:
┌─────────────────────────────────────────────────────┐
│ 文本模型 Agent(DeepSeek 等)—— 只懂文字 │
│ · 读取 Skill 的业务规则,决定何时调用什么工具 │
└──────────────────────┬──────────────────────────────┘
│ MCP 协议(stdio)
┌──────────────────────▼──────────────────────────────┐
│ MCP Server(本仓库,Python)—— 真实执行 │
│ · 读本地文件 / 图片 → base64 编码 │
│ · 调用智谱 API(认证、重试、超时、异常分类) │
│ · 提供标准化工具:vision_analyze_image / _video / _file │
└──────────────────────┬──────────────────────────────┘
│ HTTPS
┌──────────────────────▼──────────────────────────────┐
│ 智谱 GLM-4.6V-Flash API(视觉理解,返回文本) │
└─────────────────────────────────────────────────────┘层 | 职责 | 位置 |
MCP | 真实执行:读文件、base64、调 API、重试、异常捕获、统一错误结构 |
|
Skill | 业务规则:何时调用、传什么参数、输出格式、降级策略 |
|
快速开始
① 安装
pip install "deepseek-vision-mcp @ https://github.com/JunHua-ECJTU/deepseek-vision-mcp/releases/latest/download/deepseek_vision_mcp-0.2.0-py3-none-any.whl"② 配置 Key
# Windows PowerShell
$env:ZHIPU_API_KEY = "你的Key"
# macOS / Linux
export ZHIPU_API_KEY="你的Key"Key 免费申请:登录智谱开放平台 → 个人中心 → API Keys。
③ 注册到 Agent(项目根目录创建 .mcp.json)
{
"mcpServers": {
"deepseek-vision": {
"command": "python",
"args": ["-m", "deepseek_vision_mcp.server"],
"env": { "ZHIPU_API_KEY": "你的Key" }
}
}
}④ 提问
分析这张图片:https://cdn.bigmodel.cn/static/logo/register.png各 Agent 的详细注册方式与常见问题见下文 安装与部署。
安装与部署
1. 前置条件
项目 | 要求 |
Python | ≥ 3.10(Windows / macOS / Linux 均可) |
智谱 API Key |
检查 Python 版本:
python --version # 或 python3 --version若未安装 Python:Windows 用
winget install Python.Python.3.12 --scope user,macOS 用brew install python@3.12,Linux 用apt install python3等。
2. 安装软件包(四种方式任选其一)
方式 A:一条命令直接安装(推荐)
pip install "deepseek-vision-mcp @ https://github.com/JunHua-ECJTU/deepseek-vision-mcp/releases/latest/download/deepseek_vision_mcp-0.2.0-py3-none-any.whl"升级版本后,请同步把 URL 中的
0.2.0替换为新版本号。
国内网络下载依赖较慢时加镜像源(wheel 本体仍从 GitHub 拉取,只有依赖走镜像):
pip install "deepseek-vision-mcp @ https://github.com/JunHua-ECJTU/deepseek-vision-mcp/releases/latest/download/deepseek_vision_mcp-0.2.0-py3-none-any.whl" -i https://pypi.tuna.tsinghua.edu.cn/simple方式 B:手动下载 wheel 后安装
打开 Release 页面:https://github.com/JunHua-ECJTU/deepseek-vision-mcp/releases/tag/v0.2.0
在 Assets 区下载
deepseek_vision_mcp-0.2.0-py3-none-any.whl本地安装:
pip install deepseek_vision_mcp-0.2.0-py3-none-any.whl
方式 C:源码包(sdist,含 skills/ 决策层文件与测试)
下载 deepseek_vision_mcp-0.2.0.tar.gz 后:pip install deepseek_vision_mcp-0.2.0.tar.gz
方式 D:克隆仓库开发安装
git clone https://github.com/JunHua-ECJTU/deepseek-vision-mcp.git
cd deepseek-vision-mcp && pip install -e ".[dev]"不想污染全局环境时,先建虚拟环境再安装:
python -m venv .venv # Windows:.venv\Scripts\activate macOS/Linux:source .venv/bin/activate pip install ...(上面任一方式)
验证安装成功:
python -c "from deepseek_vision_mcp.server import main; print('deepseek-vision-mcp OK')"3. 配置 API Key(三选一)
方式 1:环境变量(临时,当前终端有效)
# Windows PowerShell
$env:ZHIPU_API_KEY = "你的Key"
# macOS / Linux
export ZHIPU_API_KEY="你的Key"方式 2:.env 文件(推荐;MCP server 启动时自动读取当前工作目录的 .env)
echo "ZHIPU_API_KEY=你的Key" > .env方式 3:MCP 配置文件的 env 字段(见下文第 4 节各 Agent 模板)
4. 注册到你的 Agent(MCP 客户端)
通用 .mcp.json(Claude Code / Cursor / Cline / Continue / Windsurf 等)——项目根目录创建 .mcp.json:
{
"mcpServers": {
"deepseek-vision": {
"command": "python",
"args": ["-m", "deepseek_vision_mcp.server"],
"env": { "ZHIPU_API_KEY": "你的Key" }
}
}
}Claude Desktop——菜单 → Settings → Developer → Edit Config,写入同样的 JSON 后重启。
Reasonix——编辑 %APPDATA%\reasonix\config.toml(Windows)或 ~/.reasonix/config.toml:
[[plugins]]
name = "deepseek-vision"
command = "python"
args = ["-m", "deepseek_vision_mcp.server"]
env = { ZHIPU_API_KEY = "${ZHIPU_API_KEY}" }
startup_timeout_seconds = 60
call_timeout_seconds = 120并把 Key 放入与 config.toml 同目录的 .env(${VAR} 由 Reasonix 从环境展开,密钥不入配置文件);重启或点「刷新插件」。
其他 MCP 客户端——任何支持 stdio MCP 的客户端都等价于:
字段 | 值 |
|
|
|
|
|
|
Windows 下
python不在 PATH 时,把command换成完整路径,如C:\Users\你的用户名\AppData\Local\Programs\Python\Python312\python.exe。
5.(可选)安装 Skill 业务规则层
Skill 指导 Agent「何时调用工具、传什么参数、输出什么格式、失败怎么降级」。从源码包(方式 C)或仓库中取出 skills/vision-agent/ 目录,复制到你的 Agent 的 skills 目录(各 Agent 约定不同,通常是 ~/.agent/skills/ 或项目 .agent/skills/),重启会话生效。
6. 验证是否可用
方法 1:MCP Inspector 官方工具
npx @modelcontextprotocol/inspector python -m deepseek_vision_mcp.server应看到 3 个工具:vision_analyze_image / vision_analyze_video / vision_analyze_file。
方法 2:直接问你的 Agent
分析这张图片:https://cdn.bigmodel.cn/static/logo/register.png或本地图片:
帮我看一下 C:\photo\receipt.jpg 里的金额是多少7. 常见问题
现象 | 处理 |
工具返回 | Key 未配置或无效,检查第 3 节 |
工具返回 | 视频/文件传了本地路径——视频/文件模态只接受公网 URL,先上传到可访问地址 |
工具返回 | 智谱免费模型限流("访问量过大"),稍后重试或避开高峰 |
启动报 | 依赖未装全,补装: |
Agent 找不到工具 | MCP 注册配置有误;检查 JSON 语法与 |
更多细节(各 Agent 配置、MCP Inspector 用法、故障排查表)见 docs/DEPLOY.md。
工具与使用示例
工具 | 说明 | 关键参数 |
| 图片理解(本地路径或 URL) |
|
| 视频理解(仅公网 URL) |
|
| 文件理解(仅公网 URL,PDF/文本等) |
|
示例:让 Agent「描述这张图片」后,工具返回统一 JSON 结构:
{
"ok": true,
"content": "图片中是一个深蓝色背景的 Logo,上面有白色文字……",
"thinking": "",
"usage": { "prompt_tokens": 123, "completion_tokens": 45 }
}失败时返回 {"ok": false, "error": {"code": "...", "message": "..."}},错误码包括 FILE_NOT_FOUND、UNSUPPORTED_FORMAT、AUTH_ERROR、API_ERROR、TIMEOUT、MODALITY_NOT_SUPPORTED、INTERNAL 等。
测试
pytest注意事项
GLM-4.6V-Flash 不支持同时理解多种模态(图片/视频/文件一次只传一种)——Skill 层已约束
视频/文件模态要求可访问的公网 URL(本地文件需先上传到可访问位置);仅图片支持本地路径
.env已加入.gitignore,API Key 永不入库本包目前通过 GitHub Release 分发(未发布到 PyPI)
许可证
MIT © 2026 Jun Hua
Available Tools
3 toolsvision_analyze_fileA
分析一个文档文件(PDF / 文本等)并回答问题。source 仅支持公网可访问的文件 URL; 本地文件请先上传到可访问地址。question 为对文档的提问;thinking=True 开启深度思考。 返回 JSON:{ok, content, thinking, usage} 或 {ok:false, error:{code,message}}。
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| question | Yes | ||
| thinking | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of behavioral disclosure. It honestly reveals the input constraint (public URL only), the effect of thinking parameter, and the exact return JSON structure (both success and error). It does not mention potential rate limits or file size limits, but the provided details are substantial and useful.
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?
The description is three concise sentences, front-loaded with the primary purpose. Every sentence adds value: the first states what it does, the second covers constraints, and the third explains parameters and return format. No filler.
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?
Given the tool's moderate complexity (3 parameters, no annotations, no output schema in structured form), the description covers all necessary aspects: input constraints, parameter meanings, return format, and error handling. It is sufficient for an agent to select and invoke the tool correctly.
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 0%, but the description fully compensates by explaining each parameter: source (file URL, public only), question (question about the document), and thinking (enable deep thinking). This adds all necessary meaning beyond the bare schema definitions.
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 clearly states the tool analyzes a document file (PDF/text) and answers questions, with a specific verb and resource. It distinguishes itself from sibling tools (vision_analyze_image, vision_analyze_video) by focusing on documents, making its purpose immediately clear.
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?
The description provides clear usage context: source must be a publicly accessible URL, and local files need to be uploaded first. It also explains the thinking flag. However, it does not explicitly contrast with sibling tools, leaving the when-to-use decision implied by the file type rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
vision_analyze_imageA
分析一张图片并回答问题。source 为本地图片路径(自动转 base64)或公网 URL; question 为对图片的提问;thinking=True 开启深度思考模式(更慢但更深入)。 返回 JSON:{ok, content, thinking, usage} 或 {ok:false, error:{code,message}}。
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| question | Yes | ||
| thinking | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the full burden. It discloses the auto-base64 conversion for local paths, the thinking mode's trade-off, and the exact JSON return structure including error format.
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?
The description is a single compact paragraph that front-loads the primary action, then explains parameters, and ends with return format. No wasted words.
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?
Despite having an output schema, the description also specifies the return structure. It covers all parameters, input types, and the optional thinking mode. It is complete for a straightforward analysis tool.
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 coverage is 0%, but the description explains all three parameters (source, question, thinking) in detail, including allowed values and effects. This fully compensates for the schema's lack of descriptions.
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 clearly states it analyzes an image and answers questions, using the verb '分析' (analyze) and resource '图片' (image). This differentiates it from sibling tools that analyze video or files.
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?
It explains that source can be a local path or URL, and question is the query, but it doesn't explicitly contrast with video/file tools. The scope is implied by the tool's name and the description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
vision_analyze_videoA
分析一段视频并回答问题。source 仅支持公网可访问的视频 URL(如 https://...); 本地视频请先上传到可访问地址。question 为对视频的提问;thinking=True 开启深度思考。 返回 JSON:{ok, content, thinking, usage} 或 {ok:false, error:{code,message}}。
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| question | Yes | ||
| thinking | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals the URL-only restriction, the effect of thinking=True, and the exact return JSON structure including both success and error formats. Though it omits details like rate limits or video size constraints, it covers the key behavioral aspects for this tool's scope.
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?
The description is neatly structured: a one-line purpose statement followed by specific input constraints, parameter definitions, and return format. Each sentence adds meaningful information without redundancy, making it concise and efficiently front-loaded.
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 tool with no annotations and a sparse schema, the description covers all necessary context: purpose, usage constraints, parameter semantics, and return format. The output schema exists but the description even summarizes the response shape, leaving no significant gaps for an agent to invoke the tool correctly.
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?
The schema has zero description coverage, so the description fully compensates by explaining every parameter: source's URL requirement and handling of local files, question's role, and thinking's boolean toggle meaning. This exceeds what the schema provides and clarifies how to use each argument correctly.
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 clearly states the tool's function: 'Analyze a video and answer questions.' This uses a specific verb and resource, and naturally distinguishes it from sibling tools like vision_analyze_image and vision_analyze_file by focusing on video input.
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?
It provides explicit context on usage prerequisites: source must be a publicly accessible URL and local videos must be uploaded first. While it doesn't explicitly compare to alternatives or offer exclusion criteria, the video-specific purpose and constraints give clear operational guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool targets a distinct media type: image, video, and document file. The purpose of each is clearly separated by the input format, leaving no ambiguity about which tool to use for a given source.
All tools follow the consistent pattern `vision_analyze_<type>`, making it easy to predict the tool name for new media types. The verb `analyze` and prefix `vision_` are used uniformly.
Three tools cover the core capabilities of the server (image, video, and document analysis) without unnecessary bloat. This is a well-scoped set for a vision-focused server.
The set covers the primary media types (image, video, document), but local video and file inputs require public URLs, which could be a usability gap. Missing audio analysis is a minor omission but not core to vision.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- AlicenseAqualityAmaintenanceMulti-model vision understanding MCP server that provides unified image analysis for AI assistants without native vision, supporting models like GLM-4.6V, DeepSeek-OCR, Qwen3-VL-Flash, and more.1947113MIT
- FlicenseNot gradedqualityCmaintenanceAn 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 gradedqualityCmaintenanceMCP 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
- FlicenseAqualityBmaintenanceA Model Context Protocol server that wraps the free GLM-4.6V-Flash vision model, enabling text-only LLM clients like Codex, Cursor, and Claude Desktop to analyze images, videos, and files (PDF/TXT) through standard MCP tools.32
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JunHua-ECJTU/deepseek-vision-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server