mcp-vision-server

mcp-vision-server

MCP server exposing an analyze_image tool that sends images to an OpenAI-compatible vision model and returns text answers, usable from any MCP client.

Category
访问服务器

README

mcp-vision-server

English | 中文

MCP server that exposes an analyze_image tool: it forwards an image to a configurable OpenAI-compatible vision model and returns the model's text answer. Any MCP client — DSH through @deepseek-ai/dsh-mcp-client, Claude Desktop, or others — can call it.

Usage

Start the server over stdio:

export VISION_API_KEY=...
export VISION_MODEL=gpt-4o
npx -y mcp-vision-server

Pass --help to print the environment-variable reference. To run from a checkout instead of npm: pnpm install && pnpm build && node lib/bin.js.

The bin also reads a .env file placed next to it (copy .env.example to .env and fill it in); variables already present in the environment always win over .env values.

Connect from DSH

Add one @deepseek-ai/dsh-mcp-client instance to cordis.yml:

- id: mcp-vision
  name: '@deepseek-ai/dsh-mcp-client'
  config:
    serverName: vision
    transport: stdio
    command: npx
    args: ['-y', 'mcp-vision-server']
    env:
      VISION_API_BASE_URL: https://open.bigmodel.cn/api/paas/v4
      VISION_API_KEY: !!js process.env.VISION_API_KEY
      VISION_MODEL: glm-4v-plus

The model sees the tool as mcp__vision__analyze_image.

Connect from Claude Desktop

claude_desktop_config.json:

{
  "mcpServers": {
    "vision": {
      "command": "npx",
      "args": ["-y", "mcp-vision-server"],
      "env": {
        "VISION_API_KEY": "...",
        "VISION_MODEL": "gpt-4o"
      }
    }
  }
}

Tool: analyze_image

analyze_image(image, question?)

Argument Required Description
image yes Image source: http(s):// URL, local absolute path, or data:<mime>;base64,<data> URL
question no Question to answer about the image; defaults to VISION_DEFAULT_PROMPT

The tool returns the vision model's text answer. Failures return an isError result with a readable Chinese message instead of throwing. Image bytes travel only to the configured vision API and never enter the calling client's model context.

Configuration

Env var Required Default Description
VISION_API_BASE_URL no https://api.openai.com/v1 OpenAI-compatible API root URL, without a trailing slash
VISION_API_KEY yes — API key; startup fails loud when missing
VISION_MODEL yes — Vision model name, e.g. gpt-4o, glm-4v-plus, qwen-vl-max
VISION_DEFAULT_PROMPT no 请详细描述这张图片的内容。 Prompt used when the caller passes no question
VISION_MAX_IMAGE_BYTES no 20971520 Upper bound on accepted image bytes
VISION_TIMEOUT_MS no 120000 Vision API call timeout in milliseconds

Model Experience

analyze_image tool (served through the MCP client bridge)

What the model sees

The tool is served to MCP clients with the pinned name analyze_image, description, and input schema. The description is verbatim:

Verbatim tool description
分析一张图片:传入图片 URL、本地绝对路径或 data URL(base64),可附带问题;返回视觉模型的文字回答。
Input schema field descriptions
image: 图片来源:http(s) URL、本地绝对路径或 data:image/...;base64,...
question: 可选问题;缺省时默认要求描述图片

Token effect

Fixed schema cost while a client keeps the tool registered, plus the tool result text in each conversation that calls it. The image bytes themselves never enter the client's model context.

KV Cache effect

Each analyze_image call issues an independent model request to the configured vision API, separate from the client's own request prefix; the server's behavior never invalidates client-side reuse. The bridged result text grows the client conversation append-only.

Known Limitations and Deferred Work

  • stdio only — no Streamable HTTP transport; the server is not reachable over the network.
  • Single image per call — one image argument only; multi-image analysis is deferred.
  • Tools only — the server exposes no MCP resources or prompts.
  • No image transformation — bytes are passed through as received; large or exotic formats depend on the vision provider's tolerance.
  • No URL allowlist — the server downloads whatever URL the caller passes, with no SSRF defense; keep it away from untrusted callers.

Development

pnpm install
pnpm test        # unit tests, 100% per-file coverage gate
pnpm test:e2e    # keyless stdio e2e against a stub vision API
pnpm build       # emit lib/

The e2e suite spawns the real bin over stdio and serves a stub OpenAI-compatible API over HTTP; no API key is needed.

Vision Bridge (paste images into text-only models)

vision-bridge.mjs is an OpenAI-compatible strip proxy (the same pattern as codex-vision-bridge) that gives text-only models image input: requests carrying image parts are answered by the vision MCP server, text-only requests pass through unchanged to the real text-only upstream.

# 1. Fill in the text-upstream key (only needed for text passthrough)
copy vision-bridge.env.example vision-bridge.env
# 2. Start the bridge
start-vision-bridge.cmd        # or: node vision-bridge.mjs
# 3. Point a provider at http://127.0.0.1:8787/v1 and declare the model
#    with input: [text, image] (e.g. a pi-ai provider entry in settings.yaml)

Fail-open: when the vision service fails, the request falls back to passthrough instead of breaking.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选