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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mseep/replicate-flux-mcp

v0.4.0

Published

MCP for Replicate Flux Model

Readme

Replicate Flux MCP

English | 中文

本项目是一个 Model Context Protocol (MCP) 服务器,默认使用 black-forest-labs/flux-schnell 生成图片,使用 recraft-ai/recraft-v3-svg 生成 SVG。你可以通过环境变量覆盖默认模型,图片工具也支持通过工具参数 model_id 在内置白名单内按次切换模型。

目录

快速开始

  1. 在 Replicate 获取 REPLICATE_API_TOKEN
  2. 任选集成方式运行 npx -y replicate-flux-mcp(记得传入 api token)。
  3. 通过环境变量可即时切换模型:
    REPLICATE_IMAGE_MODEL_ID="google/imagen-4" \
    REPLICATE_SVG_MODEL_ID="recraft-ai/recraft-v3-svg" \
    REPLICATE_API_TOKEN=你的token \
    npx -y replicate-flux-mcp

集成方式

Cursor

.cursor/mcp.json 示例:

{
  "mcpServers": {
    "replicate-flux-mcp": {
      "command": "env",
      "args": [
        "REPLICATE_API_TOKEN=你的token",
        "REPLICATE_IMAGE_MODEL_ID=可选",
        "REPLICATE_SVG_MODEL_ID=可选",
        "npx", "-y", "replicate-flux-mcp"
      ]
    }
  }
}

Claude Desktop

mcp.json 示例略,与 README.md 相同,注意设置环境变量。

Smithery / Glama.ai

可直接在各自的服务器市场添加 replicate-flux-mcp,无需本地部署。

Codex

~/.codex/config.toml 示例:

[mcp_servers.replicate]
command = "npx"
args = ["-y", "replicate-flux-mcp"]
env = { REPLICATE_API_TOKEN = "your-replicate-api-token", REPLICATE_IMAGE_MODEL_ID = "your-image-model-id", REPLICATE_SVG_MODEL_ID = "your-svg-model-id" }
startup_timeout_sec = 30_000

不填 REPLICATE_IMAGE_MODEL_ID / REPLICATE_SVG_MODEL_ID 时会使用默认模型,启动即可使用。

模型配置

  • 默认:图片 black-forest-labs/flux-schnell,SVG recraft-ai/recraft-v3-svg
  • 覆盖:通过环境变量 REPLICATE_IMAGE_MODEL_ID / REPLICATE_SVG_MODEL_ID 覆盖默认模型;图片工具也可通过参数 model_id 按次覆盖。
  • 内置白名单:
    • 图片生成:black-forest-labs/flux-schnellgoogle/imagen-4black-forest-labs/flux-kontext-proideogram-ai/ideogram-v3-turboblack-forest-labs/flux-1.1-problack-forest-labs/flux-dev
    • SVG 生成:recraft-ai/recraft-v3-svg
    • 兼容工具 run_model 额外支持:minimax/video-01luma/reframe-videotopazlabs/video-upscaletopazlabs/image-upscaleszcho/codeformertencentarc/gfpgan
  • run_replicate_model 可用 REPLICATE_MODEL_ALLOWLIST 限制可运行模型;不设置表示允许任意模型,设置为空字符串表示拒绝全部。

故障排查

  • 认证错误:确认 REPLICATE_API_TOKEN 有效。
  • 超时:增大 pollingAttemptspollingInterval(见 src/config/index.ts)。
  • 模型不可用:确认所选模型在对应白名单内,且你的 Replicate 账户有权运行该模型。