vision-helper-mcp-server
An MCP server that adds vision capability to any LLM by forwarding images to OpenRouter vision models, returning text analysis. Supports image analysis, model listing, and config diagnostics.
README
Vision Helper MCP Server
An MCP server that adds vision capability to any LLM. Models that cannot see images
(the text-only LLM driving your MCP client) call vision_helper_analyze_image, and this server
forwards the image to a vision-capable model on OpenRouter,
then returns the analysis as text.
Built as a more robust replacement for
TheNomadInOrbit/Vision-MCP-Server:
no build-step assumptions, lazy key resolution, Windows setx-style environment variable
support, image format sniffing, request retries, and clear actionable errors.
Requirements
- Node.js 18+ (tested on 22)
- An OpenRouter API key (
sk-or-v1-...)
Install
npm install -g vision-helper-mcp-server
This installs the vision-helper-mcp command globally (the compiled dist is the
only published content). Quick check:
vision-helper-mcp --help
Development / from source
git clone https://github.com/<you>/vision-helper-mcp-server.git
cd vision-helper-mcp-server
npm install
npm run build
node dist\index.js --help
Configuration
The API key and options are resolved, in priority order:
- Process environment variables — set in your MCP client's
env/environmentconfig (recommended; this is also whereOPENROUTER_MODELusually lives). - Windows user environment variables — read directly from the registry
(
HKCU\Environment), i.e. whatsetxwrites. This matters: GUI apps (VS Code, Kilo, Claude Desktop, ...) do not re-read user env vars changed after they were launched, so a key set withsetxafter launching the client would otherwise be invisible. The server reads the registry itself, sosetxvalues work with no client restart. - Windows system environment variables — registry
HKLM\SYSTEM\...\Session Manager\Environment.
On non-Windows platforms only step 1 applies.
| Variable | Purpose | Default |
|---|---|---|
OPENROUTER_API_KEY |
OpenRouter API key (required for analysis) | — |
OPENROUTER_MODEL |
Default vision model ID | google/gemini-3.6-flash |
MAX_IMAGE_SIZE |
Max image payload bytes | 10485760 (10 MB) |
OPENROUTER_TIMEOUT_MS |
Per-request timeout | 120000 (120 s) |
The model can also be chosen per call via the
modelargument ofvision_helper_analyze_image, overriding the environment default.
Kilo (VS Code extension) configuration
Add this server as its own MCP entry (it does not replace or share tools with any
other vision server you have configured). This example appends a vision-helper entry
to the mcp object in your Kilo config file (e.g. ~/.config/kilo/kilo.json on
Windows):
"vision-helper": {
"type": "local",
"command": ["vision-helper-mcp"],
"enabled": true,
"timeout": 120000,
"environment": {
"OPENROUTER_MODEL": "google/gemini-3.6-flash"
}
}
OPENROUTER_API_KEY is optional here: if the key is set as a Windows user environment
variable (setx OPENROUTER_API_KEY sk-or-v1-...), the server picks it up automatically
by reading the registry — no client restart needed. Add the key to the environment
block only if you want it explicit in the config.
Claude Desktop / other clients
{
"mcpServers": {
"vision-helper": {
"command": "vision-helper-mcp",
"env": {
"OPENROUTER_API_KEY": "sk-or-v1-...",
"OPENROUTER_MODEL": "google/gemini-3.6-flash"
}
}
}
}
Tools
This server is a standalone MCP server with its own tool names
(vision_helper_*), so it can run side by side with other vision MCP servers
without tool collisions.
vision_helper_analyze_image
Analyze one or more images with an OpenRouter vision model.
| Argument | Type | Description |
|---|---|---|
image |
string | string[] |
Required. An http(s) URL, local file path, file:// URI, data: URI, or raw base64 string. Pass an array (up to 5) to analyze several images together, e.g. to compare screenshots. Only PNG, JPEG, WebP, and GIF are accepted (the formats OpenRouter supports for vision input); relative file paths resolve against the MCP client's working directory, so prefer absolute paths or URLs. |
prompt |
string |
Optional instruction, e.g. "Transcribe all text in this screenshot". Defaults to a general detailed description. |
model |
string |
OpenRouter model ID, e.g. google/gemini-3.6-flash. Defaults to OPENROUTER_MODEL, then to the built-in default. |
max_tokens |
number |
Max tokens for the answer (64–16000). |
temperature |
number |
Sampling temperature (0–2). |
Examples of things to ask your assistant:
- "What is in this image? https://example.com/photo.jpg"
- "Analyze the screenshot at C:\Users\me\Pictures\shot.png"
- "Compare these two images: img1.png and img2.png" (pass an array)
- "Read the text from this image and list the objects: <path>"
vision_helper_list_models
List vision-capable models currently on OpenRouter (filtered to image-input models) so
you or the user can pick one. Arguments: search (substring on ID/name, e.g. gemini,
qwen, claude), limit (default 25), offset, response_format (markdown|json).
vision_helper_check_config
Diagnose setup: shows whether an API key was found, which source it came from
(client env / Windows user vars / Windows system vars), the default model, and the
size/time limits. The key is always masked (e.g. sk-or-…40a0).
Reliability notes
- The server starts even when no key is configured; key resolution is lazy, so a key
set with
setxworks without restarting anything. - Chat-completion requests retry up to 3 times on 429 / 5xx / network errors, honoring
Retry-Afterwhen present. - Image downloads are streamed with a hard byte cap and a 30 s timeout; MIME type is sniffed from magic bytes, so raw base64 payloads need no explicit type. Only the formats OpenRouter supports for vision input are accepted: PNG, JPEG, WebP, GIF (others are rejected with conversion guidance before anything is uploaded).
- Remote image URLs are validated before fetching: redirects are followed manually (max 3 hops) and every hop must be a public http(s) host — private, loopback, link-local, and unresolved hosts are refused.
- The model catalog used by
vision_helper_list_modelsis cached in-process for 10 minutes. - Errors returned to the model are actionable: invalid key (401), insufficient credits
(402), unknown model (404, with a hint to call
vision_helper_list_models), rate limit (429), oversized images (with the exact limit), and unsupported formats.
Troubleshooting
| Symptom | Fix |
|---|---|
vision_helper_analyze_image returns "No OpenRouter API key found" |
Run vision_helper_check_config. Set the key in the client's environment, or setx OPENROUTER_API_KEY sk-or-v1-... and start the client fresh. |
| "resolved from: Windows user environment variables" but the key is stale | Keys are read from the registry each time a tool runs, so an updated setx is picked up immediately — no reboot needed. |
| "Error: Model not found on OpenRouter (HTTP 404)" | The model ID is invalid, renamed, or deprecated. Run vision_helper_list_models and pass a current ID via the model argument. |
| "Error: Insufficient OpenRouter credits (HTTP 402)" | Add credits at https://openrouter.ai/settings/credits. |
| "Image is N bytes, which exceeds MAX_IMAGE_SIZE" | Shrink/compress the image, or raise MAX_IMAGE_SIZE (cap 50 MB). |
| "The N images total X bytes, exceeding the aggregate limit" | Analyzes are capped at 25 MB total across all images per request — split into multiple calls. |
| "OpenRouter vision models only accept PNG, JPEG, WebP, or GIF" | Convert the image (e.g. to PNG/JPEG) and retry — these are the formats OpenRouter supports for vision input. |
| "Error: OpenRouter rate limit or quota exceeded (HTTP 429)" | Wait a moment and retry; the server already retries transient 429s automatically. |
| HTTP 400 on a valid image | Some models accept fewer formats — try google/gemini-3.6-flash or openai/gpt-5 family, or convert the image to PNG/JPEG. |
Security
- The API key is only sent to OpenRouter over HTTPS; it is never logged, and
vision_helper_check_configreports only a masked prefix. - Keys are read from environment variables / the registry — never from files in this repository.
- The analysis tool reads local files only when explicitly requested, validates remote URLs against private/internal hosts, and only ever uploads image content in the four formats OpenRouter accepts.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。