图像生成 MCP 服务器
模型上下文协议 (MCP) 服务器,支持通过 Together AI 使用 Flux.1 Schnell 模型无缝生成高质量图像。该服务器提供标准化接口来指定图像生成参数。
特征
- 由 Flux.1 Schnell 模型提供支持的高质量图像生成
- 支持自定义尺寸(宽度和高度)
- 清除提示验证和 API 问题的错误处理
- 轻松与 MCP 兼容客户端集成
- 可选将图像以 PNG 格式保存到磁盘
安装
或者直接运行:
配置
添加到您的 MCP 服务器配置:
用法
服务器提供了一个工具: generate_image
使用generate_image
此工具只有一个必需参数 - 提示符。所有其他参数均为可选参数,如果未提供,则使用合理的默认值。
参数
最小请求示例
仅需要提示:
包含图像保存的完整请求示例
覆盖所有默认值并指定保存图像的路径:
响应格式
响应将是一个 JSON 对象,包含以下内容:
如果提供了 image_path 并且保存成功,则响应将包括保存位置的确认。
默认值
如果请求中未指定,则使用以下默认值:
- 型号:“black-forest-labs/FLUX.1-schnell-Free”
- 宽度:1024
- 高度:768
- 步骤:1
- n:1
- 响应格式:“b64_json”
重要说明
- 仅需要
prompt
参数 - 如果未提供,所有可选参数均使用默认值
- 提供时,参数必须满足其约束(例如宽度/高度范围)
- Base64 响应可能很大 - 对于较大的图像请使用 URL 格式
- 保存图像时,确保指定的目录存在且可写
先决条件
- Node.js >= 16
- Together AI API 密钥
- 登录api.together.xyz
- 导航至API 密钥设置
- 点击“创建”生成新的API密钥
- 复制生成的密钥以用于您的 MCP 配置
依赖项
发展
克隆并构建项目:
可用脚本
npm run build
构建 TypeScript 项目npm run watch
- 观察变化并重建npm run inspector
- 运行 MCP 检查器
贡献
欢迎贡献!请按以下步骤操作:
- 分叉存储库
- 创建新分支 (
feature/my-new-feature
) - 提交你的更改
- 将树枝推到你的叉子上
- 打开拉取请求
您可以通过 GitHub Issues 提交功能请求和错误报告。请先检查现有问题,然后再创建新问题。
对于重大更改,请先打开问题来讨论您提议的更改。
执照
本项目遵循 MIT 许可证。详情请参阅 LICENSE 文件。
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
模型上下文协议服务器,可通过 Together AI 使用可自定义参数的 Flux.1 Schnell 模型生成高质量图像。
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that provides image generation capabilities using the Ideogram API, allowing users to create images from text prompts with customizable parameters.Last updated -1973TypeScript
- AsecurityFlicenseAqualityA Model Context Protocol server that provides an image generation tool using Templated.io, allowing users to create customized images based on templates with text and image layers.Last updated -TypeScript
- AsecurityAlicenseAqualityA Model Context Protocol server that enables generation of high-quality images using the Flux.1 Schnell model via Together AI, allowing users to create images from text prompts with customizable dimensions.Last updated -18PythonMIT License
- -securityAlicense-qualityA server that provides AI-powered image generation, modification, and processing capabilities through the Model Context Protocol, leveraging Google Gemini models and other image services.Last updated -6PythonMIT License