REPLICATE_MCP// Agent_Orchestration_Relay
REPLICATE_MCP_AGENTS v0.8.0
SYS_MANIFEST // MCP-NATIVE ORCHESTRATION

50,000 models.
One orchestrator.

replicate-mcp-agents routes every call across Replicate's model marketplace with bandit algorithms, isolates failures with circuit breakers, and speaks MCP natively — so Claude Desktop and Cursor invoke your agents with zero wiring.

00:00:00.000router online — strategy: thompson_multi
00:00:01.5003 workers healthy @ :7999
01 VALUE_PROPOSITION

Stop hand-picking models. Let the router learn.

Replicate hosts 50,000+ models. Choosing among them — and surviving their outages — is usually manual heuristics and brittle glue code. replicate-mcp-agents is a Python framework that turns model selection, failure handling, and agent serving into a production-grade, self-tuning layer.

RT_01

Cost-aware bandit routing. UCB1 explores systematically for the first 20 calls, then Thompson Sampling exploits — scalarizing cost, latency, and quality into one utility. For teams running 10k+ invocations a day, cost-aware selection alone can cut inference spend by 20–40%.

RS_02

Per-model failure isolation. A three-state circuit breaker (CLOSED → OPEN → HALF_OPEN) wraps every model, with decorrelated-jitter retries. One flaky model never cascades into the rest of your pipeline.

MC_03

MCP-native, not HTTP-first. Every registered agent is automatically an MCP tool over stdio, SSE, or Streamable HTTP. Claude Desktop, Cursor, and any MCP client call your Replicate agents with zero additional wiring.

DX_04

A fluent SDK that stays out of the way. Register an agent with one decorator, compose DAG workflows with parallel fan-out in a builder, run them from the CLI.

agents.py — declarative registration SYNCED
# pip install replicate-mcp-agents
from replicate_mcp import agent, CostAwareRouter

@agent(
    model="meta/meta-llama-3-8b-instruct",
    description="Fast chat for general queries",
    tags=["chat", "fast"],
)
def llama_chat(prompt: str) -> dict:
    return {"prompt": prompt}

# the router learns from every outcome
router = CostAwareRouter(strategy="thompson_multi")
chosen = router.select_model(candidates)
router.record_outcome(chosen,
    latency_ms=812, cost_usd=0.002, success=True)
1,150Tests_Passed
~90%Line_Coverage
33Typed_Modules
<200msP95_Overhead_SLO
STRICTMypy_Mode
APACHE-2.0License
02 CAPABILITY_MATRIX

The full production layer, in the box.

Fifteen stable subsystems ship in v0.8.0. These six carry the weight.

03 DIAGNOSTICS_FEED

Observable by default.

Every invocation emits OpenTelemetry spans and metrics — invocation.count, latency and cost histograms, circuit-breaker trips — plus structured audit records you can tail from the CLI. Published SLOs put numbers on it: 99.5% availability, <1% error rate, ≤90 s breaker recovery.

Inspect_Runbook
04 ECOSYSTEM_LINKS

Plays its position in your stack.

SYNCHRONIZED Claude Desktop

Register the stdio server in mcp_config.json — agents appear in the tool palette.

SYNCHRONIZED Cursor

Same MCP server, same zero wiring — invoke Replicate agents from your editor.

SYNCHRONIZED Replicate API

Model discovery auto-registers from the 50,000+ model marketplace, with version pinning.

SYNCHRONIZED OpenTelemetry

Spans + metrics over OTLP gRPC; null-safe when the SDK is absent. Optional extra.

SYNCHRONIZED Latitude

Prompt management, tracing, and evaluations via LatitudePlugin — zero-config from env vars.