Replicate MCP Server: Model Search, Predictions, Images
Manage models on an MCP server: search, run, and track Replicate predictions, browse models, and handle generated images via a simple tool-based interface.
npx -y @deepfates/mcp-replicateOverview
Replicate MCP Server is a lightweight Model Context Protocol (MCP) adapter that exposes Replicate models and predictions through a simple tool-oriented interface. It lets developer agents and tool consumers search available models, start and monitor predictions, and manage generated media (images) in a consistent, programmatic way. The server acts as a bridge between an MCP-enabled orchestrator (or any HTTP client) and the Replicate API, capturing prediction metadata and media artifacts for later inspection and reuse.
This project is useful when you want to integrate image-generation or other model capabilities from Replicate into multi-tool workflows, agents, or production pipelines without embedding Replicate calls directly into your codebase. By centralizing model discovery, prediction execution, status tracking, and media storage, the server simplifies orchestration, debugging, and auditing of model-driven tasks.
Features
- Search and browse Replicate models by name, tag, or description.
- Run predictions on selected models with arbitrary input payloads.
- Track prediction status, outputs, and logs via unique prediction IDs.
- Persist and serve generated images and other media artifacts.
- Simple MCP-compatible tool interface for agent integration.
- Optional local storage for media with API endpoints for listing and downloading.
- Lightweight, container-friendly deployment (Docker/standalone).
Installation / Configuration
Prerequisites:
- Python 3.10+ (if running locally) or Docker
- A Replicate API token (set as environment variable)
Clone and install (local / development):
Environment variables (example .env):
REPLICATE_API_TOKEN=your_replicate_token_here
MCP_BIND_ADDRESS=
MCP_PORT=8080
MEDIA_STORAGE_PATH=./mediaDB_URL=SERVER_API_KEY=optional_server_api_key
Run with Docker:
Or use docker-compose (example):
version: "3.8"
services:
mcp-replicate:
image: deepfates/mcp-replicate:latest
environment:
- REPLICATE_API_TOKEN=${REPLICATE_API_TOKEN}
- MCP_PORT=8080
ports:
- "8080:8080"
volumes:
- ./media:/app/media
Available Tools / Resources
The server exposes a set of MCP-style tools and HTTP endpoints to interact with Replicate resources. Names are illustrative; check the running server’s /tools endpoint for exact identifiers.
Tool summary:
- replicate_search — Find models by query, tag, or author.
- replicate_list_models — Browse models with pagination.
- replicate_predict — Start a prediction on a model with inputs.
- replicate_get_prediction — Retrieve prediction state and outputs.
- replicate_list_predictions — List stored predictions for auditing.
- replicate_list_images — List generated images and metadata.
- replicate_get_image — Download a specific media artifact.
HTTP endpoint examples (common paths):
| Endpoint | Method | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| /tools | GET | List available MCP tools | |||||||||||||||
/tools/| POST | Execute an MCP tool (search/predict/etc.) | /models/search | POST | Search Replicate models (JSON query) | /predictions | POST | Create a prediction | /predictions/{id} | GET | Get prediction status and outputs | /media | GET | List generated media | /media/{filename} | GET | Download media file | Use Cases
When the prediction completes, the server will persist any image outputs in MEDIA_STORAGE_PATH and include file URLs in the prediction metadata.
Tips and Notes
|