agent-vision-mcp
Enables non-vision LLMs to analyze images via any OpenAI-compatible vision API. Hardened against truncation, empty responses, and timeouts for reliable analysis.
README
agent-vision-mcp (hardened)
A hardened fork of @kitlau/agent-vision-mcp
— an MCP server that gives non-vision LLMs the ability to analyze images via any
OpenAI-compatible vision API (Claude Code, DeepSeek, etc.).
This build fixes intermittent empty / truncated image-analysis results and request hangs that affect long outputs (e.g. high-resolution 3D render screenshots) against self-hosted Qwen VLMs and similar backends.
What was broken upstream
The upstream package:
- defaulted output
max_tokensto 1024 and never grew it, so long analyses hitfinish_reason: lengthand were cut off mid-sentence — and intermittently returned emptycontent, surfacing as❌ 视觉 API 返回的内容为空; - only read
message.content, ignoringmessage.reasoning_contentused by Qwen3.x thinking-style models; - had no retry on empty / 5xx / 429 / transient network errors;
- set no client timeout, so slow high-res inference could hang and get killed
(
MCP error -32001: user-cancel).
What this build changes
dist/vision-client.js:
- Grows
max_tokenson truncation (finish_reason === "length") and retries, so a low ceiling can never silently produce a partial/empty answer (grow ceiling: 32768). - Falls back to
message.reasoning_contentwhencontentis empty (Qwen thinking mode). - Retries on empty results, 5xx, 429, and network/timeout errors with exponential backoff (default 3 retries).
- Sets an explicit client timeout (default 300000 ms) to prevent hangs.
dist/config.js:
- Adds
VISION_MAX_TOKENS(default 16384),VISION_TIMEOUT_MS(default 300000),VISION_MAX_RETRIES(default 3) env vars, exposed on the config object.
Install as an MCP server
Point your MCP client at this repo. Example claude_desktop_config.json /
.mcp.json / global ~/.claude.json entry:
{
"mcpServers": {
"agent-vision": {
"type": "stdio",
"command": "node",
"args": ["path/to/this/repo/dist/index.js"]
}
}
}
For a drop-in remote install, clone this repo and npm install, then run node dist/index.js.
Or add it as a dependency with npm install github:aabbccddwasd/agent-vision-mcp.
Environment variables
| Variable | Default | Description |
|---|---|---|
VISION_API_KEY |
(required) | API key for the OpenAI-compatible endpoint |
VISION_BASE_URL |
https://api.openai.com/v1 |
OpenAI-compatible base URL |
VISION_MODEL_NAME |
gpt-4o |
The vision model, e.g. Qwen3.6-35B-A3B |
VISION_MAX_TOKENS |
16384 |
Output token budget (was 1024 upstream) |
VISION_TIMEOUT_MS |
300000 |
Per-request client timeout |
VISION_MAX_RETRIES |
3 |
Retries for empty / 5xx / 429 / network errors |
VISION_CACHE_ENABLED |
false |
Optional disk response cache |
VISION_CACHE_DIR |
<tmp>/agent-vision-cache |
Cache directory (when enabled) |
VISION_MAX_IMAGE_SIZE |
20971520 |
Max image bytes (20 MB) |
License
MIT. Original author: kitlau86.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.