How gerred/mcp-server-replicate works
Key Components to Include:
Core Server Components
• Replicate Client component that interfaces with Replicate's API
• Server module (server.py) as the main entry point
Model Layer
• Collection Model
• Hardware Model
• Prediction Model
• Webhook Model
• Base Model class
Templates System
• Parameters Templates:
• Common Configs
• ControlNet
• LLaMA
• Stable Diffusion
• Prompts Templates:
• ControlNet
• Image-to-Image
• Text Generation
• Text-to-Image
Tools Layer
Utility components:
• Collection Tools
• Hardware Tools
• Model Tools
• Prediction Tools
• Webhook Tools
┌─────────────────────────────────────────────────────┐
• Client Applications │
• (Claude Desktop / Other Clients) │
• ┘
• ↕ HTTP/WebSocket
┌─────────────────────────────────────────────────────┐
• FastMCP Server │
• ┬────────────────┬─────────────────┤
• Template System│ Core Server │ Tools Layer │
• ┌───────────┐ │ ┌─────────┐ │ ┌───────────┐ │
• Parameters │ │ │ Server │ │ │Collection │ │
• TemplateS │──┼─▶│ Module │◀─┼──│ Tools │ │
• ┘ │ └─────────┘ │ └───────────┘ │
• ┌───────────┐ │ ┌─────────┐ │ ┌───────────┐ │
• Prompts │ │ │Replicate│ │ │ Model │ │
• Templates │──┼─▶│ Client │◀─┼──│ Tools │ │
• ┘ │ └─────────┘ │ └───────────┘ │
• ┴────────────────┴─────────────────┤
• Model Layer │
• Collection│Hardware│Prediction│Webhook│Base │
• ┘
• ↕ HTTP
┌─────────────────────────────────────────────────────┐
• Replicate API │
• ┘
• Use blue for core server components
• Green for template system
• Yellow for tools layer
• Purple for model layer
• Gray for external systems
Important Elements to Highlight:
Data Flow
• Bidirectional communication between client and server
• Webhook notifications flow
• Template processing flow
Integration Points
• Replicate API connection
• Client application interfaces
• Webhook endpoints
Key Features
• Resource-based image generation
• Real-time updates via subscriptions
• Template-driven configuration
• Model discovery and selection
Security Layer
• API key management
• Environment configuration
Remember to:
• Version information
• Technology stack annotations (Python 3.11+, FastMCP, etc.)
• Configuration dependencies (.env, smithery.yaml)