Utilizes TypeScript for type-safe implementation, providing a robust MCP service for generating AI images through the Volcengine Jimeng AI image generation API.
即梦AI图片生成 MCP 服务
基于火山引擎即梦AI的图片生成MCP(Model Context Protocol)服务。
功能特性
- 使用火山引擎即梦AI API生成高质量图片
- 支持多种图片比例:4:3、3:4、16:9、9:16
- 标准化的MCP接口,兼容各种MCP客户端
- 环境变量配置,安全便捷
安装依赖
编译项目
环境变量配置
设置以下环境变量:
获取API密钥
- 访问 火山引擎控制台
- 登录后进入"即梦AI"产品页面,开通服务(可选择免费试用)
- 在"访问控制"页面创建访问密钥,获取Access Key和Secret Key
- 确保账号已开通即梦AI图像生成相关权限和策略
注意: 根据官方文档,请确保使用正确的req_key参数值 jimeng_high_aes_general_v21_L
使用方法
直接运行
作为MCP服务器
在MCP客户端(如Claude Desktop、Cursor等)中配置此服务:
API接口
generate-image
当用户需要生成图片时使用的工具。
参数:
text
(string): 用户需要在图片上显示的文字illustration
(string): 根据用户要显示的文字,提取3-5个可以作为图片配饰的插画元素关键词color
(string): 图片的背景主色调ratio
(enum): 图片比例,支持以下选项:"4:3"
: 512×384"3:4"
: 384×512"16:9"
: 512×288"9:16"
: 288×512
提示词生成规则: 工具会自动将输入参数组合成以下格式的提示词:
返回:
- 成功时返回图片URL和详细信息
- 失败时返回错误信息
使用示例
项目结构
注意事项
- 确保网络连接正常,能够访问火山引擎API
- API调用需要消耗积分,请注意使用量
- 生成的图片URL有时效性,建议及时下载保存
- 请遵守火山引擎的使用条款和即梦AI的内容政策
故障排除
常见错误
- 环境变量未设置:确保设置了正确的ACCESS_KEY和SECRET_KEY
- 网络连接问题:检查网络连接和防火墙设置
- API配额不足:检查火山引擎账户余额和API调用次数
- 提示词不合规:确保提示词符合内容安全规范
调试方法
运行时添加调试信息:
许可证
ISC License
Related MCP Servers
- -securityAlicense-qualityA MCP server that integrates with Cursor IDE to generate images based on text descriptions using JiMeng AI, allowing users to create and save custom images directly within their development environment.Last updated -160PythonMIT License
- AsecurityAlicenseAqualityAn MCP Server that integrates with Stability AI's API to provide high-quality image generation, editing, and manipulation capabilities including background removal, outpainting, search-and-replace, and upscaling.Last updated -133555TypeScriptMIT License
- -securityAlicense-qualityAn MCP tool server that enables generating and editing images through OpenAI's image models, supporting text-to-image generation and advanced image editing (inpainting, outpainting) across various MCP-compatible clients.Last updated -31TypeScriptMIT License
- AsecurityFlicenseAqualityAn MCP server that enables AI models to generate precise geometric images by providing Asymptote code, supporting both SVG and PNG output formats.Last updated -15JavaScript