glm4v-vision-mcp
This server provides AI-powered image analysis via the GLM-4V Flash model, supporting three main functions:
Analyze Image (
analyze_image): Send an image and a custom prompt to get natural language analysis, such as describing scenes, identifying objects, or answering questions. Supports PNG, JPG, JPEG, WebP, and GIF formats.Extract Text (
extract_text): Perform OCR to extract text from images, with language detection for Chinese, English, or automatic mode.Describe Image (
describe_image): Generate structured image descriptions in multiple styles — detailed, concise, poetic, or technical — ideal for accessibility and annotation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@glm4v-vision-mcpExtract the text from the image at ./screenshot.png"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GLM-4V Flash MCP Server
基于智谱 AI GLM-4V Flash 模型的图片识别 MCP (Model Context Protocol) 服务器。
✨ 功能
图片分析 (
analyze_image) - 使用自然语言分析图片内容文字提取 (
extract_text) - OCR 功能,支持中英文图片描述 (
describe_image) - 生成图片描述,支持多种风格
Related MCP server: image-mcp
📦 安装
前置要求
Node.js 18+
智谱 AI API Key (点此获取 API key)
快速开始
# 1. 克隆仓库
git clone https://github.com/GLM-4V-Flash-MCP/glm-4v-flash-mcp.git
cd glm-4v-flash-mcp
# 2. 安装依赖
npm install
# 3. 设置 API Key
export ZHIPU_API_KEY="your-api-key-here"
# 4. 运行服务器
npm start🔧 配置
集成到 Claude Code
在 ~/.claude/settings.json 中添加:
{
"mcpServers": {
"glm-4v-flash": {
"command": "node",
"args": ["/path/to/server.js"],
"env": {
"ZHIPU_API_KEY": "${ZHIPU_API_KEY}"
},
"workingDirectory": "/path/to"
}
}
}集成到 VS Code
在 .vscode/settings.json 中添加:
{
"mcpServers": {
"glm-4v-flash": {
"command": "node",
"args": ["server.js"],
"env": {
"ZHIPU_API_KEY": "${env:ZHIPU_API_KEY}"
}
}
}
}集成到其他 MCP 客户端
在 .mcp/mcp.json 中配置(已包含在项目中):
{
"mcpServers": {
"glm-4v-flash": {
"command": "node",
"args": ["server.js"],
"env": {
"ZHIPU_API_KEY": "${ZHIPU_API_KEY}"
},
"cwd": "${ZHIPU_MCP_DIR}"
}
}
}使用前设置环境变量:
export ZHIPU_API_KEY="your-api-key-here"
export ZHIPU_MCP_DIR="/path/to/glm-4v-flash-mcp"🛠️ 工具说明
analyze_image
分析图片内容,支持自定义提示词。
参数:
image_path(必填): 图片文件路径prompt(可选): 分析提示词
示例:
{
"name": "analyze_image",
"arguments": {
"image_path": "/path/to/image.jpg",
"prompt": "描述图片中的场景和人物"
}
}extract_text
从图片中提取文字(OCR)。
参数:
image_path(必填): 图片文件路径language(可选): 文字语言,可选chinese、english、auto
示例:
{
"name": "extract_text",
"arguments": {
"image_path": "/path/to/image.png",
"language": "chinese"
}
}describe_image
生成图片的详细描述。
参数:
image_path(必填): 图片文件路径style(可选): 描述风格,可选detailed、concise、poetic、technical
示例:
{
"name": "describe_image",
"arguments": {
"image_path": "/path/to/image.jpg",
"style": "detailed"
}
}📋 支持的图片格式
PNG
JPG / JPEG
WebP
GIF
BMP
🔒 环境变量
变量名 | 说明 | 必需 |
| 智谱 AI API Key | 是 |
🚀 开发
# 安装依赖
npm install
# 开发模式(自动重载)
npm run dev
# 运行测试
npm test📄 许可证
MIT License - 详见 LICENSE 文件
🔗 相关链接
关于作者
大强同学 — 科技博主,也是一名github开源作者,非科班出身,以实践驱动开发,践行Build in Public成长理念,深耕 Windows效率生态,擅长将AI Agent从构想转化为可落地的实用方案,我坚信AI与智能体将重塑个人做事方式,愿以自身技术积累,助力个体把握智能时代机遇,高效提升自身创作、办公与成长效率。
平台 | 链接 |
🌐 官网 | |
𝕏 Twitter | |
📺 B站 | |
▶️ YouTube | |
💬 公众号 | 微信搜「大强同学」或扫码关注 ↓ |

Available Tools
3 toolsanalyze_imageC
使用 GLM-4V Flash 分析图片内容,支持中文和英文描述
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | No | 分析提示词,例如:描述图片内容、识别文字、分析场景等 | 请详细描述这张图片的内容 |
| image_path | Yes | 图片文件路径(支持 png, jpg, jpeg, webp, gif 格式) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the underlying model and language support but does not describe return format, side effects, permissions, or any operational constraints, leaving the behavior largely unspecified.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. It efficiently communicates the primary function and language support, but it omits potentially valuable guidance on usage and behavior, so it is not maximally concise in the sense of covering all essentials.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is relatively simple (2 params, no output schema), but the description lacks any indication of return values or expected output behavior. Given the absence of annotations and output schema, the description is not complete enough for an agent to fully anticipate the tool's result.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides descriptions for both parameters, achieving 100% schema description coverage. The description itself adds no additional parameter semantics beyond what the schema already defines, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool uses GLM-4V Flash to analyze image content, which is a specific verb-resource pair. However, it does not distinguish itself from sibling tools like describe_image or extract_text, leaving overlap in intent ambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives such as describe_image or extract_text. The description only states what it does, offering no contextual advice or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
describe_imageA
生成图片的详细描述,用于图像标注或 Accessibility
| Name | Required | Description | Default |
|---|---|---|---|
| style | No | 描述风格 | detailed |
| image_path | Yes | 图片文件路径 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It only states the tool generates a description but doesn't disclose whether this is a read-only operation, what the return format is, or any side effects. This is a significant gap for a tool that processes files.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that immediately communicates the core function. It is front-loaded and contains no filler, earning a perfect score.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with two parameters and no output schema, the description is adequate but not complete. It implies the output is a text description but doesn't mention the style variations or return type. The presence of sibling tools and the absence of annotations leave some gaps, but the description is sufficient for basic use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides descriptions for both parameters (image_path and style), achieving 100% coverage. The tool description itself adds no additional parameter details, but the schema is sufficient, so a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: generating a detailed description of an image, with a specific purpose (image annotation or accessibility). It distinguishes from sibling tools like extract_text, though not explicitly from analyze_image. The verb 'generate' and resource 'image' are clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use the tool: for image annotation or accessibility purposes. However, it doesn't explicitly mention alternatives or when not to use it, so it stops short of full guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
extract_textB
从图片中提取文字(OCR 功能)
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | 文字语言 | auto |
| image_path | Yes | 图片文件路径 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden for behavioral disclosure. It only says 'OCR function' without mentioning what the return value looks like, potential failure modes, language auto-detection behavior, or any side effects. This is a significant gap given the lack of annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence, but the parenthetical '(OCR 功能)' somewhat redundantly restates the first part. Still, it is efficient and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with two parameters and no output schema, the description provides the core purpose, but it lacks guidance on usage context and return value expectations. It is adequate but not fully complete given the absence of annotations and output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters. The description adds no additional meaning beyond what the schema provides, keeping the baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool extracts text from images using OCR, which is a specific verb+resource pair. This distinguishes it from sibling tools like describe_image and analyze_image, making its purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The OCR mention implies when to use the tool, but it does not explicitly state when to choose it over describe_image or analyze_image, nor does it mention any exclusions. Usage context is implied rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.0.0- First observed
analyze_image - First observed
describe_image - First observed
extract_text
TDQS
Scored across 3 tools
describe_image and analyze_image have overlapping purposes—both generate descriptions of image content, making it unclear which to use. extract_text is distinct, but the boundary between the other two is ambiguous.
All tool names follow a consistent verb_noun pattern (describe_image, analyze_image, extract_text) using snake_case. No stylistic deviations.
With 3 tools, the server is well-scoped for a vision-focused MCP. Each tool addresses a core image understanding task without unnecessary bloat.
The toolset covers basic image description, analysis, and OCR, which are the primary vision tasks. Minor gaps exist (e.g., no image comparison or specific object detection), but the core surface is complete.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
MCP server for ByteDance Seedream AI image generation
MCP server for Hailuo (MiniMax) AI video generation
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server for analyzing images using ModelScope's vision models. Supports both local files and URLs, enabling image content description and question answering.1166 npm11MIT
- AlicenseAqualityBmaintenanceMCP server for image recognition, supporting multiple vision backends (Anthropic, Zhipu, Ollama) to describe, answer questions, and analyze images.317 npm1MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that leverages Zhipu's free GLM-4.6V-Flash vision model to enable image, video, and file understanding (OCR, table parsing, defect detection, document Q&A, and more) across MCP-compatible clients like Codex and Claude Desktop.-
- AlicenseAqualityCmaintenanceMCP server that provides visual question answering, image description, object detection, OCR, and image manipulation tools using OpenAI-compatible vision models.12166 npmGPL 2.0