MCP server for providing vision capabilities to text models using ModelScope models
npm install vision-mcp-serverjson
{
"mcpServers": {
"vision-mcp-server": {
"command": "npx",
"args": [
"-y",
"vision-mcp-server"
],
"env": {
"MODELSCOPE_TOKEN": "your_modelscope_token_here",
"MODELSCOPE_MODEL": "Qwen/Qwen3-VL-30B-A3B-Instruct"
}
}
}
}
`
$3
`bash
npm install -g vision-mcp-server
`
然后在客户端配置中:
`json
{
"mcpServers": {
"vision-mcp-server": {
"command": "vision-mcp-server",
"env": {
"MODELSCOPE_TOKEN": "your_modelscope_token_here",
"MODELSCOPE_MODEL": "Qwen/Qwen3-VL-30B-A3B-Instruct"
}
}
}
}
`
$3
`bash
npm install vision-mcp-server
`
然后在客户端配置中:
`json
{
"mcpServers": {
"vision-mcp-server": {
"command": "node",
"args": ["node_modules/vision-mcp-server/dist/index.js"],
"env": {
"MODELSCOPE_TOKEN": "your_modelscope_token_here",
"MODELSCOPE_MODEL": "Qwen/Qwen3-VL-30B-A3B-Instruct"
}
}
}
}
`
环境变量配置
在使用前,需要设置以下环境变量:
- MODELSCOPE_TOKEN: 魔搭社区的 API 密钥(必需)
- 获取方式:访问 魔搭社区 → 个人中心 → API令牌
- MODELSCOPE_MODEL: 使用的模型名称(可选,默认为 "Qwen/Qwen3-VL-30B-A3B-Instruct")
- 支持其他视觉模型,如:Qwen/Qwen2-VL-7B-Instruct
使用示例
`javascript
// 分析本地图片
{
"name": "analyze_image",
"arguments": {
"image": "/path/to/your/image.jpg",
"prompt": "请描述这张图片的内容"
}
}
// 分析在线图片
{
"name": "analyze_image",
"arguments": {
"image": "https://example.com/image.jpg",
"prompt": "这张图片中有哪些物体?"
}
}
`
API 参考
$3
分析图片内容并提供详细描述。
参数:
- image (string): 图片 URL 或本地文件路径
- prompt (string, 可选): 对图片的问题或分析要求,默认为 "请描述这张图片的内容"
返回:
图片内容的详细文本描述。
开发
$3
`bash
npm run build
`
$3
`bash
npm test
`
贡献
欢迎提交 Issue 和 Pull Request!
许可证
MIT
更新日志
$3
- 初始版本发布
- 支持图片分析功能
- 兼容 MCP 协议
---
English
A Vision Analysis MCP (Model Context Protocol) Server that supports image content analysis and description.
Features
- Support for local image files and online image URLs
- Intelligent image analysis based on ModelScope AI models
- Full compatibility with MCP protocol
- TypeScript support with complete type definitions
Installation
$3
No need to pre-install, npx will automatically download and run the latest version:
`json
{
"mcpServers": {
"vision-mcp-server": {
"command": "npx",
"args": [
"-y",
"vision-mcp-server"
],
"env": {
"MODELSCOPE_TOKEN": "your_modelscope_token_here",
"MODELSCOPE_MODEL": "Qwen/Qwen3-VL-30B-A3B-Instruct"
}
}
}
}
`
$3
`bash
npm install -g vision-mcp-server
`
Then in your client configuration:
`json
{
"mcpServers": {
"vision-mcp-server": {
"command": "vision-mcp-server",
"env": {
"MODELSCOPE_TOKEN": "your_modelscope_token_here",
"MODELSCOPE_MODEL": "Qwen/Qwen3-VL-30B-A3B-Instruct"
}
}
}
}
`
$3
`bash
npm install vision-mcp-server
`
Then in your client configuration:
`json
{
"mcpServers": {
"vision-mcp-server": {
"command": "node",
"args": ["node_modules/vision-mcp-server/dist/index.js"],
"env": {
"MODELSCOPE_TOKEN": "your_modelscope_token_here",
"MODELSCOPE_MODEL": "Qwen/Qwen3-VL-30B-A3B-Instruct"
}
}
}
}
`
Environment Variables Configuration
Before using, you need to set the following environment variables:
- MODELSCOPE_TOKEN: ModelScope API key (required)
- Get it from: ModelScope → Profile → API Token
- MODELSCOPE_MODEL: Model name to use (optional, default is "Qwen/Qwen3-VL-30B-A3B-Instruct")
- Supports other vision models, such as: Qwen/Qwen2-VL-7B-Instruct
Usage Examples
`javascript
// Analyze local image
{
"name": "analyze_image",
"arguments": {
"image": "/path/to/your/image.jpg",
"prompt": "Please describe the content of this image"
}
}
// Analyze online image
{
"name": "analyze_image",
"arguments": {
"image": "https://example.com/image.jpg",
"prompt": "What objects are in this image?"
}
}
`
API Reference
$3
Analyze image content and provide detailed description.
Parameters:
- image (string): Image URL or local file path
- prompt (string, optional): Question or analysis requirement for the image, default is "Please describe the content of this image"
Returns:
Detailed text description of the image content.
Development
$3
`bash
npm run build
`
$3
`bash
npm test
``