MCP server for Replicate ML inference
## Replicate MCP Server: Run ML Models in the Cloud The **Replicate MCP Server** integrates Replicate's model hosting platform into Google Antigravity. This platform makes it simple to run open-source ML models without managing infrastructure, offering thousands of models ready to use via API. ### Why Replicate MCP? Replicate democratizes ML model access: - **Thousands of Models**: Image, audio, video, text - **No Infrastructure**: Models run in the cloud - **Pay Per Use**: Only pay for compute time - **Version Control**: Track model versions - **Custom Models**: Deploy your own models ### Key Features #### 1. Run Models ```python import replicate # Run image generation model output = replicate.run( "stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b", input={ "prompt": "A futuristic city with flying cars", "width": 1024, "height": 1024 } ) print(output) # Returns URL to generated image ``` #### 2. Streaming Output ```python # Stream responses for LLMs for event in replicate.stream( "meta/llama-2-70b-chat", input={"prompt": "Explain quantum computing"} ): print(str(event), end="") ``` #### 3. Custom Deployments ```python # Create a deployment for consistent performance deployment = replicate.deployments.create( name="my-sdxl", model="stability-ai/sdxl", hardware="gpu-a40-large", min_instances=1, max_instances=5 ) # Run on deployment prediction = deployment.predictions.create( input={"prompt": "A beautiful sunset"} ) ``` ### Configuration ```json { "mcpServers": { "replicate": { "command": "npx", "args": ["-y", "@anthropic/mcp-replicate"], "env": { "REPLICATE_API_TOKEN": "r8_your_token" } } } } ``` ### Use Cases **Image Generation**: Run Stable Diffusion, SDXL, and other image models. **Audio Processing**: Transcribe with Whisper, generate music with MusicGen. **Video Generation**: Create videos with cutting-edge video models. The Replicate MCP Server brings thousands of ML models to Antigravity.
{
"mcpServers": {
"replicate": {
"mcpServers": {
"replicate": {
"env": {
"REPLICATE_API_TOKEN": "YOUR_REPLICATE_TOKEN"
},
"args": [
"-y",
"replicate-mcp"
],
"command": "npx"
}
}
}
}
}