glm-image-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@glm-image-mcp-server generate an image of a serene mountain landscape"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
glm-image-mcp-server
Z.AI の glm-image モデルを使用した画像生成 MCP サーバー
機能
MCP サーバー: Claude Desktop やその他の MCP クライアントから画像を生成
バッチ CLI: JSON 設定ファイルから複数の画像を一括生成
自動ダウンロード: 生成された画像は自動的にローカルに保存
Related MCP server: nanobanana-mcp
インストール
npm からインストール
npm install @dondonudonjp/glm-image-mcp-serverソースからビルド
git clone https://github.com/ex-takashima/glm-image-mcp-server.git
cd glm-image-mcp-server
npm install
npm run build設定
環境変数
変数名 | 必須 | デフォルト値 | 説明 |
| はい | - | Z.AI の API キー |
| いいえ |
| 生成画像の保存先ディレクトリ |
.env.example を参考に .env ファイルを作成してください:
cp .env.example .env
# .env を編集して API キーを設定使用方法
MCP サーバー(Claude Desktop)
Claude Desktop の設定ファイル(claude_desktop_config.json)に以下を追加:
{
"mcpServers": {
"glm-image": {
"command": "npx",
"args": ["@dondonudonjp/glm-image-mcp-server"],
"env": {
"Z_AI_API_KEY": "your_api_key"
}
}
}
}ローカルビルドの場合:
{
"mcpServers": {
"glm-image": {
"command": "node",
"args": ["/path/to/glm-image-mcp-server/dist/index.js"],
"env": {
"Z_AI_API_KEY": "your_api_key"
}
}
}
}利用可能なツール
generate_image
prompt(必須): 生成する画像の説明テキストquality(任意):"hd"(デフォルト)または"standard"size_preset(任意): アスペクト比プリセット(下記参照)custom_size(任意): カスタムサイズ(例:"1536x1024")※事前検証ありoutput_filename(任意): 保存するファイル名
サイズ指定方法:
size_presetとcustom_sizeのどちらかを指定(両方指定時はsize_preset優先)どちらも未指定の場合は
1:1(1280x1280)がデフォルト
バッチ CLI
# バッチ処理を実行
npx @dondonudonjp/glm-image-mcp-server/dist/cli.js config.json
# または glm-image-batch コマンド(グローバルインストール時)
glm-image-batch config.json
# JSON 形式で出力
glm-image-batch config.json --format jsonバッチ設定ファイルの形式
{
"jobs": [
{
"prompt": "海に沈む美しい夕日",
"quality": "hd",
"size_preset": "16:9",
"output_filename": "sunset.png"
},
{
"prompt": "毛糸で遊ぶ猫",
"custom_size": "1536x1024"
},
{
"prompt": "山の風景"
}
],
"output_directory": "./output",
"concurrency": 3
}終了コード
0: すべてのジョブが正常に完了1: 1つ以上のジョブが失敗
開発
# ビルド
npm run build
# ウォッチモード
npm run dev
# MCP インスペクターでテスト
npx @anthropic/mcp-inspector dist/index.jsAPI リファレンス
Z.AI glm-image API
エンドポイント:
POST https://api.z.ai/api/paas/v4/images/generationsモデル:
glm-image品質オプション:
hd,standard
画像サイズ
サイズプリセット(size_preset):
プリセット | 解像度 | 用途 |
| 1280x1280 | 正方形(デフォルト) |
| 1568x1056 | 横長写真 |
| 1056x1568 | 縦長写真 |
| 1472x1088 | 横長スタンダード |
| 1088x1472 | 縦長スタンダード |
| 1728x960 | ワイドスクリーン |
| 960x1728 | スマホ縦画面 |
カスタムサイズ(custom_size)の制限:
幅・高さ: 1024px〜2048px
32で割り切れる値のみ
総ピクセル数: 最大 2^22 px(約419万ピクセル)
無効な値を指定した場合、API呼び出し前にエラーを返却
ライセンス
MIT
Available Tools
1 toolgenerate_imageB
Generate an image from a text prompt using Z.AI glm-image model
Inputs: prompt (required), quality, custom_size, size_preset, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of ambiguity or misselection among tools.
With a single tool named 'generate_image', the naming follows a clear verb_noun pattern and is internally consistent.
A single tool is thin for most servers, though it fully covers the stated purpose of image generation. The count feels minimal but not unreasonable.
For the narrow domain of generating an image from a text prompt, the single generate_image tool provides complete coverage without obvious missing operations.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
MCP server for Hailuo (MiniMax) AI video generation
MCP server for Flux AI image generation
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server for generating images and videos using Z.AI models (GLM-Image, CogView-4, CogVideoX-3, Vidu Q1, etc.) with support for synchronous and asynchronous generation, downloads, and multiple input modes.1046 npm3MIT
- AlicenseAqualityDmaintenanceMCP server for AI image generation supporting text-to-image and image-to-image editing via any OpenAI-compatible service, with configurable models, aspect ratios, and sizes.2MIT
- AlicenseAqualityDmaintenanceAn MCP server that generates images using SenseNova U1 Fast API. Supports Chinese prompts, multiple resolutions, and generating up to 4 images per request.1237 npm2MIT
- FlicenseAqualityDmaintenanceStandalone MCP server and CLI for generating images via ChatGPT backend, with reliable exact file paths and multi-account login support.25-