mcp-replicate-hosted (Repo)
Source-Pfad: ~/source/mcps/mcp-replicate-hosted/ — gebaut 2026-05-19 als Phase 2 von 2026-05-19-design-stack-julian.
Stack
- Python 3.12+,
uv sync --all-extras,pyproject.toml+hatchling - FastMCP v2 (Prefect-Fork) —
ScalekitProvider,create_proxy, Middleware - pydantic-settings typed ENV
- AWS CDK in
infra/(TypeScript, identisches Pattern zumcp-vf-hosted/infra) - Sub-MCP: mcp-replicate via editable install + stdio-Subprocess
Module
| File | Was es macht |
|---|---|
src/mcp_replicate_hosted/main.py | FastMCP-App, GuardMiddleware, ToolWhitelistMiddleware, Layer-Tools, sub-MCP-Proxy |
src/mcp_replicate_hosted/settings.py | Pydantic-Settings, typed ENV |
src/mcp_replicate_hosted/ratelimit.py | 1:1 von mcp-vf-hosted portiert — Token-Bucket pro Subject |
src/mcp_replicate_hosted/audit.py | 1:1 von mcp-vf-hosted portiert — JSON + PIIScrubFilter |
src/mcp_replicate_hosted/config.py | Modell-Whitelist + USE_CASE_DEFAULTS, Source of Truth |
src/mcp_replicate_hosted/brand_lock.py | VF-Brand-Snippet + Negative-Prompt-Hints, prepend-Logik |
src/mcp_replicate_hosted/prompts.py | Slash-Prompts /speaker_card, /save_the_date, /social_post mit Anti-Prompt-Injection-Sanitizer |
Dockerfile | linux/amd64, python:3.12-slim, uv, non-root user, baut mcp-replicate als sibling |
infra/lib/mcp-replicate-hosted-stack.ts | CDK Fargate + cloudflared-Sidecar + CloudWatch-Dashboard |
tests/ | 39 Tests: audit, brand-lock, model-whitelist, prompts, ratelimit, settings |
Tools (exposed)
| Tool | Was es macht |
|---|---|
create_image | Default Flux 2 Pro, Brand-Lock-Injection, Foto-Real |
create_text_image | Ideogram V3 Quality, Speaker-Cards / Poster mit Text |
create_svg_logo | Recraft V4 SVG, echtes Vektor-File zurueck |
create_image_from_reference | Flux Kontext Pro, Variante eines bestehenden Bilds |
create_video | Default Kling 2.5 Turbo Pro, optional Veo 3 / Seedance / Wan |
search_tools | Discovery der versteckten 25+ raw replicate_*-Tools |
replicate_* (Lifecycle) | get_prediction, wait_for_prediction, cancel_prediction, list_predictions |
Bauen + Testen
cd ~/source/mcps/mcp-replicate-hosted
uv sync --all-extras
uv run pytest # 39 Tests
uv run ruff check src/ tests/
# Build-Smoke
SCALEKIT_ENV_URL=https://x.eu.scalekit.dev SCALEKIT_RESOURCE_ID=res_x \
PUBLIC_BASE_URL=https://x.example REPLICATE_API_TOKEN=r8_test \
uv run python -c "from mcp_replicate_hosted.main import build_app; print(build_app().name)"Deploy auf AWS
Siehe README.md. Voraussetzungen:
- ECR-Repo
mcp-replicate-hostedin av-production (angelegt 2026-05-19) - Secrets Manager:
mcp-replicate-hosted/upstream-tokens+/cloudflared-token - Cloudflare-Tunnel mit Ingress
- Scalekit-Resource in EU-Region
- DNS-Record
Editable Install fuer lokale Tests
Aktuell NICHT in ~/.claude/ registriert — laeuft nicht lokal als stdio-MCP, sondern nur in der Container-Deployment-Form. Wenn lokal-debug-Bedarf: uv run python -m mcp_replicate_hosted.main (Port 8080).
Related
- Capability: mcp-replicate-hosted
- Vorbild-Stack-Repo: mcp-vf-hosted
- Sub-MCP-Source: mcp-replicate
- Plan: 2026-05-19-design-stack-julian
- Run-Log: _index