Replicate MCP Server
Provides tools for searching models and generating images using Replicate's API, enabling AI agents to interact with image generation and editing models.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Replicate MCP Servergenerate an image of a cat playing piano using flux-schnell"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Replicate MCP Server
Lightweight MCP server for AI image generation and editing using Replicate's official models.
Author: overment
Overview
This is a focused, minimal MCP server designed specifically for image generation workflows. Unlike full-featured Replicate MCP Servers, this server exposes only what's needed for image generation and editing with official models like Flux, SDXL, and Seedream.
Recommended usage: Tell your assistant upfront which model you prefer and any specific settings (quality, aspect ratio, style). This reduces tool calls and gets better results faster.
Example system prompt addition:
For image generation, use black-forest-labs/flux-schnell with 16:9 aspect ratio unless I specify otherwise.Notice
This repo works in two ways:
As a Node/Hono server for local workflows
As a Cloudflare Worker for remote interactions
Features
Search Models — Find image generation models with full input schemas
Generate Images — Run predictions and get results with expiring URLs
Lightweight — Only 2 tools
API Key Auth — Simple Bearer token or X-Api-Key header authentication
Dual Runtime — Node.js/Bun or Cloudflare Workers
Design Principles
LLM-friendly: Two focused tools, not 1:1 API mirrors
Schema-aware: Search returns input schemas so agent knows exact parameters
Secure: Replicate API key stored as secret, clients use separate bearer token
Clear feedback: Model parameters, generation time, markdown-ready output
Installation
Prerequisites: Bun, Replicate Account.
Ways to Run (Pick One)
Local Development — Standard setup with bearer token auth
Cloudflare Worker (wrangler dev) — Local Worker testing
Cloudflare Worker (deploy) — Remote production
1. Local Development — Quick Start
Get Replicate API token:
Create a new API token
Copy the token (starts with
r8_)
Configure environment:
cd replicate-mcp
bun install
cp env.example .envEdit .env:
PORT=3000
# Generate with: openssl rand -hex 32
API_KEY=your-random-auth-token
# Replicate API Token (from replicate.com)
REPLICATE_API_TOKEN=r8_your_token_hereRun:
bun dev
# MCP: http://127.0.0.1:3000/mcpClaude Desktop / Cursor:
{
"mcpServers": {
"replicate": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:3000/mcp", "--transport", "http-only"],
"env": { "NO_PROXY": "127.0.0.1,localhost" }
}
}
}2. Cloudflare Worker (Local Dev)
bun x wrangler dev --local | catCreate .dev.vars for local secrets:
API_KEY=your_random_auth_token
REPLICATE_API_TOKEN=r8_your_replicate_tokenEndpoint: http://127.0.0.1:8787/mcp
3. Cloudflare Worker (Deploy)
Create KV namespace for session storage:
bun x wrangler kv:namespace create TOKENSOutput will show:
Add the following to your wrangler.toml:
[[kv_namespaces]]
binding = "TOKENS"
id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Update
wrangler.tomlwith your KV namespace ID:
[[kv_namespaces]]
binding = "TOKENS"
id = "your-kv-namespace-id-from-step-1"Set secrets:
# Generate a random token for client authentication
openssl rand -hex 32
bun x wrangler secret put API_KEY
# Paste the generated token when prompted
# Replicate API token
bun x wrangler secret put REPLICATE_API_TOKEN
# Paste your Replicate token when promptedDeploy:
bun x wrangler deployEndpoint: https://<worker-name>.<account>.workers.dev/mcp
Client Configuration
Alice App
Add as MCP server with:
URL:
https://your-worker.workers.dev/mcpType:
streamable-httpHeader:
Authorization: Bearer <your-API_KEY>
Claude Desktop / Cursor (Local Server)
{
"mcpServers": {
"replicate": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:3000/mcp", "--transport", "http-only"],
"env": { "NO_PROXY": "127.0.0.1,localhost" }
}
}
}Claude Desktop / Cursor (Cloudflare Worker)
{
"mcpServers": {
"replicate": {
"command": "npx",
"args": ["mcp-remote", "https://your-worker.workers.dev/mcp", "--transport", "http-only"]
}
}
}MCP Inspector (Quick Test)
bunx @modelcontextprotocol/inspector
# Connect to: http://localhost:3000/mcp (local) or https://your-worker.workers.dev/mcp (remote)Tools
search_models
Search for models and get their input schemas. Returns up to 5 models with full parameter details.
// Input
{
query: string; // Model name, task, or keywords
}
// Output
### owner/name
Description of the model
Runs: 1,234,567
Input parameters:
- prompt [REQUIRED]: string
- aspect_ratio: enum: ["1:1", "16:9", "9:16"] = "1:1"
- num_outputs: integer = 1
...Example:
{ "query": "flux" }generate_image
Run an image generation model and wait for the result.
// Input
{
model: string; // "owner/name" format
input: Record<string, unknown>; // Model-specific parameters
}
// Output
## Image Generated in 2.3s
Model: black-forest-labs/flux-schnell
Display the image to the user using markdown syntax:

Note: URLs expire in 1 hour.Common input patterns:
// Text-to-image
{
"model": "black-forest-labs/flux-schnell",
"input": {
"prompt": "a cat on the moon",
"aspect_ratio": "16:9"
}
}
// Image editing
{
"model": "black-forest-labs/flux-kontext-pro",
"input": {
"prompt": "change the sky to sunset",
"image": "https://example.com/source.jpg"
}
}Popular Models
Model | Speed | Best For |
| ~2s | Quick generations, drafts |
| ~10s | Higher quality, detailed |
| ~5s | Versatile, multi-reference |
| ~8s | Image editing with text |
Aspect Ratio Guide
Ratio | Use Case |
| Portraits, icons, profile pictures |
| Landscapes, cinematic, desktop wallpapers |
| Mobile wallpapers, stories, vertical content |
| Classic photo format |
| Ultra-wide cinematic |
HTTP Endpoints
Endpoint | Method | Purpose |
| POST | MCP JSON-RPC 2.0 |
| GET | Health check |
Environment Variables
Node.js (.env)
Variable | Required | Description |
| ✓ | Replicate API token (r8_...) |
| ✓ | Auth token for MCP clients |
| Server port (default: 3000) | |
| Server host (default: 127.0.0.1) |
Cloudflare Workers (wrangler.toml + secrets)
wrangler.toml vars:
[vars]
MCP_TITLE = "Replicate MCP Server"
MCP_VERSION = "1.0.0"Secrets (set via wrangler secret put):
API_KEY— Random auth token for clientsREPLICATE_API_TOKEN— Replicate API token
KV Namespace:
[[kv_namespaces]]
binding = "TOKENS"
id = "your-kv-namespace-id"Development
bun dev # Start with hot reload
bun run typecheck # TypeScript check
bun run lint # Lint code
bun run build # Production build
bun start # Run productionArchitecture
src/
├── config/
│ └── metadata.ts # Tool descriptions
├── tools/
│ ├── search-models.tool.ts # Search with schema enrichment
│ └── generate-image.tool.ts # Run predictions
├── services/
│ └── api/
│ └── replicate.service.ts # Replicate API client
├── http/
│ ├── app.ts # Hono server
│ └── middlewares/
│ └── auth.ts # API key validation
├── index.ts # Node.js entry
└── worker.ts # Workers entryTroubleshooting
Issue | Solution |
401 Unauthorized | Check |
"REPLICATE_API_TOKEN not configured" | Set secret: |
"Invalid model format" | Use |
"Missing required parameters" | Call |
"Rate limit exceeded" | Wait a moment and retry |
"Image URL expired" | URLs expire after 1 hour — generate again |
KV namespace error | Run |
Debugging
Test with MCP Inspector:
bunx @modelcontextprotocol/inspector
# Connect to your endpoint and test toolsCheck Worker logs:
wrangler tailLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/iceener/replicate-streamable-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server