
想要快速与 Claude Desktop 或其他 MCP 客户端集成,请将以下 JSON 片段复制到配置文件中!✨
{
"mcpServers": {
"ideogram": {
"command": "npx",
"args": [
"@sunwood-ai-labs/ideagram-mcp-server"
],
"env": {
"IDEOGRAM_API_KEY": "your_api_key_here"
}
}
}
}
| 参数 | 类型 | 描述 | 必须/可选 | 备注 |
|---|---|---|---|---|
| prompt | string | 图像生成提示(推荐英文) | 必须 | |
| aspect_ratio | string | 宽高比(例如:"1x1", "16x9", "4x3" 等) | 可选 | 15 种类型 |
| resolution | string | 分辨率(参见官方文档,共 69 种) | 可选 | |
| seed | integer | 随机种子(用于保证再现性) | 可选 | 范围:0~2147483647 |
| magic_prompt | string | 魔法提示("AUTO" | "ON" | "OFF") |
| rendering_speed | string | v3 渲染速度("TURBO" | "DEFAULT" | "QUALITY") |
| style_codes | string[] | 8 位风格代码数组 | 可选 | |
| style_type | string | 风格类型("AUTO" | "GENERAL" | "REALISTIC" |
| negative_prompt | string | 排除元素(推荐英文) | 可选 | |
| num_images | number | 生成图像数量(1~8) | 可选 | |
| style_reference | object | 风格参考(Ideogram 3.0 新功能) | 可选 | 详情如下 |
| └ urls | string[] | 参考图像 URL 数组(最多 3 个) | 可选 | |
| └ style_code | string | 风格代码 | 可选 | |
| └ random_style | boolean | 使用随机风格 | 可选 | |
| output_dir | string | 图像保存目录(默认:"docs") | 可选 | |
| base_filename | string | 保存文件名基础(默认:"ideogram-image") | 可选 | 添加时间戳或 ID |
| blur_mask | boolean | 模糊图像边缘(true 表示启用蒙版合成) | 可选 | 默认值:false |
const result = await use_mcp_tool({
server_name: "ideagram-mcp-server",
tool_name: "generate_image",
arguments: {
prompt: "A beautiful sunset over mountains",
aspect_ratio: "16x9",
rendering_speed: "QUALITY",
num_images: 2,
style_reference: {
urls: [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg"
],
random_style: false
},
blur_mask: true
}
});
npm run build ... TypeScript 构建npm run watch ... 开发模式(自动构建)npm run lint ... 代码检查npm test ... 运行测试ideagram-mcp-server/
├── assets/
├── docs/
│ └── ideogram-image_2025-05-18T06-31-45-777Z.png
├── src/
│ ├── tools/
│ ├── types/
│ ├── utils/
│ ├── ideogram-client.ts
│ ├── index.ts
│ ├── server.ts
│ └── test.ts
├── .env.example
├── package.json
├── tsconfig.json
├── README.md
└── ...(省略)
git checkout -b feature/awesome)npm version patch|minor|major
git push --follow-tags
详细信息请参阅 docs/npm-deploy.md!
MIT