DeepSeek Vision MCP

DeepSeek Vision MCP

Lets any MCP-compatible agent analyze, describe, OCR, compare, locate, upload, and manage images through DeepSeek's vision model.

Category
访问服务器

README

DeepSeek Vision MCP

CI Python License: MIT

A secure, lightweight MCP v2 server that gives any MCP-compatible agent DeepSeek V4 Flash Vision: image analysis, faithful descriptions, OCR, comparisons, UI/object localization, and reusable Files API uploads.

The server exposes the exact model deepseek-v4-flash-vision-exp without embedding provider-specific image payloads in every agent integration.

Tools

Tool Purpose
vision_analyze General one/multi-image analysis with a custom prompt
vision_describe Faithful scene/UI description
vision_ocr Screenshot/document OCR
vision_compare Compare two or more images
vision_locate Best-effort UI/object localization to normalized coordinates
vision_upload Upload a local image to DeepSeek Files API
vision_files_list List reusable uploaded images
vision_files_delete Delete an uploaded image

Accepted image references:

  • local server-side path
  • public http:// or https:// URL
  • data:image/...;base64,...
  • DeepSeek file-api-... file ID

Why this server is thin

The MCP server does not run a local vision model. It only validates/normalizes image inputs and delegates inference to DeepSeek. That makes CPU/RAM usage tiny and lets any MCP-capable agent gain vision without embedding DeepSeek-specific payload shapes in the agent itself.

Install with uv

git clone https://github.com/groxaxo/deepseek-vision-mcp.git
cd deepseek-vision-mcp

uv sync --locked

cp .env.example .env
# Set DEEPSEEK_API_KEY and allowed roots in .env

For a local MCP host, stdio is the preferred transport:

DEEPSEEK_API_KEY="..." \
DEEPSEEK_VISION_ALLOWED_ROOTS="/home/you/Pictures:/tmp/vision" \
uv run deepseek-vision-mcp

For development with MCP Inspector:

DEEPSEEK_API_KEY="..." uv run mcp dev src/deepseek_vision_mcp/server.py

MCP host configuration

Typical stdio configuration:

{
  "mcpServers": {
    "deepseek-vision": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/deepseek-vision-mcp",
        "run",
        "deepseek-vision-mcp"
      ],
      "env": {
        "DEEPSEEK_API_KEY": "YOUR_KEY",
        "DEEPSEEK_VISION_ALLOWED_ROOTS": "/home/you/Pictures:/tmp/vision"
      }
    }
  }
}

Do not commit the API key. If the host can inherit environment variables, prefer injecting DEEPSEEK_API_KEY from your secret manager or shell.

Safe shared launcher

run-mcp.py is useful when several local agents share one installation. It:

  • reads only approved DeepSeek variables from the process or an env file;
  • filters unrelated inherited secrets before launching the MCP;
  • forces stdio transport;
  • restricts local images to explicit roots.

By default it reads ~/.hermes/.env and allows the usual image-working directories under the current home directory plus /tmp. Override those choices without editing the script:

export DEEPSEEK_VISION_ENV_FILE="$HOME/.config/deepseek-vision.env"
export DEEPSEEK_VISION_ALLOWED_ROOTS="$HOME/Pictures:/tmp/vision"
./run-mcp.py

Hermes configuration:

mcp_servers:
  deepseek-vision:
    command: "/absolute/path/to/deepseek-vision-mcp/run-mcp.py"
    args: []
    enabled: true

OpenCode configuration:

{
  "mcp": {
    "deepseek-vision": {
      "type": "local",
      "command": ["/absolute/path/to/deepseek-vision-mcp/run-mcp.py"],
      "enabled": true
    }
  }
}

OMP and other standard MCP hosts can use the mcpServers example above with run-mcp.py as the command.

Streamable HTTP

export DEEPSEEK_API_KEY="..."
export MCP_TRANSPORT=streamable-http
export MCP_HOST=127.0.0.1
export MCP_PORT=8000

uv run deepseek-vision-mcp

The MCP endpoint is:

http://127.0.0.1:8000/mcp

Use TLS and authentication in front of the server before exposing it outside a trusted machine/network.

Example tool calls

Analyze a screenshot

{
  "images": ["/home/you/Pictures/screen.png"],
  "prompt": "What application is open, what is the current state, and what should I click next?",
  "detail": "original"
}

Fast coarse screen read

{
  "images": ["/home/you/Pictures/screen.png"],
  "prompt": "Is a modal dialog visible? Answer briefly.",
  "detail": "low"
}

OCR

{
  "image": "/home/you/Pictures/error.png",
  "detail": "original"
}

Best-effort UI grounding

{
  "image": "/home/you/Pictures/screen.png",
  "target": "the blue Save button"
}

vision_locate returns coordinates normalized to 0..1000. It is intentionally described as best-effort: a generative VLM is not a deterministic detector. Validate its target before high-impact clicks.

Security model

Images analyzed by this MCP are sent to DeepSeek's external API. Do not send private or sensitive images without informed user intent.

Local paths are restricted to DEEPSEEK_VISION_ALLOWED_ROOTS. If no roots are configured, the server only allows images under its current working directory.

This matters: an unrestricted vision_analyze("/etc/...") style tool would let an MCP host turn image analysis into arbitrary local-file exfiltration.

The server also rejects obvious localhost/private-IP external URLs.

The shared launcher passes only baseline process variables, XDG_*, and the four approved DeepSeek settings to the child process. It never sources an entire credentials file.

DeepSeek image behavior reflected by this server

  • JPEG, PNG, GIF, WebP
  • local/base64 inline image: max 32 MiB each
  • DeepSeek Files API image: max 64 MiB
  • max 600 images/request
  • external URL length: max 8192 chars
  • max dimension: 8192 px/side, or 4096 px/side for 15+ images
  • detail=low: DeepSeek downsamples to 512x512
  • detail=original / high: preserve original detail
  • images are only sent in the user message

Large/reused images

Upload once:

{
  "local_path": "/home/you/Pictures/large.png",
  "expires_seconds": 86400
}

Then pass the returned file-api-... ID into vision_analyze. Use null for expires_seconds only when you intentionally want permanent DeepSeek storage.

Docker

docker build -t deepseek-vision-mcp .
docker run --rm \
  -p 127.0.0.1:8000:8000 \
  -e DEEPSEEK_API_KEY="$DEEPSEEK_API_KEY" \
  deepseek-vision-mcp

For local image paths in Docker, mount only the directories the MCP needs and set DEEPSEEK_VISION_ALLOWED_ROOTS to the container-side path.

Architecture

MCP host / agent
      |
      | MCP tool call
      v
DeepSeek Vision MCP
  - validates source
  - restricts local paths
  - encodes local files
  - shapes DeepSeek payload
      |
      | HTTPS
      v
api.deepseek.com
  deepseek-v4-flash-vision-exp
      |
      v
structured MCP result

Development

uv sync --locked --extra dev
uv run ruff check .
uv run pytest

CI runs the same gates on Python 3.11 and 3.13. Contributions and focused bug reports are welcome.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选