Architecture
OpRelay is a three-lane coordination plane with a broker enforcing container-per-task isolation, a persistent fact/decision store as shared agent memory, and MCP as the universal interface.
System overview
┌─────────────────────────────────────────────────────┐
│ MCP Clients │
│ Claude Code · Codex · Cursor · Custom Agents │
└──────────────────────┬──────────────────────────────┘
│ MCP (SSE transport)
┌──────────────────────▼──────────────────────────────┐
│ OpRelay Runtime │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ Broker │ │ MCP │ │ Dashboard │ │
│ │ Engine │ │ Server │ │ (Operator UI) │ │
│ └────┬─────┘ └──────────┘ └──────────────────┘ │
│ │ │
│ ┌────▼─────────────────────────────────────────┐ │
│ │ PostgreSQL │ │
│ │ Facts · Decisions · Tasks · Runs · Audit │ │
│ └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘
Key principles
- MCP native — no SDK, no library. Any MCP client connects with one URL.
- Deterministic state — four primitives in Postgres. No embeddings required for coordination.
- Container isolation — every task execution gets a clean environment.
- Dual-lane — human speed for judgment, agent speed for execution.
- Event-driven — SSE notifications for real-time coordination. No polling.
Components
| Component | Responsibility |
|---|---|
| Broker | Task dispatch, lane routing, lock management, execution leases |
| MCP Server | Tool discovery, authentication, request routing |
| Fact Store | Operational memory — facts, decisions, context retrieval |
| Task Engine | Lifecycle management, advisory locks, dependencies |
| Run Tracker | Execution records, token usage, failure context |
| Dashboard | Real-time operator UI — timeline, agents, memory browser |