MCP Visual Language
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., "@MCP Visual Languageanalyze this code screenshot for errors"
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.
MCP 自动图片分析服务器
基于 GLM-4.5V 模型的 MCP (Model Context Protocol) 服务器,提供智能图片分析功能,支持文件路径和剪贴板两种输入方式。
功能特性
🤖 智能获取: 自动从文件路径或剪贴板获取图片
💻 代码内容提取: 从图片中提取代码文本
🏗️ 架构分析: 分析代码的结构和设计模式
🐛 错误检测: 识别代码中的错误和问题
📚 文档生成: 自动生成代码文档
🔍 语言识别: 自动识别编程语言
🎯 专注代码: 专门优化用于代码图片分析
Related MCP server: glm-vision-mcp-server
技术栈
运行时: Node.js 18+
框架: TypeScript
模型: GLM-4.5V (智谱 AI)
图片处理: Sharp
协议: MCP (Model Context Protocol)
安装配置
1. 安装依赖
pnpm install2. 配置环境变量
复制 .env.example 为 .env 并填入配置:
cp .env.example .env编辑 .env 文件:
# 智谱 AI API 配置
ZHIPUAI_API_KEY=your_zhipuai_api_key_here
ZHIPUAI_BASE_URL=https://open.bigmodel.cn/api/paas/v4
# MCP 服务器配置
MCP_SERVER_NAME=mcp-vl
MCP_SERVER_VERSION=1.0.0
# 日志级别
LOG_LEVEL=info3. 获取智谱 AI API Key
访问 智谱 AI 开放平台
注册账号并创建 API Key
将 API Key 填入
.env文件
4. 构建项目
pnpm run build使用方法
在 Claude Code 中配置
方式一:使用 claude mcp add 命令(推荐)
构建项目后,使用以下命令添加 MCP 服务器:
claude mcp add mcp-vl --scope user --env ZHIPUAI_API_KEY=your_api_key_here \
-- node /path/mcp-vl/dist/index.js方式二:手动配置
将以下配置添加到你的 Claude Code 配置中:
{
"mcpServers": {
"mcp-vl": {
"command": "node",
"args": ["/path/mcp-vl/dist/index.js"],
"env": {
"ZHIPUAI_API_KEY": "your_api_key_here"
}
}
}
}Claude 提示词
## ⚠️ 图片处理规范 - 非常重要,一定要严格执行
**重要提示:在 Claude 中使用时,禁止使用 read 工具进行读取图片,因为读取图片工具失效了。请使用 mcp-vl 里的 auto_analyze_image 工具进行读取。**可用工具
auto_analyze_image
自动获取并分析图片(支持文件路径或剪贴板)
{
"name": "auto_analyze_image",
"arguments": {
"imagePath": "/path/to/image.png", // 可选,不提供则使用剪贴板
"focusArea": "code" // "code", "architecture", "error", "documentation"
}
}使用方式:
文件路径: 提供图片文件路径进行分析
剪贴板: 不提供路径,自动从剪贴板获取图片
分析类型说明:
code: 提取代码内容,识别编程语言,分析代码结构architecture: 分析代码架构设计,模块关系,设计模式error: 检查代码错误,性能问题,安全隐患documentation: 生成代码文档,函数说明,使用示例
开发
开发模式运行
pnpm run dev构建项目
pnpm run build代码检查
pnpm run lint
pnpm run typecheck项目结构
src/
├── index.ts # MCP 服务器主入口
├── config/
│ └── index.ts # 配置管理
├── services/
│ ├── glm-service.ts # GLM 模型服务
│ └── auto-image-service.ts # 自动图片分析服务
├── types/
│ └── index.ts # TypeScript 类型定义
└── utils/
└── logger.ts # 日志工具
scripts/
└── test-local.ts # 本地测试脚本注意事项
API Key 安全: 请妥善保管你的智谱 AI API Key
代码图片优化: 专门针对代码截图优化,建议使用清晰的代码截图
支持格式: JPEG, PNG, WebP, GIF 等常见格式
网络连接: 需要稳定的网络连接访问智谱 AI API
最佳实践:
使用高对比度的代码编辑器主题
确保代码字体清晰可见
避免截图过大或过小
许可证
MIT License
贡献
欢迎提交 Issue 和 Pull Request!
Available Tools
1 toolauto_analyze_imageB
自动获取并分析图片(支持文件路径、网络URL或剪贴板)
| Name | Required | Description | Default |
|---|---|---|---|
| imagePath | No | 图片文件路径或网络URL(可选,不提供则使用剪贴板) | |
| focusArea | No | 分析重点区域 | code |
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 of behavioral disclosure. It mentions '自动获取并分析' (automatically acquire and analyze), which implies some automation and processing, but does not describe what '分析' (analyze) entails (e.g., what kind of analysis is performed, output format, potential rate limits, or authentication needs). This leaves significant gaps in understanding the tool's behavior.
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, efficient sentence that front-loads the core purpose ('自动获取并分析图片') and includes essential details (input sources) without unnecessary elaboration. It is appropriately sized for the tool's complexity, though it could be slightly more structured (e.g., by separating purpose from usage hints).
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?
Given the complexity (image analysis tool with automation), no annotations, and no output schema, the description is incomplete. It does not explain what the analysis returns, how results are formatted, or any behavioral traits like error handling or performance characteristics. This makes it inadequate for an agent to fully understand the tool's context and usage.
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 thoroughly. The description adds marginal value by mentioning the three input sources (file path, network URL, clipboard) for the 'imagePath' parameter, but this is largely redundant with the schema's description. It does not provide additional meaning beyond the schema, so the 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 purpose: '自动获取并分析图片' (automatically acquire and analyze images). It specifies the verb '获取并分析' (acquire and analyze) and the resource '图片' (images), and mentions three input sources (file path, network URL, or clipboard). However, without sibling tools, we cannot assess differentiation, so it cannot receive a 5.
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 implies usage by listing supported input sources (file path, network URL, clipboard), suggesting when to use it based on available image data. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., other image analysis tools), prerequisites, or exclusions. With no sibling tools, this is adequate but not comprehensive.
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.
1 tool update
v1.0.0- Changed
auto_analyze_image1 field changed- changed
Input schema / properties / imagePath / descriptionPrevious value: -"图片文件路径(可选,不提供则使用剪贴板)"New value: +"图片文件路径或网络URL(可选,不提供则使用剪贴板)"
1 tool update
- First observed
auto_analyze_image
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined as analyzing images from various sources, leaving no room for confusion or misselection.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'auto_analyze_image' follows a clear verb_noun pattern, and there are no other tools to compare it against for inconsistency.
A single tool is generally too few for most server purposes, as it limits functionality and flexibility. While the tool itself might be useful, the server's scope appears thin, lacking complementary operations like image editing, filtering, or metadata extraction that would enhance coherence.
The server is severely incomplete for a visual language domain. It only provides analysis, missing essential operations such as image generation, transformation, annotation, or comparison. This gap will likely cause agent failures when broader image-related tasks are required.
Maintenance
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Analyze images from multiple angles to extract detailed insights or quick summaries. Describe visu…
Screenshot any URL/HTML as PNG/JPEG/WebP, or read it as clean Markdown/text for LLMs.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables image analysis using GLM-4.5V's vision capabilities from Z.AI. Supports analyzing both local image files and URLs with customizable prompts and parameters.17MIT
- AlicenseAqualityDmaintenanceEnables Claude Code to analyze images using Zhipu AI's GLM-5V-Turbo vision model, supporting local files and URLs with customizable prompts.150 npmMIT
- FlicenseNot gradedqualityBmaintenanceEnables image analysis using GLM-4V multimodal model, supporting local files and base64 images with optional custom prompts.-
- FlicenseAqualityCmaintenanceEnables AI assistants to recognize and extract information from images via GLM-4V, supporting automatic screenshot recognition and MCP-based local image file reading for non-vision models like DeepSeek.1-