MCP Server Replicate
MCP 服务器复制
Replicate API 的 FastMCP 服务器实现,提供基于资源的 AI 模型推理访问,重点是图像生成。
特征
🖼️基于资源的图像生成和管理
🔄 通过订阅实时更新
📝 模板驱动的参数配置
🔍 全面的模型发现和选择
🪝 用于外部通知的 Webhook 集成
🎨 质量和样式预设,以获得最佳效果
📊 进度跟踪和状态监控
🔒 安全的 API 密钥管理
Related MCP server: MCP Server for Replicate
可用提示
服务器针对不同的任务提供了几个专门的提示:
文本转图像(主要)
我们最全面测试过、功能最强大的提示。针对从文本描述生成高质量图像进行了优化,具有以下功能:
详细的样式控制
质量预设(草稿、平衡、质量、极端)
尺寸和纵横比自定义
进度跟踪和实时更新
例子:
Create a photorealistic mountain landscape at sunset with snow-capped peaks, quality level: quality, style: photorealistic其他提示
图像到图像:转换现有图像(即将推出)
模型选择:获得帮助,为您的任务选择合适的模型
参数帮助:了解和配置模型参数
先决条件
Python 3.11 或更高版本
复制 API 密钥(在https://replicate.com/account获取)
UV用于依赖管理
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 MCP Server Replicate:
npx -y @smithery/cli install @gerred/mcp-server-replicate --client claude手动安装
您可以直接从 PyPI 安装该包:
# Using UV (recommended)
uv pip install mcp-server-replicate
# Using UVX for isolated environments
uvx install mcp-server-replicate
# Using pip
pip install mcp-server-replicateClaude 桌面集成
确保您安装了最新版本的 Claude Desktop
打开您的 Claude Desktop 配置:
# macOS
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
# Windows
code %APPDATA%\Claude\claude_desktop_config.json使用以下选项之一添加服务器配置:
{
"globalShortcut": "Shift+Alt+A",
"mcpServers": {
"replicate": {
"command": "uv",
"args": ["tool", "run", "mcp-server-replicate"],
"env": {
"REPLICATE_API_TOKEN": "APITOKEN"
},
"cwd": "$PATH_TO_REPO"
}
}
}设置您的复制 API 密钥:
# Option 1: Set in your environment
export REPLICATE_API_TOKEN=your_api_key_here
# Option 2: Create a .env file in your home directory
echo "REPLICATE_API_TOKEN=your_api_key_here" > ~/.env完全重启Claude Desktop
您现在应该在 Claude Desktop 中看到 🔨 图标,表示 MCP 服务器可用。
用法
一旦连接到 Claude Desktop,您可以:
用自然语言生成图像:
Create a photorealistic mountain landscape at sunset with snow-capped peaks浏览你的世代:
Show me my recent image generations按世代搜索:
Find my landscape generations检查生成状态:
What's the status of my last generation?
故障排除
服务器未显示在 Claude Desktop 中
检查 Claude Desktop 日志:
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log验证您的配置:
确保
claude_desktop_config.json中的路径是绝对路径确保 UV 已安装并位于您的 PATH 中
检查您的复制 API 密钥是否已设置
尝试重启 Claude Desktop
有关更详细的故障排除,请参阅我们的调试指南。
文档
发展
克隆存储库:
git clone https://github.com/gerred/mcp-server-replicate.git
cd mcp-server-replicate安装开发依赖项:
uv pip install --system ".[dev]"安装预提交钩子:
pre-commit install运行测试:
pytest贡献
欢迎大家贡献!详情请参阅我们的贡献指南。
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
Available Tools
18 toolscancel_predictionC
Cancel a running prediction.
Inputs: prediction_id (required).
create_predictionC
Create a new prediction using a specific model version on Replicate.
Args:
input: Model input parameters including version or model details
confirmed: Whether the user has explicitly confirmed the generation
Returns:
Prediction details if confirmed, or a confirmation request if not
Inputs: input (required), confirmed.
generate_imageC
Generate an image using the specified parameters.
Inputs: prompt (required), style, quality, width, +3 more.
get_collection_detailsC
Get detailed information about a specific collection.
Inputs: collection_slug (required).
get_model_detailsC
Get detailed information about a specific model.
Args:
model_id: Model identifier in format owner/name
Returns:
Detailed model information
Inputs: model_id (required).
get_predictionC
Get the status and results of a prediction.
Inputs: prediction_id (required), wait, max_retries.
get_webhook_secretA
Get the signing secret for verifying webhook requests.
Inputs: no named parameters.
list_collectionsB
List available model collections on Replicate.
Inputs: no named parameters.
list_hardwareB
List available hardware options for running models.
Inputs: no named parameters.
list_modelsC
List available models on Replicate with optional filtering by owner.
Inputs: owner.
list_templatesB
List all available templates with their schemas.
Inputs: no named parameters.
open_image_with_systemB
Open an image URL with the system's default application.
Args:
image_url: URL of the image to open
Returns:
Dict containing status of the operation
Inputs: image_url (required).
search_available_modelsB
Search for available models matching the query.
Args:
query: Search query describing the desired model
style: Optional style to filter by
Returns:
List of matching models with scores
Inputs: query (required), style.
search_modelsC
Search for models using semantic search.
Inputs: query (required).
subscribe_to_generationD
Handle resource subscription requests.
Inputs: request (required).
unsubscribe_from_generationC
Handle resource unsubscribe requests.
Inputs: request (required).
validate_template_parametersC
Validate parameters against a template schema.
Inputs: input (required).
verify_webhookA
Verify that a webhook request came from Replicate using HMAC-SHA256.
Args:
payload: The webhook payload to verify
signature: The signature from the X-Replicate-Signature header
secret: The webhook signing secret from get_webhook_secret
Returns:
True if signature is valid, False otherwise
Inputs: payload (required), signature (required), secret (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Most tools have distinct purposes, but there is some overlap between 'search_available_models' and 'search_models' that could cause confusion, as both involve searching for models. The descriptions help differentiate them slightly, but the boundaries are not entirely clear.
Tool names follow a consistent snake_case pattern with clear verb_noun structures throughout, such as 'create_prediction', 'get_model_details', and 'list_collections'. There are no deviations in naming conventions, making the set predictable and readable.
With 18 tools, the count is borderline high for a server focused on Replicate's AI model platform. While it covers various aspects like predictions, models, and webhooks, it may feel slightly heavy and could benefit from consolidation to reduce complexity.
The tool set provides good coverage for the Replicate domain, including prediction lifecycle (create, get, cancel), model discovery (list, get, search), and webhook management. Minor gaps exist, such as missing tools for updating or deleting predictions or models, but agents can work around these with the available operations.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for Flux AI image generation
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables users to generate images from text prompts using Replicate's model, with configurable parameters and full MCP protocol compliance.1121ISC
- AlicenseNot gradedqualityDmaintenanceA FastMCP server implementation that provides a standardized interface for accessing AI models hosted on Replicate's API, currently supporting image generation with customizable parameters.3MIT
- AlicenseNot gradedqualityDmaintenanceA server that enables generating images through the Replicate API by calling the Flux Schnell model via the Model Context Protocol (MCP).2MIT
- AlicenseAqualityDmaintenanceMCP server for multi-provider AI image generation (AWS Bedrock, OpenAI, Google Gemini) enabling image generation, transformation, and editing through a unified interface.41MIT