vision-router-mcp
Provides integration with Google's Gemini API for visual analysis, enabling image understanding, OCR, and document parsing through Gemini vision models.
Click on "Deploy 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., "@vision-router-mcp Analyze the image at /path/to/image.jpg and summarize it"
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.
Vision Router MCP
一个 BYOK(Bring Your Own Key)云端视觉模型路由 MCP Server。
当前主模型(Claude Code / Codex / Hermes Agent 等)看不了图时,由它调用用户自己选择并配置的云端视觉 API 分析图片,返回标准化结构(摘要 / OCR 文字 / 物体 / 文档类型 / 表格 / 关键细节 / 不确定项),再由当前 Agent 做推理和最终回答。
支持 Gemini 原生 API 和任意 OpenAI-compatible 视觉 API(DashScope / SiliconFlow / OpenRouter / 私有网关……)
没有默认视觉模型,每次分析必须由用户明确指定
provider_id不内置、不托管任何公共 API Key,密钥只通过环境变量注入
内置 SSRF 防护、密钥脱敏、图片格式/大小校验、统一 JSON 输出
可在 Claude Code、OpenAI Codex CLI、Nous Research Hermes Agent 中使用
⚠️ 任何云端视觉模型的"免费"额度、限流、可用地区和模型名称都会变化,本项目不承诺任何模型永久免费,请以各服务商当前官方政策为准。
安装
要求:Node.js 20+
# 方式一:从 GitHub Release 下载 zip
# 下载 https://github.com/wotonger/vision-router-mcp/releases/latest
# 解压后进入目录,然后:
cd vision-router-mcp
npm install
npm run build
# 方式二:git clone 源码
git clone https://github.com/wotonger/vision-router-mcp.git
cd vision-router-mcp
npm install
npm run buildRelated MCP server: mcp-see
初始化配置
# 生成配置文件(Windows:%APPDATA%\vision-router-mcp\providers.json)
node dist/index.js init
# 查看配置路径
node dist/index.js config-path
# 体检:检查 Node 版本、配置合法性、启用的 provider、Key 是否就绪
node dist/index.js doctor编辑生成的 providers.json,把要用的 provider 的 enabled 改为 true,并按需修改 model / baseUrl / apiKeyEnv。配置文件里绝不写 Key 明文。
配置 API Key(Windows)
在 PowerShell 中设置用户环境变量(设置后重启终端和 MCP 客户端):
[Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "你的Key", "User")
[Environment]::SetEnvironmentVariable("DASHSCOPE_API_KEY", "你的Key", "User")注意:Hermes Agent 的 MCP 子进程只继承白名单环境变量,必须把 Key 显式写进 Hermes 的
mcp_servers.<name>.env(见下文),仅设置系统环境变量是不够的。
MCP 工具
工具 | 说明 |
| 列出所有 provider 的启用/配置状态(绝不返回 Key) |
| 用指定 provider 分析图片,返回标准化 JSON |
| 配置指南与推荐供应商 |
| 测试 provider 连通性( |
vision_analyze 参数:
provider_id:必填,模型 IDprompt:必填,分析任务mode:general/ocr/document/screenshot,默认generalimage_url/image_base64/image_path:三选一include_raw_response:默认false
统一返回结构:
{
"success": true,
"provider": { "id": "dashscope-qwen-vl", "model": "qwen-vl-plus" },
"latency_ms": 1234,
"structured_output_parsed": true,
"result": {
"summary": "一张商品页面截图",
"ocr_text": ["无线蓝牙耳机", "限时价 199 元"],
"objects": ["耳机", "价格区域"],
"document_type": null,
"table_data": [],
"important_details": ["显示限时优惠"],
"uncertainties": ["右下角促销规则文字模糊"]
}
}推荐供应商(用户自行选择)
供应商 | type | 适用场景 | 成本说明 |
| 通用看图、截图、图表、文档 | 可能有开发者免费额度 | |
| 中文 OCR、中文文档、商品图、网页截图 | 低成本,可能有试用额度 | |
| 开源视觉模型、低成本测试 | 可能有赠送额度/低价模型 | |
| 模型对比、免费模型试用 | 免费模型可能限流或下线 | |
任意 OpenAI-compatible API |
| 私有网关/其他供应商 | 自行决定 |
接入 Claude Code
项目根目录 .mcp.json:
{
"mcpServers": {
"vision-router": {
"command": "node",
"args": ["C:/Users/<你>/Projects/vision-router-mcp/dist/index.js"],
"env": {
"DASHSCOPE_API_KEY": "你的Key"
}
}
}
}把
C:/Users/<你>/Projects/vision-router-mcp替换为你的实际项目路径(Windows 用正斜杠)。
Skill 安装到项目:
mkdir -p .claude\skills\vision-router
Copy-Item C:\Users\<你>\Projects\vision-router-mcp\skills\vision-router\SKILL.md .claude\skills\vision-router\SKILL.md接入 OpenAI Codex CLI
编辑 %USERPROFILE%\.codex\config.toml:
[mcp_servers.vision-router]
command = "node"
args = ["C:/Users/<你>/Projects/vision-router-mcp/dist/index.js"]
[mcp_servers.vision-router.env]
DASHSCOPE_API_KEY = "你的Key"把路径替换为你的实际项目路径。
Skill 可安装到 %USERPROFILE%\.agents\skills\vision-router\SKILL.md(路径以当前 Codex 版本文档为准)。
接入 Nous Research Hermes Agent
Hermes 原生支持 MCP stdio。编辑 Hermes 配置文件(默认 ~/.hermes/config.yaml,本机 Windows 安装常见于 %LOCALAPPDATA%\hermes\config.yaml,以 hermes doctor 输出为准):
mcp_servers:
vision-router:
command: "node"
args: ["C:/Users/<你>/Projects/vision-router-mcp/dist/index.js"]
env:
DASHSCOPE_API_KEY: "你的Key"
timeout: 120重启 Hermes 后工具以 mcp_vision_router_vision_analyze 等名称自动注入(前缀 mcp_{server}_{tool})。注意 Hermes 对 MCP 子进程做环境变量白名单过滤,Key 必须写在 env 里。
Skill 放入 Hermes skills 目录:$HERMES_HOME/skills/vision-router/SKILL.md(本机为 C:\Users\<你>\AppData\Local\hermes\skills\vision-router\SKILL.md)。
更多细节见 Hermes 官方文档的 MCP 章节:https://hermes-agent.nousresearch.com/docs/
环境变量
变量 | 默认值 | 说明 |
| 平台默认目录 | 配置文件路径 |
| 平台默认目录 | 配置目录(Windows: |
| MCP Server 工作目录 | 本地图片允许目录( |
|
| 图片大小上限(字节) |
隐私与安全
图片会发送给用户选择的第三方视觉供应商,MCP 不控制第三方数据政策,敏感图片请谨慎使用。
API Key 只从环境变量读取,不出现在任何工具参数、日志、错误消息中。
图片 URL 做 SSRF 防护:禁止 localhost、私网、回环、链路本地、云元数据地址,重定向逐跳重新校验。
本地图片只能读取允许目录内的文件(realpath 防目录穿越)。
详见 SECURITY.md。
开发
npm install
npm run typecheck
npm test
npm run build
npm pack --dry-run许可证
MIT
Available Tools
4 toolsvision_analyzeA
使用用户明确指定的云端视觉模型分析一张图片。必须提供 provider_id,且必须且只能提供 image_url、image_base64、image_path 之一。不要在参数中传递 API Key。
Inputs: prompt (required), provider_id (required), mode, image_url, +4 more.
vision_get_setup_guideA
返回视觉模型配置说明和推荐供应商。不会自动选择或启用任何模型。
Inputs: no named parameters.
vision_list_modelsA
列出所有视觉模型配置及其启用和 API Key 配置状态。不会返回 API Key。系统没有默认视觉模型,调用 vision_analyze 时必须明确指定 provider_id。
Inputs: no named parameters.
vision_test_connectionA
测试某个已配置 provider 的连通性(Key/模型/端点)。默认只检查配置;perform_request=true 时发送最小文本请求验证认证。不会接收 API Key。
Inputs: provider_id (required), perform_request.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool serves a clearly distinct purpose: listing configurations, providing setup guidance, analyzing images, and testing connections. No two tools overlap in functionality, so an agent can easily select the right one.
All tools share the 'vision_' prefix and generally follow a verb_noun pattern (list_models, get_setup_guide, test_connection). 'vision_analyze' is slightly inconsistent as it lacks a noun, but the pattern is still highly predictable and readable.
With 4 tools, the server is tightly scoped to the vision-routing domain. Each tool is essential and there are no redundant or unnecessary additions.
The tool surface covers the full lifecycle for a vision router: discovering available models, understanding setup, testing connectivity, and performing analysis. No obvious gaps exist for the stated purpose.
Maintenance
Related MCP Connectors
Run AI-powered analysis on images including moderation, captioning, tagging, and more.
Image & PDF tools for AI agents: compress, convert, resize, PDF, AI vision, pipeline.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Analyze images and videos with Gemini to get fast, reliable visual insights. Handle content from U…
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables image analysis and understanding using Vision Language Models through OpenAI-compatible APIs. Supports analyzing images from URLs or local files with custom prompts.12MIT
- FlicenseAqualityNot gradedmaintenanceEnables AI agents to analyze images through vision AI providers (Gemini, OpenAI, Claude), performing tasks like image description, object detection with bounding boxes, region-specific analysis, and precise color extraction without consuming context window with raw pixels.4-
- AlicenseAqualityDmaintenanceEnables AI agents to analyze images, extract text, compare images, and analyze video through any OpenAI-compatible vision model.4375 npm20MIT
- AlicenseNot gradedqualityDmaintenanceEnables image recognition using vision models via OpenAI-compatible APIs, supporting multiple platforms like OpenAI, DeepSeek, and Ollama.ISC