跪拜 Guibai
← All articles
AI Coding · Full Stack · Artificial Intelligence

A Local Proxy Gives Text-Only LLMs Inside Claude Code the Ability to See Images

By Staticy ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Developers using Claude Code with cheaper or self-hosted text-only models lose the ability to paste screenshots and design drafts—a core workflow in AI-assisted coding. A one-minute local proxy setup restores that workflow without switching models, and the auto-classification means the text descriptions are structured for the task at hand rather than generic captions.

Summary

Text-only models such as GLM and DeepSeek reject any request containing an image when used through Claude Code, returning a 400 error. The typical workaround—manually describing the image to a separate vision model first—breaks flow and wastes time. image-vision-mcp solves this with a local HTTP proxy that sits between Claude Code and the upstream LLM, intercepting images, running them through a configurable vision model (Doubao, Kimi, GLM-4V, Qwen-VL, or GPT-4o), and replacing the binary payload with a structured text description before forwarding the request.

The tool also ships a standalone MCP server that exposes a `vision_describe_image` tool supporting local file paths and URLs. An automatic classification mode detects whether an image is a design draft, wireframe, bug screenshot, or general picture, then applies a tailored prompt template so the resulting description is immediately useful for code generation or debugging. Token budgets are allocated per mode, and truncated outputs trigger an automatic retry with a higher limit.

Setup requires editing two JSON config files and restarting Claude Code. The proxy listens on localhost, denies private-network image URLs by default to prevent SSRF, and works with any vision model that exposes an OpenAI-compatible `/chat/completions` endpoint with base64 image support.

Takeaways
Text-only models like GLM and DeepSeek return 400 errors when Claude Code sends them image data, because they lack multimodal input support.
A local HTTP proxy on 127.0.0.1:8787 intercepts image-bearing requests, calls a vision model to describe the image, and forwards only text to the upstream LLM.
The proxy supports any vision model with an OpenAI-compatible /chat/completions endpoint and base64 image input, including Doubao, Kimi, GLM-4V, Qwen-VL, and GPT-4o.
An auto-classification mode detects whether an image is a design draft, wireframe, bug screenshot, or general picture, and applies a prompt template optimized for that category.
Token budgets are allocated per classification mode; if output is truncated, the tool automatically retries with a higher max_tokens limit.
SSRF protection is on by default—private-network image URLs are denied unless explicitly allowed via an environment variable.
Integration requires adding an MCP server entry to ~/.claude.json and setting proxy environment variables in ~/.claude/settings.json, then restarting Claude Code.
Conclusions

Bridging text-only models into a multimodal workflow through a proxy is cheaper and more flexible than waiting for every model provider to ship native vision support, and it decouples the coding model choice from the vision model choice.

The auto-classification design acknowledges that 'describing an image' is not one task but several—a design spec, a bug report, and a chart each demand different output structures to be actionable for a downstream coding agent.

Default-deny on private-network image URLs in a local proxy is a security detail that is easy to overlook but critical, since a tool that fetches arbitrary URLs from a developer's machine is a ready-made SSRF vector.

Concepts & terms
MCP (Model Context Protocol)
An open protocol from Anthropic that standardizes how AI coding tools like Claude Code connect to external tools and data sources. An MCP server exposes tools—such as image recognition—that the AI can invoke during a session.
SSRF (Server-Side Request Forgery)
An attack where an attacker tricks a server into making requests to internal or private network resources. In this tool, the proxy fetches image URLs on behalf of the user, so it defaults to blocking private IP ranges to prevent abuse.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗