Skip to main content
Glama
Marsvvv

deepseek-vision-mcp

by Marsvvv

deepseek-vision-mcp

一个本地 stdio MCP 服务器:让没有视觉能力的主模型(如 deepseek-v4-pro)通过调用视觉模型(deepseek-v4-flash)来"看图"。

为什么需要它

deepseek-v4-pro 本身不支持图片输入。当会话中需要理解截图、图表、照片等内容时,主模型调用本 MCP 的 analyze_image 工具:工具读取本地图片(或直接透传 URL),交给 DeepSeek 官方 API 的视觉模型分析,把文字结果返回给主模型。

Related MCP server: MiniMax Vision MCP

目录结构

├── src/index.ts          # MCP 服务器 + analyze_image 工具 + 核心 analyzeImages 函数
├── scripts/smoke.mjs     # 冒烟测试(错误路径 + 真实 API 调用)
├── package.json
└── tsconfig.json

安装与构建

要求 Node.js ≥ 18(开发机已装 Node 24)。

cd C:\Project\deepseek-vision-mcp
npm install
npm run build          # 编译输出到 dist/index.js

注册到 Claude Code

claude mcp add deepseek-vision \
  --env DEEPSEEK_API_KEY=sk-你的key \
  -- node C:\Project\deepseek-vision-mcp\dist\index.js

注册后重启会话,用 claude mcp list 确认连接状态。

环境变量

变量

必填

默认值

说明

DEEPSEEK_API_KEY

DeepSeek API key

DEEPSEEK_BASE_URL

https://api.deepseek.com

OpenAI 兼容 API 地址,可指向中转站

DEEPSEEK_VISION_MODEL

deepseek-v4-flash

视觉模型名,按实际可用模型修改

使用方式

会话中把图片路径告诉主模型并提问即可,主模型会根据工具描述自动调用:

帮我看看 C:\Users\asus\Pictures\screenshot.png 这张图里有什么

支持 1~4 张图片(本地绝对路径或 http(s) URL),每张 ≤ 20MB,格式 png/jpg/jpeg/webp/gif。也可以直接要求对比多张图片或做 OCR。

测试

npm run smoke
  • 错误路径(无需 key):空问题、文件不存在、坏扩展名、超 20MB、超过 4 张

  • 真实 API(需 DEEPSEEK_API_KEY 在环境变量中):用内置 1×1 PNG 调视觉模型并打印回答

常见错误

现象

原因与处理

HTTP 401 - Invalid API key

DEEPSEEK_API_KEY 错误,重新 claude mcp add 注入

HTTP 404 - model not found

模型名不存在,改 DEEPSEEK_VISION_MODEL

HTTP 413 / 图片太大

压缩图片或改用更小的图

未配置 DEEPSEEK_API_KEY

注册 MCP 时没有带 --env DEEPSEEK_API_KEY=...

读取图片失败

路径写错或不存在;Windows 路径注意反斜杠

手动验证 API(不用 MCP)

curl https://api.deepseek.com/chat/completions ^
  -H "Content-Type: application/json" ^
  -H "Authorization: Bearer sk-你的key" ^
  -d "{\"model\":\"deepseek-v4-flash\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"图里有什么?\"},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==\"}}]}]}"

Available Tools

1 tool
analyze_imageA

使用视觉大模型(默认 deepseek-v4-flash)分析图片内容。当你(当前模型)本身不具备视觉能力、或需要理解图片/截图/图表/照片的内容、做 OCR 文字识别、对比多张图片时,必须调用本工具。images 为图片的本地绝对路径(如 C:\xx\screenshot.png)或 http(s) URL 数组(1~4 张,每张不超过 20MB,支持 png/jpg/jpeg/webp/gif);question 为需要视觉模型回答的问题。返回视觉模型的文字回答。

ParametersJSON Schema
NameRequiredDescriptionDefault
imagesYes图片的本地绝对路径或 http(s) URL 数组
questionYes需要视觉模型分析/回答的问题

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it does well: it discloses the underlying vision model (deepseek-v4-flash), accepted input forms (local paths or URLs), constraints (1–4 images, ≤20MB, specific formats), and the return type (text answer). It does not mention error handling or rate limits, but the core behavioral traits are transparent.

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?

The description is a single dense paragraph that front-loads the purpose, then provides usage conditions, then parameter details, and finally the return type. Every sentence carries information; it is slightly long but well-organized and free of fluff.

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

Completeness4/5

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

The description covers when to use, input constraints, parameter semantics, and return type, which is comprehensive for a tool of this simplicity with no output schema. It omits failure scenarios and exact formatting of the returned text, but nothing essential is missing for an agent to invoke it correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds meaningful value beyond the schema by explaining that 'images' can be local absolute paths or URLs, with size and format limits, and that 'question' is a question for the vision model. This is practical usage context that the schema alone does not convey.

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?

The description states a specific verb ('analyze image content using a vision model') and a clear resource (images + question). It enumerates concrete use cases — understanding screenshots/charts/photos, OCR, comparing multiple images — which fully clarifies what the tool does. There are no sibling tools, so no differentiation is needed, and the purpose is unambiguous.

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

Usage Guidelines5/5

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

The description explicitly states when the tool must be used: whenever the current model lacks vision capability or needs to interpret image content, perform OCR, or compare images. This is a direct 'call this tool when...' instruction, giving the agent a clear decision rule even without sibling tools to distinguish from.

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. 1 tool updatev1.0.0
    • First observedanalyze_image

TDQS

A4.6/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so there is no possibility of confusion between tools. The tool's description clearly states its purpose and when it must be invoked, making its role unambiguous.

Naming Consistency5/5

The single tool name 'analyze_image' follows a clear snake_case verb-noun convention, which is consistent and predictable. With only one tool, there are no mixed conventions to worry about.

Tool Count4/5

The server is a focused single-purpose vision model wrapper, and one powerful parameterized tool covers all core needs (OCR, chart understanding, image comparison). This is slightly below the typical 3-15 range but reasonable for such a narrow domain.

Completeness5/5

The tool fully covers the apparent domain of vision-based image analysis: it accepts both local paths and URLs, handles up to 4 images, supports common formats, and takes a user-defined question. There are no obvious missing capabilities for a vision-inference server.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers