Skip to main content
Glama
dclddb
by dclddb

deepseek-vision-mcp(Chinese README)

给无视觉能力的文本 LLM(如 DeepSeek)当「眼睛」的 MCP 服务器 —— 一个稳定、可替换后端的云端视觉适配层

设计理念(四层分工)

  • 主模型 = 大脑:解释、推理、判断、建议、任务决策

  • Vision MCP = 眼睛:忠实描述「我看到了什么」

  • Skill = 工作规范:特定领域的规则(不在此项目)

  • Claude Code = 调度与执行:调工具、改文件、执行任务

本 MCP 只回答「我看到了什么」,回答「这意味着什么」,不替主模型思考。

Related MCP server: vision-mcp

功能特性

  • 双协议分流:OpenAI 兼容 Chat Completions(通用视觉模型)+ PaddleOCR 专用 OCR 协议

  • 图片三段式处理:加载 → 校验 → 预处理(EXIF 校正、等比缩放)

  • 内容寻址缓存(image_sha256):重复分析同一张图秒回,省额度

  • 临时错误自动重试(≤2 次指数退避)

  • 失败透明:视觉服务失败时明确报错,绝不伪造结果

安装

需要 Python 3.11+ 和 uv

uv sync

配置

所有配置通过环境变量注入(.mcp.jsonenv.env)。

变量

说明

默认值

VISION_API_KEY

视觉 API 的 key

无,必填

VISION_API_BASE_URL

OpenAI 兼容 Chat 接口 base URL

无,必填

VISION_OCR_ENDPOINT

PaddleOCR 专用 OCR 接口完整地址

无(用 PaddleOCR 时填)

VISION_OCR_MODEL

mode=ocr 使用的模型

无,必填

VISION_FULL_MODEL

mode=full 使用的模型

无,必填

VISION_CACHE_ENABLED

缓存总开关

true

VISION_CACHE_SCOPE

global / project / none

global

VISION_CACHE_DIR

缓存目录覆盖(空=平台默认)

VISION_CACHE_TTL_DAYS

缓存有效期(天)

30

VISION_CACHE_MAX_SIZE_MB

缓存最大容量(MB)

128

VISION_FALLBACK_ENABLED

fallback 开关

false

VISION_RETRY_MAX

临时错误重试上限

2

VISION_TIMEOUT

单次 API 超时(秒)

60

参考 .env.example

注册到 Claude Code

项目级(.mcp.json)或用户级(~/.claude.jsonmcpServers):

{
  "mcpServers": {
    "deepseek-vision-mcp": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/deepseek-vision-mcp", "deepseek-vision-mcp"],
      "env": {
        "VISION_API_KEY": "sk-...",
        "VISION_API_BASE_URL": "https://your-vision-api.example.com/v1",
        "VISION_OCR_ENDPOINT": "https://your-ocr-api.example.com/v1/paddleocr",
        "VISION_OCR_MODEL": "PaddleOCR-VL-1.5",
        "VISION_FULL_MODEL": "your-vision-model"
      }
    }
  }
}

uv 不在 PATH,command 用 uv 的完整路径。

Windows 示例uv 通常不在 PATH,command 用完整路径,目录用正斜杠):

{
  "mcpServers": {
    "deepseek-vision-mcp": {
      "command": "C:/Users/你的用户名/.local/bin/uv.exe",
      "args": ["run", "--directory", "D:/path/to/deepseek-vision-mcp", "deepseek-vision-mcp"],
      "env": {
        "VISION_API_KEY": "sk-...",
        "VISION_API_BASE_URL": "https://your-vision-api.example.com/v1",
        "VISION_FULL_MODEL": "your-vision-model"
      }
    }
  }
}

uv 通过其它方式安装(pipx / scoop / choco),把 command 指向对应的 uv.exe 路径即可。

使用

在对话里对主模型说:

  • 「看下这张图 D:\xxx\chart.png」→ analyze_image(path, mode="full")

  • 「把这张图的文字提取出来 D:\xxx\table.png」→ analyze_image(path, mode="ocr")

工具

analyze_image

  • path_or_url:本地图片路径或 http(s) URL(PNG / JPEG / WEBP / GIF / BMP)

  • mode"full"(默认,全面理解)或 "ocr"(仅提取文字)

如何添加新 Provider

  1. src/deepseek_vision_mcp/providers/ 新建文件,继承 base.Provider 并实现 analyze

  2. router.pyget_provider 中按模型名(或其他判断)返回你的 Provider。

  3. 完成,analyze_image 上层接口无需改动。

说明

本工具不提供视觉模型,只做「适配层」。你需要自带视觉 API 的 key。

License

MIT

deepseek-vision-mcp(English README)

An MCP server that acts as the "eyes" for text-only LLMs (such as DeepSeek) — a stable, provider-swappable cloud vision adapter layer.

Design Philosophy (Four Layers)

  • Main model = Brain: interpret, reason, judge, advise, decide tasks

  • Vision MCP = Eyes: faithfully describe "what I see"

  • Skill = Work spec: domain-specific rules (not in this project)

  • Claude Code = Orchestrator: call tools, edit files, execute tasks

This MCP only answers "what I see", not "what it means", and never thinks on behalf of the main model.

Features

  • Dual-protocol routing: OpenAI-compatible Chat Completions (general vision models) + PaddleOCR dedicated OCR protocol

  • Three-stage image pipeline: load → validate → preprocess (EXIF correction, aspect-ratio-preserving resize)

  • Content-addressed cache (image_sha256): repeated analysis of the same image returns instantly

  • Automatic retry on transient errors (≤2 attempts, exponential backoff)

  • Failure transparency: reports errors clearly, never fabricates results

Installation

Requires Python 3.11+ and uv.

uv sync

Configuration

All configuration is injected via environment variables (.mcp.json env or .env).

Variable

Description

Default

VISION_API_KEY

Vision API key

none, required

VISION_API_BASE_URL

OpenAI-compatible Chat API base URL

none, required

VISION_OCR_ENDPOINT

PaddleOCR dedicated OCR endpoint (full URL)

none (set when using PaddleOCR)

VISION_OCR_MODEL

Model for mode=ocr

none, required

VISION_FULL_MODEL

Model for mode=full

none, required

VISION_CACHE_ENABLED

Cache switch

true

VISION_CACHE_SCOPE

global / project / none

global

VISION_CACHE_DIR

Cache dir override (empty = platform default)

empty

VISION_CACHE_TTL_DAYS

Cache TTL (days)

30

VISION_CACHE_MAX_SIZE_MB

Max cache size (MB)

128

VISION_FALLBACK_ENABLED

Fallback switch

false

VISION_RETRY_MAX

Max retries on transient errors

2

VISION_TIMEOUT

Per-request timeout (seconds)

60

See .env.example.

Registering with Claude Code

Project-level (.mcp.json) or user-level (mcpServers in ~/.claude.json):

{
  "mcpServers": {
    "deepseek-vision-mcp": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/deepseek-vision-mcp", "deepseek-vision-mcp"],
      "env": {
        "VISION_API_KEY": "sk-...",
        "VISION_API_BASE_URL": "https://your-vision-api.example.com/v1",
        "VISION_OCR_ENDPOINT": "https://your-ocr-api.example.com/v1/paddleocr",
        "VISION_OCR_MODEL": "PaddleOCR-VL-1.5",
        "VISION_FULL_MODEL": "your-vision-model"
      }
    }
  }
}

If uv is not on PATH, use the full path to uv for command.

Windows example (uv is usually not on PATH; use the full path for command and forward slashes for the directory):

{
  "mcpServers": {
    "deepseek-vision-mcp": {
      "command": "C:/Users/yourname/.local/bin/uv.exe",
      "args": ["run", "--directory", "D:/path/to/deepseek-vision-mcp", "deepseek-vision-mcp"],
      "env": {
        "VISION_API_KEY": "sk-...",
        "VISION_API_BASE_URL": "https://your-vision-api.example.com/v1",
        "VISION_FULL_MODEL": "your-vision-model"
      }
    }
  }
}

If uv is installed another way (pipx / scoop / choco), point command at the corresponding uv.exe.

Usage

Tell the main model:

  • "Look at this image D:\xxx\chart.png" → analyze_image(path, mode="full")

  • "Extract the text from this image D:\xxx\table.png" → analyze_image(path, mode="ocr")

Tool

analyze_image

  • path_or_url: local image path or http(s) URL (PNG / JPEG / WEBP / GIF / BMP)

  • mode: "full" (default, full understanding) or "ocr" (text extraction only)

Adding a New Provider

  1. Create a new file under src/deepseek_vision_mcp/providers/, subclass base.Provider and implement analyze.

  2. Return your provider from get_provider in router.py (keyed by model name or other criteria).

  3. Done — the upper-level analyze_image tool needs no changes.

Note

This tool does not provide vision models; it is only an adapter layer. You need to bring your own vision API key.

License

MIT

Available Tools

1 tool
analyze_imageA

当用户提供图片、截图、图表、照片,或要求查看图像内容时,调用本工具获取图片的视觉内容描述。

注意:本工具面向「自身无法直接查看图片」的主模型。若你自身具备原生视觉、能直接查看图片内容,应优先使用自己的原生视觉能力,无需调用本工具;仅在自身无法直接看图时才使用本工具。

默认使用 mode=full 进行完整视觉理解。仅当用户明确要求精确提取图片文字/表格内容时,使用 mode=ocr。

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNo"full"(默认,全面理解)或 "ocr"(仅提取文字)。full
path_or_urlYes本地图片路径或 http(s) URL。

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden of behavioral disclosure. It discloses the two operational modes and their behavior (full visual understanding vs. OCR text extraction), which is sufficient for a read-only image analysis tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: trigger conditions, usage caveat about native vision, and mode selection guidance are all front-loaded. No sentence is wasted, and the note about native vision is essential for correct agent decision-making.

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

Completeness5/5

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

The description covers the core context: what the tool does, when to invoke it, how to choose modes, and the required parameter. An output schema exists, so the return format does not need explanation. The tool is simple with only two parameters, and the description is complete for correct invocation.

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 value by explaining when to use mode=ocr versus mode=full, which goes beyond the schema's brief mode description. The path_or_url parameter is already well-covered by the schema.

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 clearly states the tool's purpose: when the user provides an image, screenshot, chart, or photo, call the tool to obtain a visual content description. It uses a specific verb and resource, and the note about native vision distinguishes its intended role from the model's own capabilities.

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 defines when to use the tool (when the model cannot directly view images) and when not to use it (if the model has native vision). It also provides clear mode selection guidance: use mode=full by default, and mode=ocr only for explicit text/table extraction.

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. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • First observedanalyze_image

TDQS

A4.7/5.0
Disambiguation5/5

There is only one tool, so there is no possibility of confusing it with another tool. Its purpose is clearly scoped to image analysis.

Naming Consistency5/5

The single tool name follows a clear verb_noun pattern and there are no conflicting naming conventions to cause inconsistency.

Tool Count4/5

One tool is at the low end, but it is justified for a narrow vision-analysis server. The built-in full/OCR modes keep it reasonably well-scoped rather than feeling empty.

Completeness5/5

For the stated purpose of providing image understanding to a non-vision model, the tool covers both general visual description and explicit OCR text/table extraction. There are no obvious missing core operations for this narrow domain.

Maintenance

ActivityMaintained
ResponsivenessNo issues

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

Related MCP Servers

Latest Blog Posts

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/dclddb/deepseek-vision-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server