Skip to main content
Glama

glm-vision MCP Server

任意の AI Agent に「画像を見る」機能を追加します。内部では智谱の完全無料の視覚推論モデルを呼び出し、MCP プロトコル経由で標準ツールとして公開します。MCP をサポートする任意のクライアントでそのまま利用でき、API 費用はゼロです。

💡 無料保証:すべて智谱の特典ゾーンの無料モデル(GLM-4.6V-Flash / GLM-4.1V-Thinking-Flash / GLM-4V-Flash)を使用し、有料モデルは一切含まれません。長期間使用しても費用は発生しません。

公開されるツール

analyze_image(image_input, question, thinking)

パラメータ

デフォルト値

説明

image_input

string

必須

画像の http/https URL またはローカルファイルの絶対パス

question

string

この画像を詳しく説明してください

モデルに質問する内容

thinking

bool

false

思考モードを有効にし、複雑な図表/GUI/推論シーンでより正確

戻り値:モデルが出力したテキスト分析結果。

特徴

  • ローカル画像は自動的に生の base64 として読み込まれて転送されるため、画像ホストもパブリック URL も不要

  • 1枚あたり5MBの上限チェック(智谱の制限)

  • 429 レートリミット発生時は自動でバックオフしながら3回リトライ(1.5秒 / 3秒 / 4.5秒)

  • それでも失敗した場合は自動でフォールバック:glm-4.6v-flashglm-4.1v-thinking-flashglm-4v-flash(すべて無料)。フォールバック時は回答の冒頭で使用されたモデルを明示します


Related MCP server: Kimi Vision MCP Server

デプロイ3ステップ

1. 依存関係のインストール

pip install -r requirements.txt

⚠️ 重要な落とし穴mcp は 1.x をインストールする必要があります。最新の mcp 2.0.0 では組み込みの mcp.server.fastmcp モジュールが削除され、インストールすると ImportError になります。そのため pip install "mcp<2" です。

⚠️ もう一つの落とし穴zaizhipuai をインストールしないでください —— PyPI 上ではこれらは無関係なプレースホルダーパッケージです(zai は Zalando のもので、zhipuai はインポート名が変わっています)。本サーバーは OpenAI 互換クライアント で智谱の API に直接接続します(base_url=https://open.bigmodel.cn/api/paas/v4)、必要なのは openai パッケージだけです。

2. API Key の設定

bigmodel.cn で携帯番号登録 → コンソールの「API Keys」から新規作成、無料です。

Key の指定方法は2つあり、環境変数の優先度が高くなります

  • 方法A(推奨):環境変数 ZHIPU_API_KEY=あなたのキー を設定

  • 方法Bzhipu_key.txt.examplezhipu_key.txt にリネームし、中に Key を記入 (スクリプトは同じディレクトリのこのファイルを自動で読み込みます)

3. クライアントへの設定

クライアントの MCP 設定ファイルに追記します(パスはご自身のものに置き換えてください):

{
  "mcpServers": {
    "glm-vision": {
      "command": "python",
      "args": ["/绝对路径/到/glm_vision_mcp.py"],
      "env": {
        "ZHIPU_API_KEY": "你的key"
      }
    }
  }
}

各クライアントの設定ファイルの場所:

クライアント

設定ファイルのパス

WorkBuddy

~/.workbuddy/mcp.json

Claude Desktop (Win)

%APPDATA%\Claude\claude_desktop_config.json

Claude Desktop (Mac)

~/Library/Application Support/Claude/claude_desktop_config.json

Cursor

プロジェクト内の .cursor/mcp.json またはグローバルの ~/.cursor/mcp.json

Cline / Roo (VSCode)

プラグイン設定内の cline_mcp_settings.json

Continue

~/.continue/config.jsonmcpServers セクション

command には Python インタープリターの絶対パス(例:D:/python/python.exe)を書くことをお勧めします。クライアント起動時に PATH から python が見つからなくなるのを防げます。

設定後は必ずクライアントを再起動してください —— MCP プロセスはクライアント起動時に一度だけ spawn されるため、設定やコードを変更してもホットリロードされません。


成功したかどうかの確認

クライアントを再起動したら、Agent に画像を1枚分析させてみてください:

D:\test.png の画像に何が写っているか見てください

Agent がツールが見つからないと言う場合は、以下を確認してください:設定ファイルの JSON 構文、スクリプトの絶対パスが正しいか、クライアントを再起動したか、クライアントでこのサーバーを手動で「信頼/有効化」する必要があるか(WorkBuddy、Cursor にはこの手順があります)。

よくあるエラーと対処

症状

原因

429 / 1305

無料モデルのレートリミットで、Key が無効なわけではありません。サーバーが自動でリトライ+フォールバック済みです。

401

Key が本当に無効か、読み込まれていません

ModuleNotFoundError: mcp.server.fastmcp

mcp 2.x をインストールしてしまったので、pip install "mcp<2" で入れ直してください

未配置智谱 API Key

環境変数と zhipu_key.txt のどちらもありません

图片过大

1枚が5MBを超えているので、圧縮してください

ファイル一覧

ファイル

必須

説明

glm_vision_mcp.py

サーバー本体で、唯一のコアファイル

requirements.txt

推奨

依存関係リスト

zhipu_key.txt

任意

環境変数を使わない場合にのみ必要、内容は1行の Key

README.md

任意

このドキュメント

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables analysis of local images through Kimi (Moonshot AI) vision models via the MCP protocol, supporting features like OCR and long context understanding.
    65
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Provides image recognition capabilities to MCP clients by integrating with OpenAI-compatible vision models, supporting local images, URLs, multi-image comparison, and model listing.
    4
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for GLM chat completions using Zhipu AI models via AceDataCloud

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • Generate images and video on Google Flow (Veo, Nano Banana) from any MCP client

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Chu-Nian/glm-vision-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server