Skip to main content
Glama

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 build

Related 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 工具

工具

说明

vision_list_models

列出所有 provider 的启用/配置状态(绝不返回 Key)

vision_analyze

用指定 provider 分析图片,返回标准化 JSON

vision_get_setup_guide

配置指南与推荐供应商

vision_test_connection

测试 provider 连通性(perform_request=true 时发最小请求验证 Key)

vision_analyze 参数:

  • provider_id:必填,模型 ID

  • prompt:必填,分析任务

  • modegeneral / ocr / document / screenshot,默认 general

  • image_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

适用场景

成本说明

Gemini

gemini

通用看图、截图、图表、文档

可能有开发者免费额度

DashScope 通义千问 VL

openai-compatible

中文 OCR、中文文档、商品图、网页截图

低成本,可能有试用额度

SiliconFlow

openai-compatible

开源视觉模型、低成本测试

可能有赠送额度/低价模型

OpenRouter

openai-compatible

模型对比、免费模型试用

免费模型可能限流或下线

任意 OpenAI-compatible API

openai-compatible

私有网关/其他供应商

自行决定


接入 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/


环境变量

变量

默认值

说明

VISION_ROUTER_CONFIG

平台默认目录

配置文件路径

VISION_ROUTER_CONFIG_DIR

平台默认目录

配置目录(Windows:%APPDATA%\vision-router-mcp

VISION_ROUTER_ALLOWED_IMAGE_ROOTS

MCP Server 工作目录

本地图片允许目录(; 分隔)

VISION_ROUTER_MAX_IMAGE_BYTES

10485760

图片大小上限(字节)


隐私与安全

  • 图片会发送给用户选择的第三方视觉供应商,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 tools
vision_analyzeA

使用用户明确指定的云端视觉模型分析一张图片。必须提供 provider_id,且必须且只能提供 image_url、image_base64、image_path 之一。不要在参数中传递 API Key。

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNo分析模式:general 通用 / ocr 文字 / document 文档 / screenshot 截图general
promptYes用户希望对图片执行的分析任务
image_urlNo可由服务端访问的公网 HTTP/HTTPS 图片 URL
image_pathNoMCP Server 所在机器上、位于允许目录内的本地图片绝对路径
provider_idYesvision_list_models 返回的视觉模型 ID
image_base64No纯 Base64 图片,或 data:image/...;base64,...
image_mime_typeNoBase64 图片的 MIME 类型,例如 image/png
include_raw_responseNo是否返回视觉供应商原始文本,仅调试时使用

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the transparency burden. It discloses important parameter constraints and a security guideline (no API key), but it does not explain what the tool returns, whether it is read-only, or any authentication requirements. This leaves some behavioral aspects ambiguous.

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 two sentences long, front-loaded with the primary action, and every word adds value. There is no redundancy or filler; it is a model of concise, structured writing.

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?

Given the tool's complexity (8 parameters, 2 required, no output schema), the description covers critical constraints that are not evident from the schema alone. However, it does not mention return values or the available mode parameter, which would improve completeness. Yet, the schema covers those details, so the description is sufficient for basic use.

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?

The schema provides 100% coverage of parameter descriptions, giving a baseline of 3. The description adds value beyond the schema by stating that exactly one of image_url, image_base64, or image_path must be provided, which is not enforced in the schema. It also reinforces the security note about not passing an API key.

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 function: analyzing an image using a user-specified cloud vision model. It uses a specific verb (analyze) and resource (image with vision model), and it distinguishes itself from sibling tools like vision_list_models, vision_get_setup_guide, and vision_test_connection by focusing on the analysis action itself.

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

Usage Guidelines4/5

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

The description gives explicit usage constraints: must provide provider_id, exactly one of image_url/image_base64/image_path, and do not pass API keys. While it does not explicitly name alternative tools for when not to use this one, the constraints and the tool's dedicated role make the usage context clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

vision_get_setup_guideA

返回视觉模型配置说明和推荐供应商。不会自动选择或启用任何模型。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states that the tool will not automatically select or enable any models, which is a useful non-mutation guarantee. However, it does not disclose return format, whether it is purely read-only beyond the stated behavior, or any other limitations.

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 exactly two sentences, front-loaded with the primary purpose and followed by a brief non-action statement. Every word earns its place; no filler or redundancy.

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?

For a simple tool with no parameters, no output schema, and no annotations, the description is complete. It states what the tool returns, what it does not do, and is adequate for an agent to understand its function and side-effect profile.

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?

The tool has zero parameters, so the schema description coverage is trivially 100%. Per guidelines, a 0-parameter tool receives a baseline of 4. The description adds no parameter semantics because none exist.

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 returns visual model configuration instructions and recommended suppliers. This specific verb-resource pairing ('returns... instructions') differentiates it from siblings like vision_list_models (lists models), vision_analyze (analyzes), and vision_test_connection (tests connections).

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

Usage Guidelines4/5

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

The description provides clear context: use this tool when you need configuration instructions and supplier recommendations. The explicit 'will not automatically select or enable any models' implies it is a reference guide, but it does not explicitly name alternative tools or provide when-not-to-use conditions, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

vision_list_modelsA

列出所有视觉模型配置及其启用和 API Key 配置状态。不会返回 API Key。系统没有默认视觉模型,调用 vision_analyze 时必须明确指定 provider_id。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It explicitly states that API keys are not returned and that there is no default vision model, which are important behavioral traits. It does not disclose auth requirements or response format, but for a simple listing tool these are less critical.

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, two sentences long, with the main purpose front-loaded. Every sentence adds value: the first states what is listed, the second adds a security-relevant caveat and usage context.

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?

For a zero-parameter listing tool, the description provides sufficient context: it names the output scope, notes that API keys are not returned, and gives usage guidance about provider_id. It could mention the structure of the list, but this is a minor gap given the simple nature of the tool.

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?

The tool has 0 parameters, so the baseline is 4. The description adds no parameter-specific information, but none is needed. The schema coverage is effectively 100% since there are no params to document.

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 uses the specific verb '列出' (list) and names the resource '所有视觉模型配置' (all vision model configurations), making it clear what the tool does. It also distinguishes from sibling tools by mentioning vision_analyze's requirement for an explicit provider_id, implying this tool is used to discover available models.

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

Usage Guidelines4/5

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

The description indirectly guides usage by stating that vision_analyze has no default model and requires explicit provider_id, suggesting this tool is useful for finding that ID. However, it does not explicitly say 'use this tool when you need to list models' or contrast with vision_get_setup_guide or vision_test_connection, so it's clear but not fully explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

vision_test_connectionA

测试某个已配置 provider 的连通性(Key/模型/端点)。默认只检查配置;perform_request=true 时发送最小文本请求验证认证。不会接收 API Key。

ParametersJSON Schema
NameRequiredDescriptionDefault
provider_idYes要测试的视觉模型 ID
perform_requestNo是否真正发送一次最小请求验证 Key 有效性

TDQS

A4.4/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 full burden. It discloses that the tool does not accept an API Key, that perform_request sends a minimal text request, and that the default is config-only. This adds meaningful behavioral context beyond the schema, though it does not explicitly state whether the operation is read-only or has side effects.

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 two sentences, front-loaded with the core purpose, and contains no filler. Every clause adds relevant information about behavior and constraints, making it highly efficient.

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?

For a simple tool with two parameters and no output schema, the description covers purpose, default behavior, optional request mode, and a key constraint. It lacks explicit details about return values or error handling, but for a test-connection tool this is adequate and matches the tool's simplicity.

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 description coverage is 100%, so the baseline is 3. The description adds value by emphasizing that perform_request=true sends a minimal request to verify authentication, and by clarifying that provider_id refers to a vision model. It also sets expectations by stating that no API Key is accepted, which indirectly informs parameter use.

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 '测试某个已配置 provider 的连通性' – a specific verb (test), resource (configured provider), and scope (Key/Model/Endpoint). It also distinguishes from siblings like vision_list_models (listing) and vision_analyze (analysis), making the tool's unique purpose clear.

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

Usage Guidelines4/5

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

The description explains two usage modes: default config-only check and perform_request=true for actual authentication verification. It also notes that it does not accept an API Key, implying it is for pre-configured providers. However, it does not explicitly mention alternatives or when not to use this tool, missing an opportunity for clearer differentiation.

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. 4 tool updatesv0.1.0
    • First observedvision_analyze
    • First observedvision_get_setup_guide
    • First observedvision_list_models
    • First observedvision_test_connection

TDQS

A4.4/5.0

Scored across 4 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    Not graded
    maintenance
    Enables 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
    -