Skip to main content

zhipu-glm-vision-mcp

基于智谱 GLM-4.6V-Flash(免费多模态视觉模型)的多模态理解 MCP 服务,支持图片、视频、文件三类理解能力,并支持思考模式(thinking)开关。

GLM-4.6V-Flash 上下文窗口 128K,在视觉理解精度上达到同参数规模 SOTA,原生支持多模态 Function Calling。本服务通过智谱 OpenAI 兼容接口接入,遵循 MCP v2 协议mcp>=2.0.0 + MCPServer)。

使用

uvx zhipu-glm-vision-mcp

需要设置环境变量 ZHIPU_API_KEY(在 智谱开放平台 免费获取)。

可选环境变量:

变量 说明 默认
ZHIPU_API_KEY 智谱 API Key(必需) -
GLM_MODEL 模型名称 glm-4.6v-flash
GLM_THINKING 思考模式默认开关(true/false 关闭

CLI 参数:--model <名称> 覆盖模型、--transport/-t stdio|streamable-http|sse(默认 stdio)、--thinking 开启思考默认。

工具

每个工具均接受列表参数(传 1 个即单条分析,传多个即在同一上下文内对比/关联分析),并支持 thinking 思考开关与 prompt 自定义提问。

图片理解

  • analyze_image(file_paths: list, prompt?, thinking?) - 分析 1..10 个本地图片路径(JPEG/PNG/GIF/WebP/BMP,每个 Base64 ≤50MB)
  • analyze_image_url(urls: list, prompt?, thinking?) - 分析 1..10 个公网图片 URL

视频理解

  • analyze_video(file_paths: list, prompt?, thinking?) - 分析 1..10 个本地视频路径(MP4/MOV/AVI/WMV/MKV/WEBM/FLV,每个 Base64 ≤50MB)
  • analyze_video_url(urls: list, prompt?, thinking?) - 分析 1..10 个公网视频 URL

文件/文档理解

  • analyze_file(file_paths: list, prompt?, thinking?) - 分析 1..N 个本地文件路径(PDF/TXT/MD/DOCX/PPTX/XLSX/HTML/JSON/CSV,每个 Base64 ≤50MB),支持多文档跨文档对比
  • analyze_file_url(urls: list, prompt?, thinking?) - 分析 1..N 个公网文件 URL

思考模式(thinking)

每个工具都有 thinking 布尔参数,控制是否开启深度思考模式(true 开启 / false 关闭 / 不传则回落 GLM_THINKING 环境变量)。开启后模型会先进行深度推理再作答,理解更细致但响应更慢;免费 flash 版默认关闭以换取更快响应。

媒体限制

  • 图片、视频、文件三者互斥:单次请求只能分析一种模态(GLM-4.6V 限制),因此拆分为独立工具。
  • 同模态可多个:单个请求内图片/视频最多 10 个(MAX_PARTS),文件同请求可传多个用于跨文档对比分析。
  • Base64 本地传入上限 50MB(本地文件由本服务自动转 Base64 data URI)。
  • 官方文档对视频/文件大小存在 5MB 与 200MB 两种表述,以 API 实际报错为准。

客户端注册

Claude Code:

claude mcp add zhipu-glm-vision-mcp \
  -e ZHIPU_API_KEY=你的Key \
  -- uvx zhipu-glm-vision-mcp

.mcp.json / claude_desktop_config.json

{
  "mcpServers": {
    "zhipu-glm-vision-mcp": {
      "command": "uvx",
      "args": ["zhipu-glm-vision-mcp"],
      "env": {
        "ZHIPU_API_KEY": "你的Key"
      }
    }
  }
}

发布新版本

  1. 修改 pyproject.toml 中的 version(必须严格递增)
  2. uv build,生成 dist/*.whldist/*.tar.gz
  3. twine upload dist/*,按提示粘贴 PyPI API Token(用户名填 __token__
  4. 验证:uvx zhipu-glm-vision-mcp --help

相关文档

docs/ 目录存放了 GLM-4.6V-Flash 相关文档:

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zhipu_glm_vision_mcp-0.1.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zhipu_glm_vision_mcp-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file zhipu_glm_vision_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: zhipu_glm_vision_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for zhipu_glm_vision_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c7a2cb3b3ceb11f488c39d83c5ce18161caac50a0652a68be1a098c0567a4b9
MD5 5c4e9a4abe3862e9ef34916655ecd6d4
BLAKE2b-256 e3a4e57a33d95156a2c22a16fc2b0d880427152546bb52b7bbc7178bfc417856

See more details on using hashes here.

File details

Details for the file zhipu_glm_vision_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zhipu_glm_vision_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cbacb3ef9db3d8fb17a1ddeb4307efc0fb268d4e15ff83b461281413d845678
MD5 6529b0ad20aba6b6ad2ceace0a25f115
BLAKE2b-256 44e009c1cdcf65fc1e1df10489f3794e9eb3e60ca7d60848a5f46a2238fda0df

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page