一个使用 Together AI 图像生成模型来生成图像的 MCP 服务器。
<a href="https://glama.ai/mcp/servers/2cwphjnpgw"><img width="380" height="200" src="https://gips3.baidu.com/it/u=3577850470,578408470&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Together AI 图像服务器 MCP 服务器" /></a>
npm install
npm run build
服务器需要一个 Together AI API 密钥。您可以在 Together AI 的平台 上获取一个。
将服务器添加到您的 Cline MCP 设置文件中:
对于 macOS/Linux:~/Library/Application Support/Windsurf/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
"mcpServers": {
"togetherai-image": {
"command": "node",
"args": ["/path/to/togetherai-image-server/build/index.js"],
"env": {
"TOGETHER_API_KEY": "your-api-key-here"
},
"disabled": false,
"autoApprove": []
}
}
}
该服务器提供了一个带有以下参数的 generate_image 工具:
{
prompt: string; // 必需:要生成的图像的文字描述
model?: string; // 可选:使用的模型(默认:'black-forest-labs/FLUX.1.1-pro')
width?: number; // 可选:图像宽度(以像素为单位,默认:1024)
height?: number; // 可选:图像高度(以像素为单位,默认:768)
steps?: number; // 可选:推理步骤数(默认:28)
n?: number; // 可选:要生成的图像数量(默认:1)
outputDir?: string; // 可选:保存图像的目录(默认:'./output')
}
您可以在 Cline 中这样使用服务器:
生成一张坐在窗台上的可爱猫咪的图片,并将其保存到我的桌面:
<use_mcp_tool>
<server_name>togeherai-image</server_name>
<tool_name>generate_image</tool_name>
<arguments>
{
"prompt": "A cute cat sitting on a windowsill",
"outputDir": "/Users/username/Desktop/generated-images"
}
</arguments>
</use_mcp_tool>
该工具返回一个包含以下内容的 JSON 响应:
filepath: 保存的图像的完整路径filename: 保存的图像文件名dimensions: 图像的原始尺寸和最终尺寸