Metadata-Version: 2.4
Name: yooztech_mcp_omniroute_t2i
Version: 0.0.1
Summary: MCP server for text-to-image generation through OmniRoute
Author: yooztech
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp<3,>=2.0.0
Requires-Dist: httpx>=0.27.0
Dynamic: license-file

# yooztech_mcp_omniroute_t2i - OmniRoute 文生图 MCP 工具

通过 OmniRoute 提供的 OpenAI 兼容接口 `/v1/images/generations` 生成图片，并将返回的 URL 或 Base64 图片保存到本地。

## MCP 配置

使用 `uvx`：

```json
{
  "mcpServers": {
    "yooztech_mcp_omniroute_t2i": {
      "command": "uvx",
      "args": ["yooztech_mcp_omniroute_t2i"],
      "env": {
        "OMNIROUTE_BASE_URL": "https://your-omniroute.example.com",
        "OMNIROUTE_API_KEY": "your-api-key"
      }
    }
  }
}
```

也可以安装后直接运行 `yooztech_mcp_omniroute_t2i`。

## 环境变量

- `OMNIROUTE_BASE_URL`：OmniRoute 服务地址，不包含 `/v1/images/generations`
- `OMNIROUTE_API_KEY`：OmniRoute API Key

## 工具

### `text_to_image`

- `prompt`：必填，图片描述
- `model`：必填，OmniRoute 上可用的图片生成模型
- `size`：可选，例如 `1024x1024`
- `n`：可选，生成数量，默认 `1`，范围 `1..10`
- `quality`：可选，透传给图片模型
- `style`：可选，透传给图片模型
- `response_format`：可选，`b64_json` 或 `url`，默认 `b64_json`
- `output_dir`：可选，保存目录，默认当前目录
- `filename_prefix`：可选，文件名前缀，默认 `omniroute-image`

示例：

```json
{
  "prompt": "一座漂浮在云海上的未来城市，电影感光照",
  "model": "your-image-model",
  "size": "1024x1024",
  "output_dir": "./tmp"
}
```

成功时返回 `saved_files`，其中包含生成图片的绝对路径。

## 依赖

- Python >= 3.10
- MCP SDK >= 2.0.0, < 3
- httpx >= 0.27.0

## 许可证

MIT
