Skip to main content
Glama

Vision MCP Server

Python 实现的 MCP (Model Context Protocol) 图片分析服务器 —— 为纯文本大模型提供视觉能力。

参考自 Markusbetter/vision-mcp-server(Node.js / TypeScript),在其基础上增加了大图自动缩放、多 API 提供商支持等功能。

功能特点

  • 单一工具:analyze_image — 分析图片内容并提供详细描述

  • 支持本地图片文件远程 HTTP(S) URL

  • 自动缩放:超过 2048×2048 像素的图片会自动等比缩放到长边 2047px 再发送,避免超大图直接报错

  • 多提供商支持:兼容任意 OpenAI 兼容 API,通过环境变量切换——OpenAI、Azure、vLLM、Ollama、ModelScope 等均可

  • 全部通过环境变量配置,无需配置文件

安装

uv(推荐)

# 克隆仓库
git clone https://github.com/Jian-1197/vision-mcp.git
cd vision-mcp

# 安装(editable 模式,修改源码即时生效)
uv tool install -e .

安装完成后 vision-mcp 命令即全局可用。

需要 Python ≥ 3.10。

Conda

conda create -n mcp python=3.10 -y
conda activate mcp
pip install -e /path/to/vision-mcp

venv / pip

python -m venv .venv
source .venv/bin/activate       # Linux/macOS
.venv\Scripts\activate          # Windows
pip install -e /path/to/vision-mcp

环境变量配置

变量

必填

说明

VISION_BASE_URL

API 基础地址

VISION_API_KEY

API 密钥

VISION_MODEL

模型名

MCP 客户端配置

本服务通过 stdio 传输,运行命令为 vision-mcp

以 Claude Desktop 为例:

{
  "mcpServers": {
    "vision": {
      "command": "vision-mcp",
      "env": {
        "VISION_BASE_URL": "https://api.openai.com/v1",
        "VISION_API_KEY": "sk-your-key-here",
        "VISION_MODEL": "gpt-4o"
      }
    }
  }
}

若使用 Reasonix(1.x 配置文件路径为 ~\AppData\Roaming\reasonix\config.toml,可在软件中查看,或直接在 MCP 界面添加运行命令及环境变量):

[[plugins]]
name    = "vision"
type    = "stdio"
command = "vision-mcp"
env     = { VISION_BASE_URL = "https://api.openai.com/v1", VISION_API_KEY = "sk-your-key-here", VISION_MODEL = "gpt-4o" }

免费服务示例

智谱 GLM-4.6V-Flash

智谱提供的免费视觉模型,128K 上下文,支持图片、视频、文件理解。文档

API Key 获取:访问 智谱开放平台 → 注册 → API Keys

{
  "mcpServers": {
    "vision": {
      "command": "vision-mcp",
      "env": {
        "VISION_BASE_URL": "https://open.bigmodel.cn/api/paas/v4",
        "VISION_API_KEY": "你的智谱APIKey",
        "VISION_MODEL": "glm-4.6v-flash"
      }
    }
  }
}

魔搭社区 ModelScope

ModelScope 提供免费视觉模型调用额度,每日 2k 次。文档

API Token 获取:访问 ModelScope → 个人中心 → API 令牌

{
  "mcpServers": {
    "vision": {
      "command": "vision-mcp",
      "env": {
        "VISION_BASE_URL": "https://api-inference.modelscope.cn/v1",
        "VISION_API_KEY": "你的ModelScopeToken",
        "VISION_MODEL": "Qwen/Qwen3-VL-30B-A3B-Instruct"
      }
    }
  }
}

工作原理

  1. 接收图片(本地路径 → 读取文件;URL → HTTP 下载)

  2. 若图片超过 2048px,用 Pillow 等比缩放

  3. 编码为 base64 data URI

  4. 发送到 {VISION_BASE_URL}/chat/completions(OpenAI 兼容格式)

  5. 返回模型的文字描述

许可证

MIT

Available Tools

1 tool
analyze_imageB

Analyze an image and return a detailed description. Supports local file paths and http(s) URLs.

ParametersJSON Schema
NameRequiredDescriptionDefault
imageYesImage URL (http/https) or local file path
promptNoQuestion or analysis instruction for the vision model请描述这张图片的内容

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden. It fails to disclose behavioral traits such as error handling for invalid images, performance considerations, or any side effects. The description only states basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Very concise single sentence that front-loads the verb and resource. Every word is necessary and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with two parameters, no output schema, and no sibling tools, the description is fairly complete. It covers input types and core functionality, but could mention the form of the output description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds minimal value over the schema; it reiterates support for URLs and local paths. The default value for 'prompt' is already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb 'analyze' and resource 'image', and specifies return of detailed description. It also notes support for local file paths and http(s) URLs. No sibling tools exist for differentiation, so clarity is high.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided beyond the basic description. There is no mention of when to use this tool versus alternatives, nor any context about prerequisites or constraints.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.4/5.0
Disambiguation5/5

Only one tool exists, so there is no possibility of confusion between tools.

Naming Consistency5/5

With a single tool, naming is inherently consistent. 'analyze_image' follows a clear verb_noun pattern.

Tool Count3/5

A single tool for a vision MCP feels thin; typical vision services offer multiple capabilities (e.g., object detection, OCR). It is borderline acceptable for a very focused use case.

Completeness2/5

Only one generic image analysis tool is provided. Missing common operations like listing supported formats, specific detection tasks, or batch processing, which creates significant gaps for most use cases.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jian-1197/vision-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server