mcp-bigmodel-image-generation
v1.0.0
Published
MCP server for BigModel (智谱AI) CogView-4 image generation API
Maintainers
Readme
BigModel Image Generation MCP Server
MCP (Model Context Protocol) server for BigModel (智谱AI) CogView-4 image generation API.
Features
- Generate high-quality images from text prompts
- Support for multiple CogView-4 models:
cogview-4-250304(latest, supports HD quality)cogview-4cogview-3-flash
- Customizable image sizes and quality settings
- Content safety filtering
- Watermark control
Installation
- Install dependencies:
npm install- Set your BigModel API token as an environment variable:
export BIGMODEL_API_TOKEN="your-api-token-here"Configuration for Claude Desktop
Add this server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"bigmodel-image-generation": {
"command": "node",
"args": ["/Users/feedmob/Downloads/mcp words to pics/index.js"],
"env": {
"BIGMODEL_API_TOKEN": "aecf0ef68f9c42b1a2bfb8e1e370fd9f.1YD0p0WUyVCDuM9t"
}
}
}
}Usage
Once configured, you can use the generate_image tool in Claude Desktop:
Parameters
- prompt (required): Text description of the desired image
- model (optional): Model to use (
cogview-4-250304,cogview-4,cogview-3-flash)- Default:
cogview-4-250304
- Default:
- size (optional): Image dimensions
- Recommended:
1024x1024,768x1344,864x1152,1344x768,1152x864,1440x720,720x1440 - Custom: width and height must be 512-2048px, divisible by 16
- Default:
1024x1024
- Recommended:
- quality (optional): Image quality (
standardorhd)- Only supported by
cogview-4-250304 hd: More detailed images (~20 seconds)standard: Faster generation (~5-10 seconds)- Default:
standard
- Only supported by
- watermark_enabled (optional): Whether to add watermark
- Default:
true
- Default:
- user_id (optional): Unique user identifier (6-128 characters)
Example
Generate an image of "一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云"API Information
- API Endpoint:
https://open.bigmodel.cn/api/paas/v4/images/generations - Documentation: https://docs.bigmodel.cn/api-reference/模型-api/图像生成
- Image URL Validity: 30 days (please save images promptly)
Testing
You can test the server directly:
export BIGMODEL_API_TOKEN="aecf0ef68f9c42b1a2bfb8e1e370fd9f.1YD0p0WUyVCDuM9t"
node index.jsLicense
MIT
