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
Metadata
Release files for vl-mcp-server 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vl_mcp_server-0.1.2.tar.gz | 49.1 kB | Without provenance | Details for vl_mcp_server-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vl_mcp_server-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for vl_mcp_server-0.1.2-py3-none-any.whl |
Total release size: 55.5 kB
Release files / vl_mcp_server-0.1.2.tar.gz
| Download URL | vl_mcp_server-0.1.2.tar.gz |
|---|---|
| Size | 49.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67d7d82c8d8c5e017319d78c71c880e228eb584d8b648017bd36fb9c801bb613
|
|
BLAKE2b-256 checksum How to use checksums |
6dee22e8ade5f557299f3b00f7272a098707a55a420f95aa5ae0deb389c873ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.11
|
Release files / vl_mcp_server-0.1.2-py3-none-any.whl
| Download URL | vl_mcp_server-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4203404b3dea63b43951a4cca667ccd638ceecc83245fe14f3248abf57dac462
|
|
BLAKE2b-256 checksum How to use checksums |
52f41d3126171ddb90b7802d9f6fe5ab5acea928bef13584ffddee42c8b70ee9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.11
|
Security for vl-mcp-server 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.