VL 视觉理解 MCP 服务 - 基于 tokendance 的 Qwen2.5-VL 模型
Project description
VL MCP Server
基于 MCP(Model Context Protocol)协议的视觉理解服务,通过 tokendance 平台调用 Qwen2.5-VL 模型,实现图片内容分析功能。
功能特性
- 自动识别图片来源:无需指定类型,自动区分 URL / 本地文件 / Base64 / data URI
- 兼容 Claude Code 粘贴图片:在对话框直接粘贴截图即可分析,无需提供文件路径
- 基于 Qwen2.5-VL-7B-Instruct 模型
- 兼容 Cherry Studio、Claude Code、Cursor 等 MCP 客户端
- 可托管部署到魔搭 MCP 广场
安装使用
环境要求
- Python >= 3.10
- uv(推荐)或 pip
配置
设置环境变量:
export TOKENDANCE_API_KEY="your-api-key"
MCP 客户端配置
Cherry Studio / Claude Desktop / Cursor / Claude Code:
{
"mcpServers": {
"vl-image-analyzer": {
"command": "uvx",
"args": ["vl-mcp-server"],
"env": {
"TOKENDANCE_API_KEY": "your-api-key",
"VL_MODEL": "qwen2.5-vl-7b-instruct"
}
}
}
}
VL_MODEL为可选项,默认使用qwen2.5-vl-7b-instruct。
如需使用更大参数模型,可修改为qwen2.5-vl-72b-instruct。
开发
本地开发
# 克隆仓库
git clone <repo-url>
cd vl-mcp-server
# 使用 uv 安装依赖
uv sync
# 运行服务
uv run vl-mcp-server
调试
使用 MCP Inspector:
npx @modelcontextprotocol/inspector uv run vl-mcp-server
工具说明
analyze_image
分析图片内容并返回描述。图片来源自动识别,无需指定类型。
参数:
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
image |
string | ✅ | - | 图片来源,支持多种格式(见下方) |
prompt |
string | ❌ | "请详细描述这张图片的内容" | 自定义分析提示词 |
image 参数支持的格式:
| 格式 | 示例 | 使用场景 |
|---|---|---|
| 本地文件路径 | /Users/xxx/image.png |
直接指定本地文件 |
| HTTP/HTTPS URL | https://example.com/img.jpg |
网络图片 |
| data URI | data:image/png;base64,... |
Claude Code 粘贴图片自动使用 |
| 裸 Base64 | iVBORw0KGgo... |
第三方系统传入的 base64 |
支持的图片格式: png, jpg, jpeg, gif, webp, bmp, tiff
示例:
本地文件方式:
{
"image": "/Users/username/Pictures/photo.jpg",
"prompt": "描述这张图片的主要内容"
}
URL 方式:
{
"image": "https://example.com/image.jpg",
"prompt": "描述这张图片的主要内容"
}
Claude Code 粘贴图片方式(由 Claude 自动处理):
- 在对话框粘贴图片后,直接说"使用 analyze_image 工具分析这张图片"
- Claude 会自动将图片转为
data:image/png;base64,...格式传入工具
许可证
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vl_mcp_server-0.1.2.tar.gz.
File metadata
- Download URL: vl_mcp_server-0.1.2.tar.gz
- Upload date:
- Size: 49.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67d7d82c8d8c5e017319d78c71c880e228eb584d8b648017bd36fb9c801bb613
|
|
| MD5 |
ce847144b3df473d4ef79b094624141f
|
|
| BLAKE2b-256 |
6dee22e8ade5f557299f3b00f7272a098707a55a420f95aa5ae0deb389c873ee
|
File details
Details for the file vl_mcp_server-0.1.2-py3-none-any.whl.
File metadata
- Download URL: vl_mcp_server-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4203404b3dea63b43951a4cca667ccd638ceecc83245fe14f3248abf57dac462
|
|
| MD5 |
3a2159f1e0a6f480f763c40892b813f5
|
|
| BLAKE2b-256 |
52f41d3126171ddb90b7802d9f6fe5ab5acea928bef13584ffddee42c8b70ee9
|