Together AI Image Server

Together AI Image Server

site icon
2025.03.12 3
TypeScript图像生成MCP 服务内容生成
Together AI Image Server 是一个基于 TypeScript 的 MCP(Model Context Protocol)服务器,用于通过 Together AI API 生成图像。该服务器提供了一个简单的接口,允许 Claude 和其他兼容 MCP 的助手根据文本提示生成图像。
View on GitHub

Overview

基本能力

产品定位

Together AI Image Server 是一个基于 MCP 协议的图像生成服务,旨在为 MCP 兼容的助手提供图像生成能力。

核心功能

  • 通过 generate_image 工具从文本提示生成图像。
  • 支持文本提示作为必需参数。
  • 可选参数控制生成步骤和生成图像数量。
  • 返回生成图像的 URL 和本地路径。

适用场景

  • 为 MCP 兼容的助手(如 Claude)提供图像生成功能。
  • 开发者在需要图像生成能力的应用中集成该服务。

工具列表

  • generate_image:根据文本提示生成图像,支持控制生成步骤和数量,返回图像 URL 和本地路径。

常见问题解答

  • 调试困难:建议使用 MCP Inspector 进行调试,可通过 npm run inspector 启动。

使用教程

使用依赖

  • Node.js(推荐 v14 或更高版本)。
  • Together AI API 密钥。

安装教程

# 克隆仓库
git clone https://github.com/zym9863/together-ai-image-server.git
cd together-ai-image-server

# 安装依赖
npm install

配置

设置 Together AI API 密钥为环境变量:

# Linux/macOS
export TOGETHER_API_KEY="your-api-key-here"

# Windows (Command Prompt)
set TOGETHER_API_KEY=your-api-key-here

# Windows (PowerShell)
$env:TOGETHER_API_KEY="your-api-key-here"

或创建 .env 文件:

TOGETHER_API_KEY=your-api-key-here

调试方式

使用 MCP Inspector 进行调试:

npm run inspector

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。