Replicate MCP server

Bridges Replicate's AI model hosting platform, enabling seamless interaction with diverse machine learning models for tasks like image generation and text processing.
Back to servers
Setup instructions
Provider
Max Woolf
Release date
Jan 08, 2025
Language
TypeScript
Stats
72 stars

The Replicate MCP Server is an implementation of the Model Context Protocol that allows you to interact with Replicate's AI models through a simple tool-based interface. It enables running Replicate models directly from compatible clients like Claude Desktop, Cursor, Cline, or Continue.

Installation

Quick Installation

Install the server globally using npm:

npm install -g mcp-replicate

Alternative Installation Methods

Using npx (no installation required):

npx mcp-replicate

Installing from source:

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

Configuration

The server requires a Replicate API token to function properly.

Getting Your API Token

  1. Go to the Replicate API tokens page
  2. Create a new token if you don't have one
  3. Copy the token for configuration

Setting Up Your API Token

You can provide your API token in two ways:

Option 1: Configure in Claude Desktop (Recommended)

  1. Open Claude Desktop Settings (⌘,)
  2. Select the "Developer" section in the sidebar
  3. Click "Edit Config" to open the configuration file
  4. Add the following configuration:
{
  "mcpServers": {
    "replicate": {
      "command": "mcp-replicate",
      "env": {
        "REPLICATE_API_TOKEN": "your_token_here"
      }
    }
  }
}

Option 2: Set as Environment Variable

For other MCP clients, set an environment variable:

export REPLICATE_API_TOKEN=your_token_here

Using the MCP Server

After installation and configuration, start Claude Desktop. You should see a 🔨 hammer icon in the bottom right corner of new chat windows, indicating the tools are available.

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 specific collection

Prediction Tools

  • create_prediction: Run a model with your inputs
  • create_and_poll_prediction: Run a model with your inputs and wait until it's completed
  • 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 is Running but Tools Aren't Showing Up

  1. Verify that Claude Desktop is properly configured with the MCP server settings
  2. Ensure your Replicate API token is set correctly
  3. Try restarting both the server and Claude Desktop
  4. Check the server logs for any error messages

Tools are Visible but Not Working

  1. Verify your Replicate API token is valid
  2. Check your internet connection
  3. Look for any error messages in the server output

System Requirements

  • Node.js >= 18.0.0
  • TypeScript >= 5.0.0
  • A compatible MCP client like Claude Desktop

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "replicate" '{"command":"mcp-replicate","env":{"REPLICATE_API_TOKEN":"your_token_here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "replicate": {
            "command": "mcp-replicate",
            "env": {
                "REPLICATE_API_TOKEN": "your_token_here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "replicate": {
            "command": "mcp-replicate",
            "env": {
                "REPLICATE_API_TOKEN": "your_token_here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later