glm4v-vision-mcp

glm4v-vision-mcp

MCP server that provides image analysis, OCR text extraction, and image description using the GLM-4V Flash model from Zhipu AI.

Category
Visit Server

README

GLM-4V Flash MCP Server

基于智谱 AI GLM-4V Flash 模型的图片识别 MCP (Model Context Protocol) 服务器。

✨ 功能

  • 图片分析 (analyze_image) - 使用自然语言分析图片内容
  • 文字提取 (extract_text) - OCR 功能,支持中英文
  • 图片描述 (describe_image) - 生成图片描述,支持多种风格

📦 安装

前置要求

快速开始

# 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 (可选): 文字语言,可选 chineseenglishauto

示例:

{
  "name": "extract_text",
  "arguments": {
    "image_path": "/path/to/image.png",
    "language": "chinese"
  }
}

describe_image

生成图片的详细描述。

参数:

  • image_path (必填): 图片文件路径
  • style (可选): 描述风格,可选 detailedconcisepoetictechnical

示例:

{
  "name": "describe_image",
  "arguments": {
    "image_path": "/path/to/image.jpg",
    "style": "detailed"
  }
}

📋 支持的图片格式

  • PNG
  • JPG / JPEG
  • WebP
  • GIF
  • BMP

🔒 环境变量

变量名 说明 必需
ZHIPU_API_KEY 智谱 AI API Key

🚀 开发

# 安装依赖
npm install

# 开发模式(自动重载)
npm run dev

# 运行测试
npm test

📄 许可证

MIT License - 详见 LICENSE 文件

🔗 相关链接


关于作者

大强同学 — 科技博主,也是一名github开源作者,非科班出身,以实践驱动开发,践行Build in Public成长理念,深耕 Windows效率生态,擅长将AI Agent从构想转化为可落地的实用方案,我坚信AI与智能体将重塑个人做事方式,愿以自身技术积累,助力个体把握智能时代机遇,高效提升自身创作、办公与成长效率。

平台 链接
🌐 官网 dqtx.cc ai.dqtx.cc os.dqtx.cc
𝕏 Twitter @Derek Zhao
📺 B站 大强同学_
▶️ YouTube @Derek Zhao
💬 公众号 微信搜「大强同学」或扫码关注 ↓

大强同学

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured