Back to MCP directory
publicPublicdnsLocal runtime

togetherai-image-mcp-server

基于Together AI的图像生成MCP服务

article

README

🚀 一起AI图像服务器

一起AI图像服务器是一个MCP服务器,可借助Together AI的图像生成模型来生成图像。

点击此处

🚀 快速开始

📦 安装指南

  1. 安装依赖项:
npm install
  1. 构建服务器:
npm run build

⚙️ 配置

1. Together AI API密钥

该服务器需要一个Together AI API密钥,你可以从Together AI的平台获取。

2. Cline配置

将服务器添加到你的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": []
    }
  }
}

💻 使用示例

在Cline中的使用

该服务器提供了一个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": "一只可爱的猫坐在窗台上",
  "outputDir": "/Users/username/Desktop/generated-images"
}
</arguments>
</use_mcp_tool>

输出

工具返回一个JSON响应,包含:

  • filepath:保存图像的完整路径
  • filename:保存的图像文件名
  • dimensions:原始和最终图像维度
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client