mcp -replicate
MCP implementation to generate content using models hosted on Replicate
claude mcp add --transport stdio tzafrir-mcp-server-replicate python server.py \ --env REPLICATE_API_TOKEN="your_token_here"
How to use
This MCP server provides a FastMCP-compatible interface to Replicate-hosted AI models. It currently focuses on image generation models, offering capabilities to inspect model schemas, generate images with customizable parameters, and handle output resizing and optimization. After starting the server, clients can query available models, explore their input schemas, and submit generation requests that return image outputs. The environment variable REPLICATE_API_TOKEN must be set to a valid Replicate API token to access the models. Use the server’s standard MCP endpoints to send requests and receive image results, with the same protocol and tooling you would use for other MCP services.
How to install
Prerequisites:
- Python 3.10+ installed on your system
- Internet access to fetch dependencies
Steps:
-
Clone or download the repository: git clone https://github.com/<your-org>/tzafrir-mcp-server-replicate.git cd tzafrir-mcp-server-replicate
-
Install Python dependencies: pip install -r requirements.txt
-
Acquire a Replicate API token:
- Sign up at replicate.com and generate an API token
- Save it as REPLICATE_API_TOKEN in your environment (see next step)
-
Configure environment variable:
- On Unix-like systems: export REPLICATE_API_TOKEN=your_token_here
- On Windows CMD: set REPLICATE_API_TOKEN=your_token_here
- Alternatively, you can place a .env file with: REPLICATE_API_TOKEN=your_token_here
-
Run the server: python server.py
-
Verify the server is running by checking logs and/or hitting the MCP endpoint the project exposes.
Additional notes
Notes and tips:
- The project is in early alpha; APIs and features may change. Monitor the repository for updates.
- Ensure your Replicate API token remains secret; never commit it to version control.
- If you encounter rate limits from Replicate, consider implementing caching of frequently requested models/images or introducing client-side rate limiting.
- If image generation parameters (e.g., width, height, guidance_scale) are not behaving as expected, consult the model schema via the inspection endpoint to confirm supported ranges.
- For debugging, enable verbose logs if available in the MCP runtime to capture request/response details with Replicate.
- Ensure the environment where the server runs has network access to communicate with Replicate’s API.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP