npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

comet-replicate-mcp

v1.0.0

Published

MCP server for Comet Replicate API - AI image generation and editing using flux-kontext-max model

Readme

Comet Replicate MCP

MCP服务器,用于Comet Replicate API的AI图像生成和编辑功能,基于flux-kontext-max模型。

功能特性

  • 文生图(Text-to-Image):根据文本描述生成高质量AI图像
  • 图片编辑(Image Editing):基于参考图片和文本提示进行图像编辑和转换
  • 支持多种宽高比和输出格式
  • 自动任务轮询和状态管理
  • 完整的错误处理和超时控制

安装

方式1:全局安装

npm install -g comet-replicate-mcp

方式2:使用npx(推荐)

无需安装,直接在配置文件中使用npx运行。

配置

在Claude Desktop的MCP配置文件中添加以下配置:

Windows配置路径

%APPDATA%\Claude\claude_desktop_config.json

macOS配置路径

~/Library/Application Support/Claude/claude_desktop_config.json

配置示例

{
  "mcpServers": {
    "comet-replicate-mcp": {
      "command": "npx",
      "args": ["-y", "comet-replicate-mcp"],
      "env": {
        "COMET_API_KEY": "your-api-key-here"
      }
    }
  }
}

或者如果已全局安装:

{
  "mcpServers": {
    "comet-replicate-mcp": {
      "command": "comet-replicate-mcp",
      "env": {
        "COMET_API_KEY": "your-api-key-here"
      }
    }
  }
}

环境变量

| 变量名 | 必需 | 默认值 | 说明 | |--------|------|--------|------| | COMET_API_KEY | 是 | - | Comet API密钥 | | COMET_MAX_WAIT_SECONDS | 否 | 300 | 任务最大等待时间(秒) | | COMET_POLL_INTERVAL_SECONDS | 否 | 3 | 任务状态轮询间隔(秒) |

使用方法

配置完成后,重启Claude Desktop即可使用以下工具:

1. text_to_image - 文生图

根据文本描述生成图像。

参数:

  • prompt (必需): 图像描述文本
  • aspect_ratio (可选): 宽高比,如 "16:9", "1:1", "4:3",默认 "16:9"
  • output_format (可选): 输出格式,"jpg" 或 "png",默认 "jpg"

示例:

请使用text_to_image工具生成一张图片:一只可爱的狗狗正在开心地吃骨头,写实摄影风格,高清,细节丰富,温馨的场景

2. edit_image - 图片编辑

基于参考图片和文本提示生成编辑后的图像。

参数:

  • prompt (必需): 编辑指令文本(如"将狗替换成猫")
  • input_image (必需): 参考图片的URL
  • aspect_ratio (可选): 输出图像宽高比,不设置则自动适配输入图像
  • output_format (可选): 输出格式,"jpg" 或 "png",默认 "jpg"

示例:

请使用edit_image工具编辑图片:将图片中的狗替换成一只可爱的猫,保持相同的构图和姿势
参考图片URL: https://example.com/dog.jpg

API说明

本MCP服务器使用Comet Replicate API,基于以下模型:

  • 模型: black-forest-labs/flux-kontext-max
  • API基础URL: https://api.cometapi.com/replicate/v1

支持的宽高比

| 宽高比 | 说明 | 适用场景 | |--------|------|----------| | 1:1 | 正方形 | 社交媒体头像、Instagram帖子 | | 16:9 | 宽屏(默认) | 视频封面、横向海报、桌面壁纸 | | 9:16 | 竖屏 | 手机竖屏、Stories、短视频封面 | | 4:3 | 标准 | 传统显示器、演示文稿 | | 3:4 | 竖版标准 | 竖版海报、印刷品 | | 3:2 | 相机常用 | 摄影作品、相片打印 | | 2:3 | 竖版相机 | 竖版摄影、人像照片 | | 21:9 | 超宽屏 | 电影画幅、超宽显示器 | | 9:21 | 超竖屏 | 竖版长图、信息流广告 |

输出格式

  • jpg - JPEG格式(默认,文件更小)
  • png - PNG格式(无损,透明支持)

开发

本地开发

# 克隆项目
git clone https://github.com/yourusername/comet-replicate-mcp.git
cd comet-replicate-mcp

# 安装依赖
npm install

# 编译
npm run build

# 监听文件变化自动编译
npm run watch

项目结构

comet-replicate-mcp/
├── src/
│   └── index.ts          # MCP服务器主文件
├── dist/                 # 编译输出目录
├── package.json
├── tsconfig.json
└── README.md

许可证

MIT License

相关链接

问题反馈

如有问题或建议,请在GitHub Issues中提出。