Skip to main content
Glama
MCP Server Replicate

MCP Server Replicate

by gerred

MCP Server Replicate

Python Version License Code Style Type Checker Ruff PyPI version

A FastMCP server implementation for the Replicate API, providing resource-based access to AI model inference with a focus on image generation.

Features

  • 🖼️ Resource-based image generation and management

  • 🔄 Real-time updates through subscriptions

  • 📝 Template-driven parameter configuration

  • 🔍 Comprehensive model discovery and selection

  • 🪝 Webhook integration for external notifications

  • 🎨 Quality and style presets for optimal results

  • 📊 Progress tracking and status monitoring

  • 🔒 Secure API key management

Related MCP server: MCP Server for Replicate

Available Prompts

The server provides several specialized prompts for different tasks:

Text to Image (Primary)

Our most thoroughly tested and robust prompt. Optimized for generating high-quality images from text descriptions with:

  • Detailed style control

  • Quality presets (draft, balanced, quality, extreme)

  • Size and aspect ratio customization

  • Progress tracking and real-time updates

Example:

Create a photorealistic mountain landscape at sunset with snow-capped peaks, quality level: quality, style: photorealistic

Other Prompts

  • Image to Image: Transform existing images (coming soon)

  • Model Selection: Get help choosing the right model for your task

  • Parameter Help: Understand and configure model parameters

Prerequisites

Installation

Installing via Smithery

To install MCP Server Replicate for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @gerred/mcp-server-replicate --client claude

Installing Manually

You can install the package directly from PyPI:

# Using UV (recommended)
uv pip install mcp-server-replicate

# Using UVX for isolated environments
uvx install mcp-server-replicate

# Using pip
pip install mcp-server-replicate

Claude Desktop Integration

  1. Make sure you have the latest version of Claude Desktop installed

  2. Open your Claude Desktop configuration:

# macOS
code ~/Library/Application\ Support/Claude/claude_desktop_config.json

# Windows
code %APPDATA%\Claude\claude_desktop_config.json
  1. Add the server configuration using one of these options:

{
  "globalShortcut": "Shift+Alt+A",
  "mcpServers": {
    "replicate": {
      "command": "uv",
      "args": ["tool", "run", "mcp-server-replicate"],
      "env": {
        "REPLICATE_API_TOKEN": "APITOKEN"
      },
      "cwd": "$PATH_TO_REPO"
    }
  }
}
  1. Set your Replicate API key:

# Option 1: Set in your environment
export REPLICATE_API_TOKEN=your_api_key_here

# Option 2: Create a .env file in your home directory
echo "REPLICATE_API_TOKEN=your_api_key_here" > ~/.env
  1. Restart Claude Desktop completely

You should now see the 🔨 icon in Claude Desktop, indicating that the MCP server is available.

Usage

Once connected to Claude Desktop, you can:

  1. Generate images with natural language:

    Create a photorealistic mountain landscape at sunset with snow-capped peaks
  2. Browse your generations:

    Show me my recent image generations
  3. Search through generations:

    Find my landscape generations
  4. Check generation status:

    What's the status of my last generation?

Troubleshooting

Server not showing up in Claude Desktop

  1. Check the Claude Desktop logs:

tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
  1. Verify your configuration:

  • Make sure the path in claude_desktop_config.json is absolute

  • Ensure UV is installed and in your PATH

  • Check that your Replicate API key is set

  1. Try restarting Claude Desktop

For more detailed troubleshooting, see our Debugging Guide.

Documentation

Development

  1. Clone the repository:

git clone https://github.com/gerred/mcp-server-replicate.git
cd mcp-server-replicate
  1. Install development dependencies:

uv pip install --system ".[dev]"
  1. Install pre-commit hooks:

pre-commit install
  1. Run tests:

pytest

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Available Tools

18 tools
cancel_predictionC

Cancel a running prediction.

Inputs: prediction_id (required).

create_predictionC

Create a new prediction using a specific model version on Replicate.

    Args:
        input: Model input parameters including version or model details
        confirmed: Whether the user has explicitly confirmed the generation

    Returns:
        Prediction details if confirmed, or a confirmation request if not
    

Inputs: input (required), confirmed.

generate_imageC

Generate an image using the specified parameters.

Inputs: prompt (required), style, quality, width, +3 more.

get_collection_detailsC

Get detailed information about a specific collection.

Inputs: collection_slug (required).

get_model_detailsC

Get detailed information about a specific model.

    Args:
        model_id: Model identifier in format owner/name

    Returns:
        Detailed model information
    

Inputs: model_id (required).

get_predictionC

Get the status and results of a prediction.

Inputs: prediction_id (required), wait, max_retries.

get_webhook_secretA

Get the signing secret for verifying webhook requests.

Inputs: no named parameters.

list_collectionsB

List available model collections on Replicate.

Inputs: no named parameters.

list_hardwareB

List available hardware options for running models.

Inputs: no named parameters.

list_modelsC

List available models on Replicate with optional filtering by owner.

Inputs: owner.

list_templatesB

List all available templates with their schemas.

Inputs: no named parameters.

open_image_with_systemB

Open an image URL with the system's default application.

    Args:
        image_url: URL of the image to open

    Returns:
        Dict containing status of the operation
    

Inputs: image_url (required).

search_available_modelsB

Search for available models matching the query.

    Args:
        query: Search query describing the desired model
        style: Optional style to filter by

    Returns:
        List of matching models with scores
    

Inputs: query (required), style.

search_modelsC

Search for models using semantic search.

Inputs: query (required).

subscribe_to_generationD

Handle resource subscription requests.

Inputs: request (required).

unsubscribe_from_generationC

Handle resource unsubscribe requests.

Inputs: request (required).

validate_template_parametersC

Validate parameters against a template schema.

Inputs: input (required).

verify_webhookA

Verify that a webhook request came from Replicate using HMAC-SHA256.

    Args:
        payload: The webhook payload to verify
        signature: The signature from the X-Replicate-Signature header
        secret: The webhook signing secret from get_webhook_secret

    Returns:
        True if signature is valid, False otherwise
    

Inputs: payload (required), signature (required), secret (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between 'search_available_models' and 'search_models' that could cause confusion, as both involve searching for models. The descriptions help differentiate them slightly, but the boundaries are not entirely clear.

    Naming Consistency5/5

    Tool names follow a consistent snake_case pattern with clear verb_noun structures throughout, such as 'create_prediction', 'get_model_details', and 'list_collections'. There are no deviations in naming conventions, making the set predictable and readable.

    Tool Count3/5

    With 18 tools, the count is borderline high for a server focused on Replicate's AI model platform. While it covers various aspects like predictions, models, and webhooks, it may feel slightly heavy and could benefit from consolidation to reduce complexity.

    Completeness4/5

    The tool set provides good coverage for the Replicate domain, including prediction lifecycle (create, get, cancel), model discovery (list, get, search), and webhook management. Minor gaps exist, such as missing tools for updating or deleting predictions or models, but agents can work around these with the available operations.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers