MCP HubMCP Hub
gerred

mcp-server-replicate

by: gerred

mcp server replicate

11created 05/01/2025
Visit
replicate

📌Overview

Purpose: To provide a FastMCP server implementation for the Replicate API that enables resource-based access to AI model inference, specifically focused on image generation.

Overview: MCP Server Replicate offers a robust solution for generating and managing images using AI models. It streamlines user interaction with various model parameters, supports real-time updates, and allows for dynamic image generation through natural language processing.

Key Features:

  • Resource-based image generation and management: Facilitates efficient creation and organization of images derived from user prompts.

  • Real-time updates through subscriptions: Keeps users informed about the status of their image generation requests.

  • Template-driven parameter configuration: Simplifies the customization of image generation settings, allowing users to tailor outputs to specific needs.

  • Webhook integration for external notifications: Enables seamless interaction with external systems by providing notification capabilities.

  • Quality and style presets: Offers various options for image quality and style, ensuring optimal generation results.

  • Comprehensive model discovery and selection: Assists users in finding the most suitable AI models for their tasks through an intuitive interface.

  • Progress tracking and status monitoring: Allows users to monitor the progress of their image generation in real time.

  • Secure API key management: Ensures safe handling of API keys necessary for interactions with the Replicate platform.


MCP Server Replicate

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

Available Prompts

Text to Image (Primary)

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

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

Installing Manually

# 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. Ensure 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
    
  3. Add server configuration:

    {
      "globalShortcut": "Shift+Alt+A",
      "mcpServers": {
        "replicate": {
          "command": "uv",
          "args": ["tool", "run", "mcp-server-replicate"],
          "env": {
            "REPLICATE_API_TOKEN": "APITOKEN"
          },
          "cwd": "$PATH_TO_REPO"
        }
      }
    }
    
  4. 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
    
  5. Restart Claude Desktop completely.

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
    
  2. Verify your configuration:

    • Ensure the path in claude_desktop_config.json is absolute
    • Ensure UV is installed and in your PATH
    • Confirm your Replicate API key is set
  3. Try restarting Claude Desktop.

For more detailed troubleshooting, see our 1.

Documentation

  • 1
  • 1
  • 1
  • 1
  • 1

Development

  1. Clone the repository:

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

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

    pre-commit install
    
  4. Run tests:

    pytest
    

Contributing

We welcome contributions! Please see our 1 for details.

License

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