glm-vision-mcp
glm-vision MCP Server
给任意 AI Agent 加上「看图」能力。底层调用智谱完全免费的视觉推理模型, 通过 MCP 协议暴露成标准工具,任何支持 MCP 的客户端都能直接用,零 API 费用。
💡 免费保证:全部使用智谱福利专区的免费模型(GLM-4.6V-Flash / GLM-4.1V-Thinking-Flash / GLM-4V-Flash), 不包含任何付费模型,长期使用也不会产生费用。
暴露的工具
analyze_image(image_input, question, thinking)
参数 | 类型 | 默认值 | 说明 |
| string | 必填 | 图片的 http/https URL 或本地文件绝对路径 |
| string |
| 要向模型提的问题 |
| bool |
| 开启思考模式,复杂图表/GUI/推理场景更准 |
返回:模型输出的文字分析结果。
特性
本地图片自动读成裸 base64 传输,不需要图床、不需要公网 URL
单图 5MB 上限校验(智谱限制)
遇到 429 限流自动退避重试 3 次(1.5s / 3s / 4.5s)
仍失败则自动降级:
glm-4.6v-flash→glm-4.1v-thinking-flash→glm-4v-flash(全免费), 降级时会在回答开头标明用了哪个模型
Related MCP server: Kimi Vision MCP Server
部署三步
1. 装依赖
pip install -r requirements.txt⚠️ 关键坑:
mcp必须装 1.x。最新的mcp 2.0.0移除了内置的mcp.server.fastmcp模块,装了会直接 ImportError。所以是pip install "mcp<2"。⚠️ 另一个坑:不要装
zai或zhipuai—— PyPI 上这两个名字都是无关的占位包 (zai是 Zalando 的、zhipuai导入名已变)。本 server 走 OpenAI 兼容客户端 直连智谱接口(base_url=https://open.bigmodel.cn/api/paas/v4),只需要openai包。
2. 配 API Key
去 bigmodel.cn 手机号注册 → 控制台「API Keys」新建,免费。
Key 有两种给法,环境变量优先级更高:
方式 A(推荐):设环境变量
ZHIPU_API_KEY=你的key方式 B:把
zhipu_key.txt.example改名为zhipu_key.txt,里面填上 Key (脚本会自动读同目录下的这个文件)
3. 配到客户端
在客户端的 MCP 配置文件里加一段(路径换成你自己的):
{
"mcpServers": {
"glm-vision": {
"command": "python",
"args": ["/绝对路径/到/glm_vision_mcp.py"],
"env": {
"ZHIPU_API_KEY": "你的key"
}
}
}
}各客户端的配置文件位置:
客户端 | 配置文件路径 |
WorkBuddy |
|
Claude Desktop (Win) |
|
Claude Desktop (Mac) |
|
Cursor | 项目内 |
Cline / Roo (VSCode) | 插件设置里的 |
Continue |
|
command建议写 Python 解释器的绝对路径(如D:/python/python.exe), 避免客户端启动时 PATH 里找不到python。
配完必须重启客户端 —— MCP 进程只在客户端启动时 spawn 一次,改配置或改代码都不会热重载。
验证是否成功
重启客户端后,让 Agent 分析一张图即可:
帮我看看
D:\test.png这张图里有什么
如果 Agent 说找不到工具,检查:配置文件 JSON 语法、脚本绝对路径是否正确、 是否重启了客户端、客户端是否需要手动「信任/启用」这个 server(WorkBuddy、Cursor 都有这一步)。
常见错误对照
现象 | 原因 |
| 免费模型限流,不是 Key 无效。server 已自动重试+降级 |
| Key 真的无效或没读到 |
| 装成 mcp 2.x 了,重装 |
| 环境变量和 |
| 单图超 5MB,先压缩 |
文件清单
文件 | 必需 | 说明 |
| ✅ | server 本体,唯一的核心文件 |
| 建议 | 依赖清单 |
| 可选 | 不用环境变量时才需要,内容就是一行 Key |
| 可选 | 本文档 |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceA portable image-understanding MCP server that lets agents analyze local images, URLs, or base64 images via an OpenAI-compatible vision model.176865MIT
- AlicenseNot gradedqualityCmaintenanceEnables analysis of local images through Kimi (Moonshot AI) vision models via the MCP protocol, supporting features like OCR and long context understanding.65MIT
- AlicenseBqualityCmaintenanceMCP server that provides image analysis, OCR text extraction, and image description using the GLM-4V Flash model from Zhipu AI.36MIT
- AlicenseAqualityCmaintenanceProvides image recognition capabilities to MCP clients by integrating with OpenAI-compatible vision models, supporting local images, URLs, multi-image comparison, and model listing.4MIT
Related MCP Connectors
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Generate images and video on Google Flow (Veo, Nano Banana) from any MCP client
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Chu-Nian/glm-vision-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server