MCP 自动图片分析服务器
基于 GLM-4.5V 模型的 MCP (Model Context Protocol) 服务器,提供智能图片分析功能,支持文件路径和剪贴板两种输入方式。
功能特性
- 🤖 智能获取: 自动从文件路径或剪贴板获取图片
- 💻 代码内容提取: 从图片中提取代码文本
- 🏗️ 架构分析: 分析代码的结构和设计模式
- 🐛 错误检测: 识别代码中的错误和问题
- 📚 文档生成: 自动生成代码文档
- 🔍 语言识别: 自动识别编程语言
- 🎯 专注代码: 专门优化用于代码图片分析
技术栈
- 运行时: Node.js 18+
- 框架: TypeScript
- 模型: GLM-4.5V (智谱 AI)
- 图片处理: Sharp
- 协议: MCP (Model Context Protocol)
安装配置
1. 安装依赖
2. 配置环境变量
复制 .env.example
为 .env
并填入配置:
编辑 .env
文件:
3. 获取智谱 AI API Key
- 访问 智谱 AI 开放平台
- 注册账号并创建 API Key
- 将 API Key 填入
.env
文件
4. 构建项目
使用方法
在 Claude Code 中配置
方式一:使用 claude mcp add 命令(推荐)
构建项目后,使用以下命令添加 MCP 服务器:
方式二:手动配置
将以下配置添加到你的 Claude Code 配置中:
Claude 提示词
可用工具
auto_analyze_image
自动获取并分析图片(支持文件路径或剪贴板)
使用方式:
- 文件路径: 提供图片文件路径进行分析
- 剪贴板: 不提供路径,自动从剪贴板获取图片
分析类型说明:
code
: 提取代码内容,识别编程语言,分析代码结构architecture
: 分析代码架构设计,模块关系,设计模式error
: 检查代码错误,性能问题,安全隐患documentation
: 生成代码文档,函数说明,使用示例
开发
开发模式运行
构建项目
代码检查
项目结构
注意事项
- API Key 安全: 请妥善保管你的智谱 AI API Key
- 代码图片优化: 专门针对代码截图优化,建议使用清晰的代码截图
- 支持格式: JPEG, PNG, WebP, GIF 等常见格式
- 网络连接: 需要稳定的网络连接访问智谱 AI API
- 最佳实践:
- 使用高对比度的代码编辑器主题
- 确保代码字体清晰可见
- 避免截图过大或过小
许可证
MIT License
贡献
欢迎提交 Issue 和 Pull Request!
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
Enables intelligent image analysis using GLM-4.5V model, specializing in extracting and analyzing code from screenshots with support for file paths and clipboard input.
Related MCP Servers
- AsecurityAlicenseAqualityProvides image recognition capabilities using Anthropic Claude Vision and OpenAI GPT-4 Vision APIs, supporting multiple image formats and offering optional text extraction via Tesseract OCR.Last updated -323PythonMIT License
- -securityFlicense-qualityCaptures screenshots and saves them to file paths specified by client applications, primarily designed to facilitate screenshot analysis by AI assistants running in WSL environments.Last updated -Python
- -securityFlicense-qualityProvides AI-powered visual analysis capabilities for Claude and other MCP-compatible AI assistants, allowing them to capture and analyze screenshots, perform file operations, and generate UI/UX reports.Last updated -1JavaScriptISC License
- AsecurityAlicenseAqualityA macOS utility that captures screenshots and analyzes them with AI vision, enabling AI assistants to see and interpret what's on your screen.Last updated -35,715577MIT License