Replicate MCP Server

Replicate MCP Server

A Model Context Protocol server implementation for Replicate. This server provides access to Replicate's models and predictions through a simple tool-based interface.

Features

Model Management

  • Search models by query
  • List models with optional owner filter
  • Get model details and versions

Prediction Handling

  • Create predictions with string or object input
  • Check prediction status
  • Cancel running predictions
  • List recent predictions

Image Tools

  • View images in system browser
  • Save images to local filesystem

Examples

Search Models

const results = await client.callTool("search_models", { query: "text to image models" });

Create Prediction

const prediction = await client.callTool("create_prediction", { version: "model_version_id", input: "Your text prompt here" // Automatically wrapped in {text: string} });

Check Prediction Status

const status = await client.callTool("get_prediction", { prediction_id: "prediction_id" });

Installation

npm install

Configuration

The server requires a Replicate API token. You can set it in one of two ways:

  1. Environment variable:
export REPLICATE_API_TOKEN=your_token_here
  1. Pass it directly when creating the client:
const client = new ReplicateClient("your_token_here");

Usage

  1. Build the TypeScript code:
npm run build
  1. Start the server:
npm start

The server communicates via stdio using the MCP protocol. You can use any MCP client to interact with it.

Development

  1. Install dependencies:
npm install
  1. Start the development server (with auto-reload):
npm run dev
  1. Lint the code:
npm run lint
  1. Format the code:
npm run format

Available Tools

Model Tools

  • search_models: Search for models using semantic search
  • list_models: List available models with optional filtering
  • get_model: Get details of a specific model including versions

Prediction Tools

  • create_prediction: Create a new prediction using a model version
  • cancel_prediction: Cancel a running prediction
  • get_prediction: Get details about a specific prediction
  • list_predictions: List recent predictions

Image Tools

  • view_image: Display an image in the system's default web browser
  • save_image: Save an image to the local filesystem

Requirements

  • Node.js >= 18.0.0
  • TypeScript >= 5.0.0

License

MIT

A
security – no known vulnerabilities (report Issue)
F
license - not found
A
quality - confirmed to work

Enables users to access and manage Replicate's AI models and predictions via the Model Context Protocol, offering tools for creating, canceling, and retrieving model predictions and parameters.

  1. Features
    1. Model Management
      1. Prediction Handling
        1. Image Tools
        2. Examples
          1. Search Models
            1. Create Prediction
              1. Check Prediction Status
              2. Installation
                1. Configuration
                  1. Usage
                    1. Development
                      1. Available Tools
                        1. Model Tools
                          1. Prediction Tools
                            1. Image Tools
                            2. Requirements
                              1. License