MCP HubMCP Hub
deepfates

mcp-replicate

by: deepfates

Model Context Protocol server for Replicate's API

49created 08/01/2025
Visit
API
Protocol

📌Overview

Purpose: To provide a seamless interface for running Replicate models using a Model Context Protocol (MCP) server implementation.

Overview: This framework enables users to quickly and efficiently run predictions with Replicate models through an intuitive tool-based interface, facilitating easy configuration and integration with various MCP clients.

Key Features:

  • Model Management: Allows users to search for models, browse collections, and access detailed information about different models and their versions.

  • Prediction Handling: Enables users to create, track, and cancel predictions, as well as listing recent prediction activities for better management.

  • Image Handling: Supports viewing and managing generated images directly from the browser, with functionality to optimize performance through image caching.


Replicate MCP Server

A Model Context Protocol server implementation for Replicate. Run Replicate models through a simple tool-based interface.

Quickstart

  1. Install the server:

    npm install -g mcp-replicate
    
  2. Get your Replicate API token:

    • Go to the Replicate API tokens page and create a new token if needed. Copy the token for the next step.
  3. Configure Claude Desktop:

    • Open Claude Desktop Settings.
    • Select the "Developer" section.
    • Click "Edit Config" and add the following configuration, replacing your_token_here with your actual Replicate API token:
    {
      "mcpServers": {
        "replicate": {
          "command": "mcp-replicate",
          "env": {
            "REPLICATE_API_TOKEN": "your_token_here"
          }
        }
      }
    }
    
  4. Start Claude Desktop. You should see a 🔨 hammer icon in the bottom right corner of new chat windows, indicating the tools are available.

Alternative Installation Methods

Install from source

git clone https://github.com/deepfates/mcp-replicate
cd mcp-replicate
npm install
npm run build
npm start

Run with npx

npx mcp-replicate

Features

Models

  • Search models using semantic search
  • Browse models and collections
  • Get detailed model information and versions

Predictions

  • Create predictions with text or structured input
  • Track prediction status
  • Cancel running predictions
  • List your recent predictions

Image Handling

  • View generated images in your browser
  • Manage image cache for better performance

Configuration

The server needs a Replicate API token to work. You can obtain one at Replicate.

Providing the Token

  1. In Claude Desktop Config (Recommended)

    • Add the token to your Claude Desktop configuration as shown above.
  2. As Environment Variable

    export REPLICATE_API_TOKEN=your_token_here
    

Available Tools

Model Tools

  • search_models: Find models using semantic search
  • list_models: Browse available models
  • get_model: Get details about a specific model
  • list_collections: Browse model collections
  • get_collection: Get details about a collection

Prediction Tools

  • create_prediction: Run a model with your inputs
  • get_prediction: Check a prediction's status
  • cancel_prediction: Stop a running prediction
  • list_predictions: See your recent predictions

Image Tools

  • view_image: Open an image in your browser
  • clear_image_cache: Clean up cached images
  • get_image_cache_stats: Check cache usage

Troubleshooting

Server Issues

  • Ensure Claude Desktop is correctly configured.
  • Verify your Replicate API token is set correctly.
  • Restart both the server and Claude Desktop if necessary.

Tool Functionality

  • Check the validity of your Replicate API token.
  • Ensure a stable internet connection.
  • Look for error messages in the server output.

Development

  1. Install dependencies:

    npm install
    
  2. Start development server (with auto-reload):

    npm run dev
    
  3. Check code style:

    npm run lint
    
  4. Format code:

    npm run format
    

Requirements

  • Node.js >= 18.0.0
  • TypeScript >= 5.0.0
  • Claude Desktop for using the tools

License

MIT