image-recognition-mcp
Allows vision-less LLMs to analyze clipboard images by proxying to an OpenAI-compatible vision model for description, OCR, and error diagnosis.
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., "@image-recognition-mcp What's in the screenshot in my clipboard?"
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.
clipboard-vision-mcp
给你的编码助手或 AI 工具装上"眼睛"。注册这个 MCP 服务后,原本没有视觉能力的 LLM 可以读取剪贴板截图、本地图片、HTTP(S) 图片 URL、data URL 或 base64 图片,并返回文字描述或对图片问题的回答。
LLM(无视觉)──MCP/stdio──► clipboard-vision-mcp ──OpenAI-compatible API──► 视觉模型 ──► 文本结果使用
1. 准备依赖
需要:
Node.js 20 或更高版本
能访问视觉模型的 OpenAI-compatible API key
剪贴板图片读取工具:
macOS:
brew install pngpasteWindows:系统内置 PowerShell,无需额外安装
Linux Wayland:
wl-paste(来自wl-clipboard)Linux X11:
xclip
包地址:clipboard-vision-mcp on npm
2. 配置 MCP Host
在 MCP Host 的 mcpServers 中添加,并按你的 OpenAI-compatible provider 填写 env:
{
"mcpServers": {
"clipboard-vision": {
"command": "npx",
"args": ["-y", "clipboard-vision-mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key",
"OPENAI_MODEL": "your-vision-model",
"OPENAI_BASE_URL": "https://your-openai-compatible-endpoint/v1"
}
}
}
}3. 验证
复制一张截图到剪贴板,然后向你的 AI 助手提问:
分析我剪贴板里的截图,上面有什么文字?
如果 MCP Host 已正确加载服务,助手会调用默认读取剪贴板的 recognize_image,然后返回图片内容。
Related MCP server: image_mcp
工具
recognize_image
单个通用图片识别工具。默认读取剪贴板,也可以通过 image 参数传入本地路径、HTTP(S) URL、data URL、base64 或 "clipboard"。
参数 | 类型 | 必填 | 默认值 | 说明 |
| string | 否 |
| 路径 / URL / data URL / base64 / |
| string | 否 |
| 对图片的提问或指令 |
|
| 否 |
| 视觉 detail 级别, |
| integer | 否 |
| 响应最大 token 数 |
示例问题:
描述这张截图
提取图片里的文字
这张 UI 截图里有什么错误提示?
这个图表表达了什么?
返回 { content: [{ type: "text", text: "..." }] };失败时返回 isError: true 和错误信息。
配置项
除在 MCP Host 的 env 中直接设置外,也支持项目根目录的 .env 文件。MCP Host 传入的环境变量优先级更高。
环境变量 | 默认值 | 说明 |
| 必填 | OpenAI-compatible API key |
|
| 视觉模型名 |
| OpenAI 默认地址 | OpenAI-compatible 网关地址 |
|
| 请求超时时间(毫秒) |
|
| 设为 |
| 空 | 路径 allowlist,逗号分隔,例如 |
Provider 配置示例:
OPENAI_API_KEY=...
OPENAI_MODEL=your-vision-model
OPENAI_BASE_URL=https://your-openai-compatible-endpoint/v1本地文件、data URL、原始 base64 和剪贴板输入必须是 PNG、JPEG、GIF、WebP 或 BMP 格式,单张不超过 20 MiB。HTTP/HTTPS URL 会作为 URL 直接传给 OpenAI-compatible API。
开发
从源码运行:
git clone <this-repo> image-recognition-mcp
cd image-recognition-mcp
npm install
npm run build本地调试:
npm run dev
# 或
npm run build && npm start如果从本地 clone 作为 MCP server 使用,配置里改用 "command": "node",args 指向 dist/index.js 的绝对路径。
服务通过 stdio 收发 MCP 消息:从 stdin 读 JSON-RPC,向 stdout 写回响应。
项目结构
clipboard-vision-mcp/
├── package.json
├── tsconfig.json
├── .env.example
└── src/
├── index.ts # MCP server 入口,注册工具和 stdio transport
├── config.ts # 加载和校验 env 配置
├── tools/
│ └── recognize.ts # 视觉工具定义和 handler
├── providers/
│ └── openai.ts # OpenAI-compatible 视觉调用
└── inputs/
├── index.ts # resolveImage() 分发器
├── types.ts
├── image.ts # 图片 MIME、大小、magic-byte 校验
├── file.ts # 本地路径转 base64
├── url.ts # HTTP(S) URL 透传
├── base64.ts # base64 / data URL
└── clipboard.ts # macOS / Windows / Linux 剪贴板图片读取License
MIT
Available Tools
1 toolrecognize_imageB
Recognize and analyze an image using the configured vision model. If no image is provided, reads the current clipboard image. Also supports local file paths, http(s) URLs, base64, data URLs, and the literal "clipboard".
Inputs: image, detail, prompt, maxTokens.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no ambiguity; the agent will always select the correct tool.
A single tool name is trivially consistent with itself, as there is no other tool to conflict.
One tool for image recognition is thin but acceptable if the tool is versatile. The tool handles many input formats, but more specialized tools might be expected.
The tool covers image recognition well with multiple input methods, but lacks additional operations like model selection or detailed output control.
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Screenshot, PDF and HTML-to-image rendering API so Claude and Cursor can see any web page.
Screenshot, PDF and HTML-to-image rendering API so Claude and Cursor can see any web page.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables text-only AI models to understand clipboard images by describing them through a vision model, eliminating manual file saving.1242MIT
- AlicenseNot gradedqualityDmaintenanceEnables text-only LLMs to analyze images by routing them to an OpenAI-compatible vision backend, supporting local files, URLs, and data URLs.18 npmMIT
- AlicenseAqualityDmaintenanceProvides image/vision support for OpenCode by routing images to any OpenAI-compatible endpoint, enabling paste-and-ask screenshot workflows.1MIT
- AlicenseAqualityCmaintenanceGives text-only LLM coding agents vision by routing images to a multimodal model and returning detailed textual descriptions. Supports local files, URLs, clipboard, base64, raw bytes, and multiple providers like OpenAI, Anthropic, and Gemini.174 npm13MIT