Skip to main content
Glama

Replicate MCP Server

A comprehensive MCP (Model Context Protocol) server that enables LLM clients to generate, edit, and evaluate images through the Replicate API.

Features

  • Text-to-Image Generation: Generate single or batch images from text prompts

  • Image-to-Image Generation: Transform images based on reference images and prompts

  • Image Editing: Edit existing images with text-guided modifications

  • Creative Prompts: Generate creative image prompts based on style, subject, and mood

  • Batch Processing: Process up to 5 images concurrently

  • Progress Reporting: Real-time progress updates for long-running operations

  • Error Handling: Comprehensive error handling and validation

Related MCP server: Nano Banana Pro MCP

Installation

  1. Clone the repository:

git clone https://github.com/yourusername/replicate-mcp-server.git
cd replicate-mcp-server
  1. Install dependencies using uv:

uv sync
  1. Set up your environment:

cp .env.example .env
# Edit .env and add your Replicate API token

Configuration

Environment Variables

Create a .env file with:

REPLICATE_API_TOKEN=your-replicate-api-token-here
LOG_LEVEL=INFO
MAX_BATCH_SIZE=5
REQUEST_TIMEOUT=300
ENABLE_DEBUG=false

Claude Desktop Configuration

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "replicate-image-server": {
      "command": "uv",
      "args": [
        "run", 
        "python", 
        "/path/to/replicate-mcp-server/src/main.py"
      ],
      "env": {
        "REPLICATE_API_TOKEN": "your-replicate-api-token"
      }
    }
  }
}

Claude Code Configuration

Add to your Claude Code configuration:

{
  "mcpServers": {
    "replicate-image-server": {
      "command": "uv",
      "args": [
        "run",
        "python",
        "/path/to/replicate-mcp-server/src/main.py"
      ],
      "env": {
        "REPLICATE_API_TOKEN": "your-replicate-api-token",
        "LOG_LEVEL": "DEBUG"
      }
    }
  }
}

Available Tools

generate_image

Generate a single image from a text prompt.

Parameters:

  • prompt (str): Text description of the image to generate

  • width (int): Image width in pixels (256-2048, default: 1024)

  • height (int): Image height in pixels (256-2048, default: 1024)

  • negative_prompt (str, optional): What to avoid in the image

  • num_inference_steps (int): Number of denoising steps (1-50, default: 4)

  • guidance_scale (float): How closely to follow the prompt (0.0-20.0, default: 0.0)

  • seed (int, optional): Random seed for reproducibility

  • model_name (str, optional): Specific model to use

generate_image_batch

Generate multiple images concurrently from text prompts.

Parameters:

  • prompts (list[str]): List of text descriptions (max 5 prompts)

  • Same optional parameters as generate_image

generate_from_reference_image

Generate an image based on a reference image and text prompt.

Parameters:

  • image_url (str): URL of the reference image

  • prompt (str): Text description for transformation

  • strength (float): Transformation strength (0.1-1.0, default: 0.8)

  • Other optional parameters similar to generate_image

edit_image

Edit an existing image based on text prompts.

Parameters:

  • image_url (str): URL of the image to edit

  • prompt (str): Description of desired edits

  • mask_url (str, optional): URL of mask image

  • strength (float): Edit strength (0.1-1.0, default: 0.7)

  • preserve_original (bool): Whether to preserve unmasked areas (default: true)

  • model_name (str, optional): Specific model to use

Available Prompts

creative_image_prompt

Generate creative image prompts based on style, subject, and mood.

Parameters:

  • style (str): Art style (default: "photorealistic")

    • Options: photorealistic, anime, oil_painting, watercolor, digital_art, impressionist, cyberpunk, minimalist

  • subject (str): Subject matter (default: "landscape")

    • Options: landscape, portrait, architecture, nature, abstract, urban, fantasy, still_life

  • mood (str): Mood/atmosphere (default: "serene")

    • Options: serene, dramatic, mysterious, joyful, melancholic, energetic, romantic, ethereal

Models

The server uses the following default models:

  • Text-to-Image: bytedance/sdxl-lightning-4step

  • Image-to-Image: google/nano-banana

  • Image Editing: bytedance/seedream-4

Development

Running Tests

uv run pytest

Type Checking

uv run mypy src

Code Formatting

uv run black src
uv run ruff check src

License

MIT

Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.

Support

For issues and questions, please open an issue on GitHub.

Available Tools

4 tools
edit_imageB

Edit an existing image based on text prompts.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYes
mask_urlNo
strengthNo
image_urlYes
model_nameNo
preserve_originalNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full behavioral disclosure burden. It does not state whether editing is reversible, what preserve_original means operationally, whether mask_url requires specific formats, or how strength affects output. One sentence is insufficient for a 6-parameter mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no redundancy, front-loads the core operation. Appropriate brevity given the description's limited scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter mutation tool with no annotations and incomplete schema descriptions, the description is far too thin. It doesn't explain key parameters, side effects, or how it relates to sibling image generation tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning none of the 6 parameters have descriptions in the schema. The tool description mentions only 'text prompts' which loosely maps to the prompt parameter. mask_url, strength, preserve_original, and model_name remain completely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (edit) and resource (image) with the mechanism (text prompts). This distinguishes it from generate_image (create new) though it doesn't explicitly name siblings as alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The verb 'edit' implies usage context, but there is no explicit guidance on when to use this over generate_image or generate_from_reference_image. An agent must infer the boundary from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_from_reference_imageC

Generate an image based on a reference image and text prompt.

ParametersJSON Schema
NameRequiredDescriptionDefault
seedNo
promptYes
strengthNo
image_urlYes
model_nameNo
guidance_scaleNo
negative_promptNo
num_inference_stepsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden, and it says nothing about cost, latency, determinism via seed, how 'strength' alters fidelity to the reference, or safety filtering. For a generation tool that returns a new artifact, this is a substantial gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no wasted words, but the brevity reflects under-specification rather than tight editing. Concise in form, thin in substance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be explained, but for an 8-parameter generation tool with no annotations and 0% schema coverage, the description leaves tuning parameters and sibling selection entirely unspecified. Inadequate for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 8 parameters, so the description must compensate and does not. It only gestures at image_url and prompt; strength, guidance_scale, seed, negative_prompt, num_inference_steps, and model_name are left entirely undefined in both places.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and output ('Generate an image') conditioned on two named inputs ('reference image and text prompt'). This distinguishes it in spirit from generate_image (text-only) and edit_image, but it never names or contrasts those siblings explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use guidance at all. With siblings generate_image, edit_image, and generate_image_batch available, an agent gets no criteria for choosing reference-image generation over plain text-to-image or editing. The reference-image condition is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_imageC

Generate a single image from a text prompt using Replicate AI models.

ParametersJSON Schema
NameRequiredDescriptionDefault
seedNo
widthNo
heightNo
promptYes
model_nameNo
guidance_scaleNo
negative_promptNo
num_inference_stepsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It discloses only the provider (Replicate) and that one image is produced; it says nothing about cost, latency, model selection behavior, reproducibility via seed, or failure modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single well-formed sentence with zero waste, front-loading the verb and resource. It is efficient, though its brevity stems partly from under-specification rather than tight editing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described. However, for an 8-parameter generative tool with no annotations and 0% schema coverage, the description leaves the agent without enough information to tune parameters or anticipate behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for 8 parameters, and the schema exposes only bare titles. The description clarifies only 'prompt' (text prompt) and adds nothing about seed, width, height, model_name, guidance_scale, negative_prompt, or num_inference_steps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (generate), resource (image), scope (single), input type (text prompt), and backend (Replicate AI models). The word 'single' implicitly distinguishes it from generate_image_batch, though no sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use guidance beyond the implicit 'single image' scope. Nothing tells the agent when to prefer this over generate_from_reference_image or edit_image, and no prerequisites or exclusions are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_image_batchC

Generate multiple images concurrently from text prompts.

ParametersJSON Schema
NameRequiredDescriptionDefault
widthNo
heightNo
promptsYes
model_nameNo
guidance_scaleNo
negative_promptNo
num_inference_stepsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden, yet it discloses almost nothing beyond 'concurrently'. It omits whether concurrency is bounded, rate limits, cost, partial-failure handling, or whether all prompts use identical width/height/model settings. The single adjective 'concurrently' is the only behavioral hint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single tight sentence that front-loads the verb and resource with zero filler. It is appropriately sized, though its brevity is partly the cause of the missing parameter and behavioral detail rather than pure economy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, but for a 7-parameter generative tool with no annotations the description is far too thin. It leaves key operational facts (per-prompt vs global settings, concurrency limits, failure behavior) undefined for an agent to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Seven parameters with 0% schema description coverage, so the description is responsible for compensating and it does not name a single parameter. It never explains that prompts is an array of independent prompts, nor what guidance_scale, num_inference_steps, model_name, or negative_prompt control. The only inference available is that width/height likely apply globally to the batch.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Generate multiple images') with a clear scope qualifier ('concurrently from text prompts') that implicitly distinguishes it from the single-image sibling generate_image. The plural 'multiple' and 'batch' naming make the batching purpose obvious, though no sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives no when-to-use guidance. It never says to prefer this over generate_image when generating several prompts, nor does it describe any conditions, prerequisites, or exclusions relative to generate_from_reference_image or edit_image. The batch intent is inferable only from the name and the word 'concurrently'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observededit_image
    • First observedgenerate_from_reference_image
    • First observedgenerate_image
    • First observedgenerate_image_batch

TDQS

B3.2/5.0

Scored across 4 tools

Disambiguation4/5

generate_image and generate_image_batch are clearly distinct by cardinality, and each has a unique input type. However, edit_image and generate_from_reference_image overlap: both take an image and text prompt and return a modified/new image, which could cause misselection.

Naming Consistency5/5

All tool names use snake_case with a clear verb_noun or verb_preposition_noun structure. The generate_ prefix is consistent across three tools, and edit_image is a natural semantic variation.

Tool Count4/5

Four tools is well within the ideal 3-15 range for a focused image generation service. It covers key workflows without redundancy, though it could arguably support more operations.

Completeness4/5

The set covers single generation, batch generation, reference-based generation, and editing, which are core for image generation. Missing operations like listing available models or retrieving generation status are minor gaps an agent could work around.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers