MCP Vision Server
Integrates with OpenAI-compatible vision APIs to provide advanced image recognition, detailed content description, OCR text extraction, and multi-turn visual dialogue capabilities.
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., "@MCP Vision Server Extract all the text from C:/Users/Documents/invoice.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.
MCP Vision Server - 图像识别 MCP 服务器
提供图像分析能力的 MCP 服务器,支持图像识别、文字提取、多轮对话等功能。
特性
图像分析 - 支持各种图像内容识别与描述
多轮对话 - 基于图像的连续问答
灵活输入 - 支持本地文件路径和 Base64 编码
OpenAI 兼容 - 使用 OpenAI 兼容 API,支持多种视觉模型
会话持久化 - 对话历史可持久化存储
Related MCP server: Image Parse MCP
安装
# 克隆仓库
git clone https://github.com/YOUR_USERNAME/mcp-vision-server.git
cd mcp-vision-server
# 创建虚拟环境
python -m venv venv
source venv/Scripts/activate # Windows Git Bash
# 安装依赖
pip install -e .配置
复制环境变量模板:
cp .env.example .env编辑
.env文件,填入您的 API 配置:
# 必填配置
VISION_API_KEY=your-api-key-here
VISION_BASE_URL=https://open.bigmodel.cn/api/paas/v4/
VISION_MODEL=glm-4v使用方法
启动服务器
mcp-vision-server或直接运行:
python -m mcp_vision.serverWeb 配置工具
启动 Web 配置界面,支持热加载配置:
mcp-vision-config或指定端口:
mcp-vision-config --host 127.0.0.1 --port 8080访问 http://127.0.0.1:7860 即可打开配置界面。
功能特性:
📝 可视化编辑所有配置项
🔄 保存后自动热加载,无需重启服务
🔒 API Key 密码隐藏显示
📋 实时查看当前运行配置
MCP 工具
1. analyze_image - 图像分析
分析图像内容并返回详细描述。
# 基础用法
analyze_image(
image="C:/path/to/image.png",
prompt="详细描述这张图片"
)
# OCR 文字提取
analyze_image(
image="C:/docs/scan.png",
prompt="提取图片中的所有文字"
)
# 代码识别
analyze_image(
image="C:/code/snippet.png",
prompt="识别并转录图片中的代码,保持格式"
)2. chat_vision - 两轮对话
基于图像进行两轮问答。
# 第一轮对话
result1 = chat_vision(
image="C:/chart.png",
question="这个图表显示什么数据?"
)
session_id = result1["session_id"]
# remaining_turns = 1, can_continue = True
# 第二轮对话(追问细节,对话结束后无法继续)
if result1["remaining_turns"] > 0:
result2 = chat_vision(
image="C:/chart.png",
question="数据有什么趋势?",
session_id=session_id
)
# remaining_turns = 0, can_continue = False
# 开始新对话
result3 = chat_vision(
image="C:/another.png",
question="描述这张图",
is_new_conversation=True
)3. get_status - 状态查询
获取服务器运行状态。
status = get_status()
# 返回: 服务器名称、模型信息、会话状态等输入格式
支持两种图像输入格式:
1. 本地文件路径
image="C:/Users/name/Pictures/screenshot.png"
image="/home/user/images/photo.jpg"2. Base64 编码
# 纯 Base64
image="iVBORw0KGgoAAAANSUhEUgAA..."
# Data URL 格式
image="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."环境变量
变量名 | 说明 | 默认值 |
| API 密钥 | - |
| API 基础 URL | - |
| 模型名称 |
|
| 最大图像大小(字节) |
|
| 请求超时(秒) |
|
| 温度参数 |
|
| 最大输出 tokens |
|
| 日志级别 |
|
| 对话历史最大保存数 |
|
| 启用持久化 |
|
| 历史文件路径 |
|
支持的图像格式
PNG
JPEG / JPG
GIF
WebP
BMP
TIFF
项目结构
mcp-vision-server/
├── src/mcp_vision/
│ ├── __init__.py # 包初始化
│ ├── server.py # MCP 服务器主文件
│ ├── config.py # 配置管理
│ ├── vision_client.py # 视觉 API 客户端
│ ├── image_processor.py # 图像处理
│ ├── chat_manager.py # 对话管理器
│ ├── web_config.py # Web 配置工具
│ └── utils.py # 工具函数
├── tests/
├── .env.example
├── pyproject.toml
└── README.md在 Claude Code 中配置
编辑 Claude Code 配置文件,添加 MCP 服务器:
{
"mcpServers": {
"vision": {
"command": "mcp-vision-server",
"env": {
"VISION_API_KEY": "your-api-key",
"VISION_BASE_URL": "https://open.bigmodel.cn/api/paas/v4/",
"VISION_MODEL": "glm-4v"
}
}
}
}许可证
MIT License
Available Tools
3 toolsanalyze_imageA
分析图像内容
这是核心工具,用于分析图像并返回详细描述。
使用场景:
图像内容识别与描述
文字提取(OCR)
代码截图识别
数据图表分析
技术图表理解
参数说明:
image: 支持本地文件路径(如C:/path/to/image.png)或Base64编码prompt: 分析指令,告诉AI你想了解图像的什么内容
示例:
# 基础图像描述
analyze_image(image="C:/screenshots/desktop.png", prompt="描述这张截图的内容")
# OCR文字提取
analyze_image(image="C:/docs/scan.png", prompt="提取图片中的所有文字")
# 代码识别
analyze_image(image="C:/code/snippet.png", prompt="识别并转录图片中的代码")返回内容:
status: 执行状态("success"或"error")result: 分析结果image_info: 图像信息(类型、大小等)
Inputs: image (required), prompt. Returns: object
chat_visionA
两轮对话式图像问答
支持基于图像的两轮对话:
第一轮:根据图像和本地AI的询问信息进行回复
第二轮:如果本地AI对图像画面细节有进一步追问,则回答
使用场景:
深度图像分析
迭代式问题探索
复杂图像理解
参数说明:
image: 图像输入(路径或Base64)question: 问题session_id: 会话ID(用于第二轮对话,首次调用可不提供)is_new_conversation: 是否开始新对话(设为true会创建新会话)
两轮对话流程:
第一轮:调用时不传session_id,AI分析图像并回复,返回会话ID
第二轮:传入session_id继续追问图像细节,AI回答后对话结束
超过两轮将无法继续,需开始新对话
示例:
# 第一轮对话
result1 = chat_vision(
image="C:/chart.png",
question="这个图表显示什么数据?"
)
session_id = result1["session_id"]
# 第二轮对话(追问细节,对话结束后无法继续)
if result1["remaining_turns"] > 0:
result2 = chat_vision(
image="C:/chart.png",
question="数据有什么趋势?",
session_id=session_id
)返回内容:
status: 执行状态answer: 回答session_id: 会话IDconversation_turn: 当前对话轮次(1或2)remaining_turns: 剩余对话轮次can_continue: 是否可以继续对话
Inputs: image (required), question (required), session_id, is_new_conversation. Returns: object
get_statusB
获取服务器状态
返回当前服务器配置和运行状态信息。
返回内容:
server_name: 服务器名称provider: AI服务提供商model: 当前使用的模型chat_manager: 对话管理器状态config: 当前配置信息
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools have clearly distinct purposes with no overlap: analyze_image for general image analysis, chat_vision for conversational image Q&A, and get_status for server monitoring. Each tool serves a unique function in the vision analysis workflow, making it easy for an agent to select the right one.
All tool names follow a consistent verb_noun pattern (analyze_image, chat_vision, get_status) with clear, descriptive verbs. The naming is uniform and predictable across the entire toolset, making it easy to understand each tool's function at a glance.
Three tools is appropriate for a vision server's core functionality, covering analysis, conversation, and status checking. However, the count feels slightly minimal—additional tools like batch processing or image preprocessing could enhance completeness, but the current set is well-scoped for basic operations.
The toolset covers essential vision tasks: analysis, iterative questioning, and server status. Minor gaps exist, such as lacking tools for image manipulation (e.g., resize, crop) or batch processing, but agents can work around these with the provided tools for most common use cases in image understanding.
Maintenance
Related MCP Connectors
Search photos and video moments by visual meaning, people, dates, and folders across local libraries, Apple Photos, and OneDrive. Manage collections, groups, favorites, people, and duplicate review. Synced metadata remains searchable while the desktop is offline; local and Apple Photos media access needs the owning device online with remote access enabled. OneDrive media can be accessed directly from the cloud. OAuth or Bearer API keys. Paid Cloud Access required; hosted visual search uses prepaid credits. Text-in-image search is semantic matching, not guaranteed exact OCR. Setup: https://organizewith.ai/en/guides/connect-ai-assistants
Image & PDF tools for AI agents: compress, convert, resize, PDF, AI vision, pipeline.
Image and PDF toolkit: convert to AVIF/WebP/JXL, resize, crop, remove backgrounds, optimize PDFs.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables image analysis and understanding using Vision Language Models through OpenAI-compatible APIs. Supports analyzing images from URLs or local files with custom prompts.12MIT
- AlicenseAqualityDmaintenanceEnables image analysis using any OpenAI-compatible vision API, supporting URLs, local files, or base64 input with custom prompts.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables image recognition using vision models via OpenAI-compatible APIs, supporting multiple platforms like OpenAI, DeepSeek, and Ollama.ISC
- AlicenseAqualityDmaintenanceEnables image analysis, OCR, and text-to-image generation through OpenAI-compatible APIs. Supports local paths, URLs, or base64 images with configurable models and backup endpoints.3MIT