{
  "markdown": "# Replicate MCP Server\n\n<p align=\"center\">\n  <img src=\"assets/banner.png\" alt=\"Replicate MCP Server — universal MCP for the full Replicate catalog\" width=\"100%\">\n</p>\n\n[![smithery badge](https://smithery.ai/badge/sena-labs/replicate-mcp-server?refresh=20260602)](https://smithery.ai/servers/sena-labs/replicate-mcp-server)\n[![Ko-fi](https://img.shields.io/badge/Ko--fi-Support%20this%20project-FF5E5B?logo=ko-fi&logoColor=white)](https://ko-fi.com/senalabs)\n\nA universal, cross-platform [MCP](https://modelcontextprotocol.io) server that gives **any MCP client** — Claude Desktop, the claude.ai web app (Connectors), Cursor, Cline / Continue in VS Code, or your own application — native access to the full [Replicate](https://replicate.com) catalog: image generation, video, music, speech, upscaling, segmentation, LLMs, voice cloning, 3D, lipsync — anything Replicate hosts.\n\nIt speaks both transports: **stdio** (the standard for local desktop/editor integrations) and **HTTP/SSE** (for remote/web clients and your own services).\n\nOnce connected to your MCP client, you can simply ask:\n\n> _\"Generate a cinematic shot of a lighthouse in a storm, 21:9\"_\n> _\"Write a 30-second synthwave track\"_\n> _\"Make a 5-second video of a paper airplane flying through a city\"_\n> _\"Read this paragraph in a British male voice\"_\n> _\"Upscale this image 4x\"_\n\n…and the assistant calls the right Replicate model, waits for the result, and (on local/stdio setups) downloads the output to your machine.\n\n---\n\n## Install\n\n**Fastest — one-click via [Smithery](https://smithery.ai/server/sena-labs/replicate-mcp-server)** ([![smithery badge](https://smithery.ai/badge/sena-labs/replicate-mcp-server?refresh=20260603)](https://smithery.ai/servers/sena-labs/replicate-mcp-server)): open the [server page](https://smithery.ai/server/sena-labs/replicate-mcp-server) and copy the **Install** snippet for your client (Claude, Cursor, VS Code, Cline, Windsurf, …). It wires the server in and prompts for your Replicate token. _(Routes through Smithery's hosted gateway — easiest, zero local setup.)_\n\n**Token-private — npm + stdio** (your Replicate token never leaves your machine):\n\n```bash\nnpx -y replicate-mcp-server\n```\n\n…or drop it into any MCP client's config (full walkthrough under [Installation](#installation)).\n\n**Claude Desktop one-file install:** download the latest [`.mcpb` from Releases](https://github.com/sena-labs/replicate-mcp-server/releases/latest) and drag it onto Claude Desktop.\n\n**Already running (bring your own token):** `https://replicate-mcp.sena-labs.dev/mcp` — HTTP/SSE, multi-tenant; pass your token in the `x-replicate-api-token` header.\n\nOnce connected, try the [example prompts](#try-it) below.\n\n---\n\n## Try it\n\nOnce your client is connected, ask in plain language — the assistant picks the right tool, **waits for the result, and downloads the output locally**:\n\n> _\"Generate a cinematic shot of a lighthouse in a storm, 21:9\"_\n> _\"Which is the cheapest model for a 5-second video? Then use it.\"_ — recommend → generate\n> _\"Make 4 logo variations of a fox, flat vector style\"_ — batch (concurrent)\n> _\"Transcribe this audio, summarise it, then read the summary aloud\"_ — DAG pipeline\n> _\"Upscale this image 4×\"_ · _\"Write a 30-second synthwave track\"_ · _\"Read this in a British male voice\"_\n> _\"Kick off a Flux LoRA fine-tune on my dataset and tell me when it's done\"_ — training\n\nDiscovery tools (`replicate_recommend_model`, `replicate_search_models`, `replicate_estimate_cost`) and the 5 built-in workflow prompts help it chain multi-step jobs without you naming models.\n\n---\n\n## What's inside\n\n36 tools and 66 curated models, designed to be both ergonomic for common cases and fully open-ended for everything else. Every generate/run tool **waits for completion and auto-downloads the outputs** to your machine — you ask once and get back local files, not a job id to babysit:\n\n### Curated generation tools\n\n| Tool | Purpose |\n|---|---|\n| `replicate_generate_image` | Text → image. Curated: Flux Schnell / Dev / Pro / 2-Max, SD 3.5, Recraft v3 / v4.1, Seedream, Ideogram v2, Imagen 3. |\n| `replicate_generate_video` | Text (or image) → video. Curated: Kling Pro, Minimax, Hunyuan, Luma Ray, Wan 2.2, Grok Video, Seedance. |\n| `replicate_generate_audio` | Text → music / songs. Curated: MusicGen, ACE-Step (full songs with lyrics), Riffusion, MiniMax Music. |\n| `replicate_generate_speech` | Text → speech (TTS). Curated: Kokoro, Minimax Speech, Chatterbox, Gemini TTS, Grok TTS. |\n| `replicate_chat` | Text → text via LLM. Curated: Llama 3.1 405B, Llama 3 70B / 8B, Mistral 7B, Mixtral 8x7B, DeepSeek-R1. |\n| `replicate_vision` | Image → text. Curated: LLaVA 13B / 1.6 34B, BLIP-2, Qwen2-VL. |\n| `replicate_upscale_image` | Image → higher-res image. Curated: Real-ESRGAN, Clarity Upscaler, Clarity Pro, SwinIR, GFPGAN. |\n| `replicate_remove_background` | Image → transparent PNG. Curated: rembg, BiRefNet, BRIA RMBG. |\n| `replicate_transcribe_audio` | Audio/video → text. Curated: Whisper, Distil-Whisper, WhisperX (diarization), ElevenLabs Scribe. |\n| `replicate_inpaint` | Mask-based image edit. Curated: Flux Fill Pro, SD inpaint, Ideogram v2 edit. |\n| `replicate_segment` | Image → mask. Curated: SAM 2, Grounded-SAM (text-prompt). |\n| `replicate_embed_text` | Text(s) → vector embeddings. Curated: BGE, Jina v3, MPNet. |\n\n### Voice, 3D, and avatar tools\n\n| Tool | Purpose |\n|---|---|\n| `replicate_clone_voice` | Text + reference sample → speech in a cloned voice. Curated: XTTS v2, OpenVoice v2. |\n| `replicate_generate_3d` | Text or image → 3D mesh (GLB/OBJ). Curated: Hunyuan 3D, Rodin, TripoSR. |\n| `replicate_lipsync` | Portrait + text/audio → lip-synced talking video. Curated: Video Avatar, SadTalker. |\n\n### Orchestration tools\n\n| Tool | Purpose |\n|---|---|\n| `replicate_batch_start` / `replicate_batch_status` | Run up to 50 predictions concurrently as a background job; poll progress + results. |\n| `replicate_pipeline_start` / `replicate_pipeline_status` | Run a DAG of predictions — independent steps in parallel, downstream steps wired via `\"$stepId.urls[0]\"` template refs. |\n| `replicate_recommend_model` | Rank curated models in a category by priority (speed / cost / quality / balanced) with cost estimates — advises which model to use. |\n| `replicate_refresh_models` | Discover popular Replicate models not yet in the curated registry. |\n\n### Fine-tuning (trainings)\n\n| Tool | Purpose |\n|---|---|\n| `replicate_create_training` | Kick off a fine-tune / training run on a trainable base model (e.g. a Flux LoRA) with your dataset + parameters. |\n| `replicate_get_training` | Poll a training by id (status, logs, resulting model version). |\n| `replicate_list_trainings` | List your recent training runs (id, model, status, timestamps). |\n| `replicate_cancel_training` | Cancel an in-progress training run by id. |\n\n### Deployments\n\n| Tool | Purpose |\n|---|---|\n| `replicate_list_deployments` | List your Replicate deployments (owner/name, current model + version). |\n| `replicate_get_deployment` | Inspect one deployment (model, version, hardware, autoscaling min/max). |\n| `replicate_run_deployment` | Run a prediction against a deployment — **waits for completion and auto-downloads** the outputs, same as the curated generate tools. |\n\n### Prediction management + cost\n\n| Tool | Purpose |\n|---|---|\n| `replicate_list_predictions` | Recent prediction history (id, model, status, timestamps). |\n| `replicate_cancel_prediction` | Cancel an in-progress async job by id. |\n| `replicate_estimate_cost` | Pre-call USD estimate from a curated price table. |\n\n### Generic / discovery tools\n\n| Tool | Purpose |\n|---|---|\n| `replicate_run_model` | Run **any** Replicate model with arbitrary inputs (escape hatch for anything not covered by a curated tool). |\n| `replicate_search_models` | Free-text search across the Replicate catalog. |\n| `replicate_get_model_schema` | Get the OpenAPI input schema for any model. |\n| `replicate_get_prediction` | Poll a long-running prediction (videos, long songs). |\n| `replicate_upload_file` | Upload a file to Replicate storage (by local `file_path` **or** `base64_data` / data URI); returns a URL to feed into other tools. |\n\nOutputs:\n- **Image / video / audio**: downloaded to `~/Downloads/replicate-mcp/<model>/<prediction_id>/` (configurable). Local paths and original Replicate URLs are both returned. For images, the response also includes an **inline base64 preview** (sized to stay under Claude Desktop's 1 MB tool-result limit; larger images fall back to the URL embed) plus three embed snippets (`<details>`-wrapped iframe viewer with Save button, responsive `<img>`, or markdown image) so the chat client can render the result inline at full size.\n- **Text** (LLM, vision, classifier): the model's reply is surfaced in `text_output` and printed at the top of the tool response so Claude can read it directly.\n\n### Editing an image you have on hand\n\nThe editing tools (`replicate_upscale_image`, `replicate_inpaint`, `replicate_remove_background`, `replicate_vision`, image-to-video, lipsync, 3D-from-image) all take a **URL**. To turn a file into a URL, use `replicate_upload_file`:\n\n- **You have a local path** (Claude Desktop): `replicate_upload_file({ file_path: \"C:/Users/you/photo.jpg\" })` → URL → pass to the editing tool. If an image is dragged/pasted into the chat, save it to disk first — the server cannot read chat attachments directly, and Claude Desktop cannot reproduce a large image's exact bytes as a tool argument.\n- **You have the bytes in memory** (claude.ai web with a code container): read the uploaded file in the container, base64-encode it, then `replicate_upload_file({ base64_data: \"data:image/png;base64,...\" })` → URL → editing tool. `base64_data` accepts a bare base64 string or a full `data:<mime>;base64,...` URI.\n- **You already have a URL**: pass it straight to the editing tool — no upload needed.\n\n---\n\n## Why this over the official Replicate MCP?\n\nReplicate ships its own [official MCP](https://replicate.com/docs/reference/mcp) (`replicate-mcp` on npm, hosted at `mcp.replicate.com`). It's a great, free, always-up-to-date **1:1 bridge to the REST API** — Stainless-generated from Replicate's OpenAPI spec, ~37 generic tools that mirror each endpoint (account, collections, deployments, files, hardware, models, predictions, trainings, webhooks), plus a `--tools=dynamic` mode and a Deno \"Code Mode\" sandbox.\n\nThis server is built for a different job. The official MCP is a **thin, generic API bridge**: to make an image you call `create_predictions` with a raw model id and raw input JSON, and the LLM has to look up each model's input schema itself; it returns `starting` and does **not** wait or download (you opt into `Prefer: wait`, capped at 60s, then poll manually). This server is a **batteries-included creative studio**: task-oriented tools with sane defaults, a curated model registry, built-in orchestration, and cost awareness — every generate/run tool **waits for completion and auto-downloads** the outputs locally.\n\n| Axis | Official Replicate MCP | This server (sena-labs) |\n|---|---|---|\n| Philosophy | Thin generic API bridge (1:1 REST) | Task-oriented creative studio |\n| Tools | ~37 generic REST tools (+ dynamic/code modes) | 36 task tools (`generate_image/video/audio/speech/3d`, `clone_voice`, `lipsync`, `upscale`, `inpaint`, `segment`, `remove_background`, `transcribe`, `vision`, `chat`, `embed`) |\n| Media helpers | None — raw `predictions.create` + raw input JSON | Purpose-built tools with sane defaults (aspect ratio, etc.) |\n| Run UX | Returns `starting`; opt-in `Prefer: wait` (≤60s) then **manual poll** | **Waits for completion AND auto-downloads** outputs locally |\n| Model curation | None — you supply the model + look up its schema yourself | 60+ curated models + `recommend_model` + smart routing + `search_models` + `get_model_schema` |\n| Orchestration | None | Async batch (`batch_start/status`) + DAG pipelines (`pipeline_start/status`) |\n| Cost | None | `estimate_cost` pre-flight USD estimate |\n| Fine-tuning + deployments | Yes (generic REST) | Yes — `create/get/list/cancel_training` + `list/get/run_deployment` (run waits + downloads) |\n| Extras | OAuth, auto-sync to API | 5 workflow prompts + 2 MCP resources (catalog + capabilities) |\n| REST breadth | Broader raw coverage (collections, files, hardware, webhooks, account) | Focused on creative tasks + the orchestration/cost layer on top |\n| Hosted / official | Official, free, hosted at `mcp.replicate.com` with OAuth, auto-synced | Self-hostable, multi-tenant (per-user token), stdio + HTTP/SSE |\n\n**In short:** the official MCP is the right tool if you want exhaustive, always-current raw REST access (and a free hosted endpoint with OAuth). This server is the right tool if you want a curated, orchestrated, cost-aware creative workflow where you describe what you want and get finished files back — no schema lookups, no manual polling, no manual downloads. They're complementary: use the official one for full-surface API plumbing, use this one for getting creative work done.\n\n---\n\n## Prerequisites\n\n- **Node.js ≥ 20** (uses native `fetch` and Web Streams)\n- A **Replicate account** with an API token: https://replicate.com/account/api-tokens\n- **An MCP client** — e.g. Claude Desktop (macOS/Windows/Linux), the claude.ai web app, Cursor, Cline / Continue (VS Code), or any custom MCP host. The walkthrough below uses Claude Desktop as the example; the same `command` / `args` / `env` block works in any client's MCP config. For remote/web clients, see [HTTP / SSE transport](#http--sse-transport).\n\n---\n\n## Installation\n\n### 1. Clone and build\n\n```bash\ngit clone <this-repo> replicate-mcp-server\ncd replicate-mcp-server\nnpm install\nnpm run build\n```\n\nThis produces `dist/index.js`, which is the server entry point.\n\n### 2. Get your Replicate API token\n\n1. Go to https://replicate.com/account/api-tokens\n2. Click **Create token**\n3. Copy the token (starts with `r8_...`)\n\n### 3. Connect it to your MCP client (Claude Desktop shown)\n\nThe MCP `command` / `args` / `env` block below is identical across clients — only the location of the config file differs (Cursor: `~/.cursor/mcp.json`; Cline/Continue: the extension's MCP settings; custom hosts: your own launcher). For Claude Desktop, find your config file:\n\n- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- **Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n- **Linux**: `~/.config/Claude/claude_desktop_config.json`\n\nAdd the `replicate` entry (merge with anything already there):\n\n```json\n{\n  \"mcpServers\": {\n    \"replicate\": {\n      \"command\": \"node\",\n      \"args\": [\"/ABSOLUTE/PATH/TO/replicate-mcp-server/dist/index.js\"],\n      \"env\": {\n        \"REPLICATE_API_TOKEN\": \"r8_your_token_here\"\n      }\n    }\n  }\n}\n```\n\n> ⚠️ Use the **absolute** path to `dist/index.js`. Tildes (`~`) and relative paths don't work in this config.\n\nOptional: set a custom download directory:\n\n```json\n\"env\": {\n  \"REPLICATE_API_TOKEN\": \"r8_...\",\n  \"REPLICATE_DOWNLOAD_DIR\": \"/Users/you/my-replicate-outputs\"\n}\n```\n\n### 4. Restart Claude Desktop\n\nFully quit and reopen Claude Desktop. You should see \"replicate\" listed in the tools panel (the hammer icon at the bottom of the chat).\n\n---\n\n## VS Code (native MCP)\n\nVS Code has built-in MCP support. This repo ships a ready-to-use [`.vscode/mcp.json`](.vscode/mcp.json) that runs the published npm package locally and prompts for your token (stored masked, never written to the file):\n\n```json\n{\n  \"inputs\": [\n    { \"type\": \"promptString\", \"id\": \"replicate_token\", \"description\": \"Replicate API token\", \"password\": true }\n  ],\n  \"servers\": {\n    \"replicate\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"replicate-mcp-server\"],\n      \"env\": { \"REPLICATE_API_TOKEN\": \"${input:replicate_token}\" }\n    }\n  }\n}\n```\n\nOpen the file in VS Code and click **Start** above the `replicate` server (or run _MCP: List Servers_). VS Code asks for the token once.\n\n> **Note on the Smithery \"One-Click Install\":** it wires VS Code to Smithery's **hosted** gateway (`mcp.smithery.run`), which runs the server on Smithery's infrastructure and would route your personal Replicate token through it on every call. For a personal API token, prefer the **local stdio** config above — the token never leaves your machine.\n\n---\n\n## Usage examples\n\nOnce connected, just talk to your assistant naturally (examples use Claude phrasing, but any MCP-capable assistant works):\n\n**Images**\n> Generate an origami fox in a misty forest, 16:9 aspect ratio.\n\n**High-quality images with text**\n> Make a logo for a coffee shop called \"Crema\" — use Recraft.\n\n**Video**\n> Create a 5-second video of a paper airplane gliding through a neon-lit city. Use Kling Pro.\n>\n> _(Videos take 1–5 minutes. If the call times out, Claude will automatically poll with `replicate_get_prediction`.)_\n\n**Music**\n> Write a 20-second instrumental synthwave loop with a heavy bassline.\n\n**Songs with lyrics**\n> Use the ACE-Step model to generate a sad indie-folk song with these lyrics: [...]\n\n**Speech**\n> Read this paragraph in a British female voice: [...]\n\n**Chat with an LLM**\n> Ask Llama 3 70B to explain quantum entanglement in two sentences.\n\n**Image understanding**\n> Look at this photo [URL] and tell me what objects are in the foreground.\n\n**Upscale**\n> Upscale this image 4x with Real-ESRGAN: [URL]\n\n**Background removal**\n> Cut the background out of this product photo: [URL]\n\n**Anything else**\n> Search Replicate for \"speech to text\", then transcribe this audio: [URL]\n>\n> _(Claude picks Whisper via `replicate_search_models` → `replicate_run_model`.)_\n\n---\n\n## How async predictions work\n\nImage generation usually finishes in seconds. Video, long music, and some heavy models can take minutes. The server handles this transparently:\n\n1. You call `replicate_generate_video`.\n2. The server waits up to `timeout_ms` (default 5 minutes) by polling Replicate every 2 seconds.\n3. If it finishes in time → you get URLs and local paths.\n4. If it doesn't → you get back `pending: true` and a `prediction_id`. Claude can call `replicate_get_prediction` later to retrieve the result.\n\nYou can bump `timeout_ms` up to 30 minutes if you want to wait inline:\n\n> Generate a 10-second Hunyuan video. Wait up to 20 minutes.\n\n---\n\n## Configuration\n\n| Environment variable | Default | Purpose |\n|---|---|---|\n| `REPLICATE_API_TOKEN` | _(required)_ | Your Replicate API token. |\n| `REPLICATE_DOWNLOAD_DIR` | `~/Downloads/replicate-mcp` | Where to save generated files. |\n\n---\n\n## Costs\n\nReplicate charges per second of compute, varying by model. Approximate costs:\n\n- Flux Schnell image: ~$0.003\n- Flux Dev image: ~$0.025\n- Flux 1.1 Pro image: ~$0.04\n- Kling 1.6 Pro 5-second video: ~$0.45\n- MusicGen 30-second clip: ~$0.05\n- Kokoro TTS: ~$0.001 per request\n- Llama 3 70B chat: ~$0.001 per 1K tokens\n- LLaVA 13B vision: ~$0.001 per image\n- Real-ESRGAN 4x upscale: ~$0.003 per image\n\nSee https://replicate.com/pricing for current rates and your billing dashboard for usage.\n\n---\n\n## Troubleshooting\n\n**\"REPLICATE_API_TOKEN environment variable is not set\"**\nYou haven't put the token in the `env` block of your Claude Desktop config. Double-check the JSON and restart Claude Desktop.\n\n**\"Server disconnected\" in Claude Desktop**\nUsually a path problem. Make sure the path to `dist/index.js` is absolute and the file exists. Test it manually:\n```bash\nREPLICATE_API_TOKEN=r8_... node /ABSOLUTE/PATH/dist/index.js\n```\nYou should see `replicate-mcp-server v1.0.0 ready. API token detected.` on stderr. Press Ctrl+C to quit.\n\n**A model isn't in the curated list**\nJust use its full identifier: `model: \"stability-ai/sdxl\"` works the same way. Or use `replicate_search_models` to find one.\n\n**Need a specific version of a model**\nUse the `owner/name:version_hash` form: `model: \"black-forest-labs/flux-schnell:bf53bdb93d739c9c915091cfa5f49ca662d11273a5eb30e7a2ec1939bcf27a00\"`.\n\n**Downloaded files are missing**\nCheck `REPLICATE_DOWNLOAD_DIR`. Files are organised as `<dir>/<sanitized-model>/<prediction-id>/output-N.<ext>`.\n\n---\n\n## Deploy as platform (v3.0+)\n\nBeyond a single local stdio client, the server also runs as a\n**multi-user platform** — HTTP/SSE transport (for claude.ai web Connectors,\nremote editors, and custom apps), multi-token pool, webhook-driven async\ncompletion, Docker, npm distribution.\n\n### HTTP / SSE transport\n\nRun the server as an HTTP service instead of stdio:\n\n```bash\n# Local-only, no auth — for development.\nnode dist/index.js --http --port 8088\n\n# LAN-exposed with Bearer auth — behind a private network.\nnode dist/index.js --http --host 0.0.0.0 --port 8088 --api-key your-shared-secret\n```\n\nClients POST JSON-RPC to `http://host:port/mcp` with:\n\n```\nAuthorization: Bearer your-shared-secret\nContent-Type: application/json\nAccept: application/json, text/event-stream\nMcp-Session-Id: <set by server on initialize, echoed on follow-ups>\n```\n\nHealth probe (no auth): `GET /health` → `{\"status\": \"ok\"}`.\n\n### npm install (when published)\n\n```bash\nnpx replicate-mcp-server --http --port 8088 --api-key SECRET\n# or as a Claude Desktop launcher:\nnpx replicate-mcp-server\n```\n\n### Docker\n\n```bash\ndocker build -t replicate-mcp-server .\ndocker run --rm \\\n  -e REPLICATE_API_TOKEN=r8_... \\\n  -e LOG_LEVEL=info \\\n  -p 8088:8088 \\\n  replicate-mcp-server\n```\n\nThe default `CMD` starts in HTTP mode on `0.0.0.0:8088`. Add `--api-key`\nvia `docker run ... replicate-mcp-server --http --api-key SECRET` if you\nexpose the port beyond a private network.\n\n### Multi-token round-robin pool\n\nFor team / multi-tenant deployments, give the server multiple Replicate\naccounts to spread rate-limit headroom:\n\n```bash\nREPLICATE_API_TOKEN_POOL=r8_account_a,r8_account_b,r8_account_c \\\n  node dist/index.js --http --port 8088\n```\n\nEach Replicate API call rotates through the pool. Falls back to single\n`REPLICATE_API_TOKEN` if only one configured.\n\n### Webhook receiver (event-driven completion)\n\nIf the server is reachable from the public internet, you can replace\npolling with webhook callbacks:\n\n```bash\nREPLICATE_WEBHOOK_PUBLIC_URL=https://your.domain/webhook \\\nREPLICATE_WEBHOOK_PORT=8089 \\\n  node dist/index.js --http --port 8088\n```\n\nReplicate POSTs prediction completion to the public URL; the server\nresolves the awaiting tool call without polling. Per-prediction random\ntoken authenticates each callback.\n\n### Smithery listing\n\nThis server is **live on Smithery**: [smithery.ai/server/sena-labs/replicate-mcp-server](https://smithery.ai/server/sena-labs/replicate-mcp-server) — scanned (36 tools, 5 prompts, 2 resources) and one-click installable into Claude, Cursor, VS Code, Cline, Windsurf, and other MCP clients. `smithery.yaml` defines the install-time config UI (token, optional pool, log level, download dir).\n\n### claude.ai web Connector\n\nFor listing as a Connector inside the claude.ai web app:\n\n1. Deploy the server publicly with HTTPS (Render / Fly.io / Cloudflare /\n   bare VPS behind a TLS-terminating reverse proxy).\n2. Register the MCP HTTP endpoint at\n   <https://console.anthropic.com/settings/connectors>.\n3. Users add it from claude.ai → Settings → Connectors → Add custom.\n\nAnthropic's Connector review is manual — provide the OAuth flow / API key\ninput form they require, plus the public `/mcp` URL.\n\n---\n\n## Architecture\n\n```\nsrc/\n├── index.ts        # MCP server, tool registration, response formatting (handler factory)\n├── replicate.ts    # API client, polling, output extraction (URLs + text), file download with retry\n├── schemas.ts      # Zod schemas for tool inputs (with .strict())\n├── models.ts       # Curated model registry per category (8 categories)\n└── constants.ts    # Shared constants (timeouts, paths, character limits)\n\ntest/\n├── stdio-test.mjs       # End-to-end MCP handshake + tool registration test (response correlation)\n└── unit/                # node:test unit suites for pure helpers\n    ├── extract-urls.test.mjs\n    ├── extract-texts.test.mjs\n    ├── infer-filename.test.mjs\n    └── sanitize.test.mjs\n```\n\nThe server uses the **stdio transport** (standard for local Claude Desktop integrations) and the modern `registerTool` API of the MCP TypeScript SDK. All tool inputs are validated by Zod schemas with `.strict()` enforcement — no unknown parameters slip through.\n\nThe 8 curated generation tools share a single `makeGenerationHandler` factory; each tool only declares how it maps its specific input fields onto the Replicate request body. Output URLs are extracted by recursively walking the prediction's `output` field, which can be a string, an array, a nested object, or any combination. Text outputs (from LLM / vision / classifier models) are surfaced through the same walker so non-URL strings appear in the response. Files are streamed to disk using Node's `stream/promises.pipeline()` so multi-GB videos don't blow up memory. Downloads retry once on transient failures (network error or 5xx) with exponential backoff; 4xx errors fail fast.\n\n### Testing\n\n```bash\nnpm run build\nnode --test test/unit/*.test.mjs    # 43 unit tests on pure helpers\nnode test/stdio-test.mjs            # End-to-end MCP handshake + tool/list + tool/call sanity check\n```\n\n---\n\n## Support & contact\n\n- **Bugs and feature requests** — [open an issue](https://github.com/sena-labs/replicate-mcp-server/issues); that's the fastest path and keeps the answer searchable for everyone.\n- **Questions, integration help, anything else** — [ivan.sena@sena-labs.dev](mailto:ivan.sena@sena-labs.dev)\n- **Security vulnerabilities** — please don't file a public issue. Email [ivan.sena@sena-labs.dev](mailto:ivan.sena@sena-labs.dev) or open a [private advisory](https://github.com/sena-labs/replicate-mcp-server/security/advisories/new); see [SECURITY.md](SECURITY.md) for scope and response times.\n\nIf this project is useful to you, consider supporting its development:\n\n☕ [**ko-fi.com/senalabs**](https://ko-fi.com/senalabs)\n\n---\n\n## Trademarks & disclaimer\n\nThis is an independent, community-built project. It is **not affiliated with, endorsed by, sponsored by, or officially connected to Replicate, Inc.**\n\n- **\"Replicate\"** and the Replicate logo are trademarks of **Replicate, Inc.** This server is an interoperability client for Replicate's public HTTP API; the name is used descriptively (nominative fair use) to indicate compatibility — not to imply origin or endorsement. For Replicate's own official MCP server, see [replicate.com/docs/reference/mcp](https://replicate.com/docs/reference/mcp).\n- Built on the **Model Context Protocol (MCP)**, the open standard created by Anthropic.\n- Model names referenced (FLUX, Recraft, Whisper, Llama, etc.) are trademarks of their respective owners and are used only to identify the models you can run.\n\nYou are responsible for complying with [Replicate's Terms of Service](https://replicate.com/terms) and the license of each model you invoke. Bundled third-party open-source components and their licenses are listed in [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md). The banner/logo use the [Inter](https://rsms.me/inter/) typeface (SIL Open Font License 1.1).\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n",
  "bytes": 27194,
  "sha": "586d51186e0a4f7a51cf686104367feacf6c121baf2d7b5722dd88237ed670be",
  "repo_slug": "sena-labs/replicate-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_sena_labs_replicate_mcp_server_d1924149/readme"
}