vision-mcp
Allows sending images to OpenAI-compatible vision API endpoints to recognize and describe image content, or perform OCR to extract text from images.
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., "@vision-mcpExtract the text from this image: /tmp/screenshot.png"
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.
vision-mcp-node
MCP 服务器:直连远程多模态模型 API 识别图片 / OCR,不经过任何本地代理。
工具
recognize_image(image, prompt?)— 识别/描述图片内容工具
ocr_image(image, language?)— 从图片提取文字工具
vision_version()— 查看当前服务配置(模型/供应商/Key 状态)支持任意 OpenAI 兼容视觉端点(阿里云百炼、OpenAI、硅基流动等)
图片输入:本地路径 /
http(s)://URL(默认直传不下载)/data:URL大图自动压缩、输出截断自动重试、错误分类提示
快速开始(全局安装,推荐)
# 1. 安装(只需一次)
npm install -g vision-mcp-node
# 2. 配置 API Key(默认已指向阿里云百炼 + qwen3.7-plus)
export VISION_API_KEY=sk-你的Key
# 永久生效可写入:echo 'export VISION_API_KEY=sk-你的Key' >> ~/.bashrc
# 3. 验证安装
npm ls -g vision-mcp-node # 显示 vision-mcp-node@1.0.1
vision-mcp # 以 stdio 启动,等 MCP 客户端连接(Ctrl+C 退出)然后只需在 MCP 客户端配置里加一段最小配置:
{
"mcpServers": {
"vision-mcp": {
"command": "vision-mcp",
"args": []
}
}
}Key 已通过环境变量传给客户端,无需写进 JSON。
Related MCP server: vision-mcp-server
或者:npx 免安装即用
不全局安装,直接在 claude_desktop_config.json / mcp.json / Reasonix 配置中用 npx 拉起:
{
"mcpServers": {
"vision-mcp": {
"command": "npx",
"args": ["-y", "vision-mcp-node"],
"env": {
"VISION_API_KEY": "${VISION_API_KEY}",
"VISION_BASE_URL": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"VISION_MODEL": "qwen3.7-plus"
}
}
}
}
"${VISION_API_KEY}"会让客户端读取你机器上的同名环境变量,Key 不落盘。 也可以直接填字符串,但注意别把配置提交到公开仓库。 想换供应商时,在env里覆盖VISION_BASE_URL/VISION_MODEL即可(见下方配置表)。
接入 Codex(TOML 格式)
Codex 的 MCP 配置在 ~/.codex/config.toml(TOML 不是 JSON)。全局安装后只需:
# ~/.codex/config.toml
[mcp_servers.vision-mcp]
command = "vision-mcp"用 npx 免安装版(显式传 env,Key 用 ${VISION_API_KEY} 从环境变量读取、不落盘):
# ~/.codex/config.toml
[mcp_servers.vision-mcp]
command = "npx"
args = ["-y", "vision-mcp-node"]
env = {
VISION_API_KEY = "${VISION_API_KEY}",
VISION_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1",
VISION_MODEL = "qwen3.7-plus"
}改完执行 codex 重启会话生效(或 codex mcp list 检查是否加载)。
配置(环境变量)
变量 | 必填 | 默认值 |
| ✅ | —(也认 |
| 否 |
|
| 否 | 随 |
| 否 | 随 |
| 否 |
|
| 否 |
|
| 否 |
|
| 否 |
|
| 否 |
|
供应商预设(VISION_PROVIDER)
| 默认端点 | 默认模型 |
|
|
|
|
|
|
|
|
|
显式设置 VISION_BASE_URL / VISION_MODEL 会覆盖预设。
工具用法
recognize_image("C:/a.png")— 描述本地图片recognize_image("https://example.com/a.jpg", prompt="图中横幅写了什么字?")recognize_image("data:image/png;base64,....")— 直接传 data URLocr_image("C:/a.png", language="en")— 提取英文文字
本地开发 / 调试
git clone https://github.com/sulghu/vision-mcp.git && cd vision-mcp-node
npm install
npm test # 端到端(本地假视觉 API,不需真实 Key)
node server.js # 以 stdio 启动,等 MCP 客户端连接
# 或直接命令行冒烟:识别一张图(需要真实 Key)
export VISION_API_KEY=sk-xxxx
node -e "import('./analyze_image.mjs').then(m=>m.default('C:/a.png'))" # 见 analyze_image.mjs发布到 npm(维护者用)
npm login # 用你的 npm 账号登录
npm version patch # 或 minor / major
npm publish # 发布(先跑 npm pack 检查内容)
npx -y vision-mcp-node # 验证安装可用发布前务必检查:npm pack --dry-run 列出的文件里不能包含任何 API Key / .mcp.json / 本地测试脚本(files 字段已限定为 server.js + README.md + LICENSE)。
原理
MCP 客户端 (Claude/Codex/Reasonix...)
└─ stdio → vision-mcp-node (npx 拉起,stdio)
└─ fetch POST {VISION_BASE_URL}/chat/completions
(OpenAI 兼容,图片 base64 data URL 内联发送)This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
MCP server for NanoBanana AI image generation and editing
MCP server for Flux AI image generation
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for analyzing images using OpenRouter vision models, offering capabilities like automatic image resizing, model configuration, and handling custom queries about images.10MIT
- AlicenseAqualityCmaintenanceAn MCP server for analyzing images using ModelScope's vision models. Supports both local files and URLs, enabling image content description and question answering.1166 npm11MIT
- AlicenseAqualityAmaintenanceA portable image-understanding MCP server that lets agents analyze local images, URLs, or base64 images via an OpenAI-compatible vision model.154 npm72MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables any LLM to describe images from file paths, URLs, or base64 data by forwarding them to a supported vision provider such as OpenAI, Anthropic, or local Ollama models.693 npm10MIT