Skip to main content
Glama

GLM-Vision MCP & Skill Server (Node.js 版)

这是一个基于 Node.js 实现的 Model Context Protocol (MCP) 与 AI Custom Skill 双用视觉识别服务器。专为让不支持图像输入的主模型(如 DeepSeek 等)通过调用本工具结合智谱 GLM-4V,来读取和识别本地图片(截图/照片/UI等)中的信息。

🌟 为什么将它作为 Skill 部署?

为了实现**“截图后对 AI 说‘看我截图’,AI 自动抓取剪贴板并进行识别”的极致自动化体验,本项目被设计为直接作为系统 Skill 部署**。这样做可以让您同时获得:

  1. AI 助手的截图识别技能 (Skill):自动抓取剪贴板、存图、触发识别;

  2. 标准的 MCP 视觉工具 (MCP Tool):在 Cursor 或 Claude Desktop 聊天中读取任意本地路径的图片。


🤖 AI 助手自动安装说明 (For AI Agents)

如果您是正在帮助用户安装此项目的 AI Agent,请按照以下步骤自动完成安装与配置:

  1. 定位并创建技能目录:

    • 在用户主目录下定位并创建文件夹:~/.agents/skills/glm-vision-js (Windows 上为 C:\Users\<用户名>\.agents\skills\glm-vision-js)。

  2. 下载与复制代码:

    • 将本项目仓库中的所有文件(包括 index.js, package.json, SKILL.md 等)全部克隆/拷贝到上述的 ~/.agents/skills/glm-vision-js 文件夹中。

  3. 安装依赖:

    • 进入到该技能目录下,运行终端命令 npm install。

  4. 配置 MCP:

    • 读取用户本机的 MCP 配置文件(如 Cursor 的 MCP 设置,或 Windows 上的 %APPDATA%\Claude\claude_desktop_config.json),将本项目的工具配置写入其中,指向技能目录下的 index.js(具体配置格式见下文)。


Related MCP server: glm4v-mcp

1. 手动安装与准备工作

系统要求

  • Node.js: 需要 v18.0.0 或更高版本。

配置 API Key (ZHIPU_API_KEY) 【安全推荐】

为了防止您的 API Key 泄露(例如随项目代码误提交至 Git 仓库),强烈不建议在任何项目目录中编写 .env 文件。我们仅推荐以下两种安全的配置方式:

  • 方式一(推荐):配置为系统环境变量 ZHIPU_API_KEY;

  • 方式二(推荐):在 MCP 客户端配置(如 Cursor/Claude 的配置 JSON)的 env 字段中进行注入。


2. 客户端接入 JSON 模板

请在您的 MCP 客户端配置中加入以下内容。注意:请将命令参数中的 <您的用户名> 替换为实际的 Windows 用户名:

{
  "mcpServers": {
    "glm-vision": {
      "command": "node",
      "args": [
        "C:/Users/<您的用户名>/.agents/skills/glm-vision-js/index.js"
      ],
      "env": {
        "ZHIPU_API_KEY": "在此输入您的智谱API_KEY(若已配全局系统环境变量,此env对象可省略)"
      }
    }
  }
}

3. 使用方法与示例

服务启动后,您的 AI 助手或客户端即可自动调用本工具:

  • 通过 Skill(自动识别截图): 直接截个图,对支持 Skill 的 Agent 说:“帮我识别一下刚截的图”,AI 将自动执行抓图与识别,整个过程耗时仅需几秒。

  • 通过 MCP(描述本地文件): 在聊天中输入:“帮我提取 D:/workspace/chart.png 图表里的所有数据并整理为 Markdown 表格”。

  • 多图识别(最多 5 张): 命令行直接执行:

    node index.js D:/workspace/a.png D:/workspace/b.png --prompt "对比这两张图的差异"

    或通过 MCP 调用 describe_image,image_path 传入路径数组,如 ["D:/workspace/a.png", "D:/workspace/b.png"]。

Available Tools

1 tool
describe_imageA

使用智谱 GLM-4V 识别并描述本地图片内容,或提取图片中的文字。

Inputs: image_path (required), prompt.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of selecting between overlapping tools. The tool's purpose is clearly described as image description and OCR, so no ambiguity exists.

    Naming Consistency5/5

    The single tool name 'describe_image' follows a clear verb_noun pattern, which is internally consistent. There are no other tools to create inconsistencies.

    Tool Count2/5

    The server offers only one tool, which feels too thin for a vision-focused server. Even though the domain is narrow, typical vision servers provide separate operations for description, OCR, and question answering, making a single catch-all tool insufficient.

    Completeness3/5

    The tool covers image description and text extraction, but lacks common vision capabilities such as answering questions about an image or analyzing multiple images. The combined single tool creates a limitation where specific tasks cannot be addressed independently.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables analysis of local images through Kimi (Moonshot AI) vision models via the MCP protocol, supporting features like OCR and long context understanding.
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Grants image-understanding capabilities to AI coding assistants that lack native vision by routing screenshots, error messages, UI mockups and documents through a single unified analysis tool. Supports multiple vision model providers such as GLM, DeepSeek-OCR, Qwen-VL, Doubao and Hunyuan, with automatic multi-crop, compression and retry handling for text-dense images.
      512 npm
      MIT