Command Palette

Search for a command to run...

Home / Servers

relay

by future-beat

Relay

CI

Live demo: https://relay-agent.fly.dev — the root redirects to a dashboard of real agent runs (cost, latency, outcomes).

An AI support-triage agent, built as a production service — not a notebook.

Relay receives support tickets for a fictional SaaS product (Lanekeep) over a REST API and works each one autonomously: it looks the customer up in a real database, classifies the ticket, searches the product documentation so every claim is grounded, and either sends a resolved reply or escalates to a human with a structured handover — streaming its reasoning steps to the client as server-sent events the whole way.

The agent loop is written by hand on the Claude API (no orchestration framework), so the control flow, step caps, and event stream are fully visible and testable.

Status / roadmap

  • Phase 1 — Core agent service: FastAPI + SSE, hand-written agent loop, tools (lookup_customer, search_docs, set_category, send_reply, create_escalation), SQLite with seed data, keyword doc search
  • Phase 2 — Guardrails: Pydantic-validated tool inputs, per-run cost budget with hard abort, write-tool policy (?dry_run=true), structured error events on API failure, per-step usage events with running cost
  • Phase 3 — Evaluation harness: 12-ticket golden dataset, deterministic action/category grading plus LLM-as-judge grounding checks, JSON report artifact, threshold exit code for CI (python -m relay.evals)
  • Phase 4 — Observability: JSON structured logs, OpenTelemetry spans per run/model-call/tool (OTLP export via OTEL_EXPORTER_OTLP_ENDPOINT), per-run metrics in SQLite, /metrics aggregates, /dashboard page
  • Phase 5 — MCP server: the same tool registry (plus ticket lifecycle tools) served over the Model Context Protocol via stdio, behind the same validation and write-policy guardrails
  • Phase 6 — Ship it: Dockerfile with container healthcheck, GitHub Actions CI (lint + tests + Docker smoke test on every push; on-demand eval workflow with report artifact), Fly.io deploy config

See docs/PROJECT_BRIEF.md for the full project definition.

Quick start

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

cp .env.example .env   # add your ANTHROPIC_API_KEY

uvicorn relay.main:app --reload

Then, in another terminal:

./scripts/demo.sh

You'll see the agent's run streamed as SSE — text updates, each tool call and its result, and a final resolution event.

API

MethodPathDescription
GET/healthLiveness + configured model
POST/ticketsCreate a ticket
GET/tickets/{id}Fetch a ticket
POST/tickets/{id}/processRun the agent; streams steps as SSE. ?dry_run=true denies write tools by policy
GET/metricsRun counts, outcomes, token/cost totals, latency p50/p95
GET/dashboardMinimal live dashboard over /metrics

MCP server

The same tools are exposed over the Model Context Protocol, so Claude Desktop, Claude Code, or any MCP client can drive Relay directly:

claude mcp add relay -- /path/to/.venv/bin/python -m relay.mcp_server

Related servers

n8n

Updated today

by n8n-io

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

199,260

mcp-server-git

OfficialUpdated today

by modelcontextprotocol

A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs

89,176

mcp-server-fetch

OfficialUpdated today

by modelcontextprotocol

A Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

89,176

@modelcontextprotocol/server-everything

OfficialUpdated today

by modelcontextprotocol

MCP server that exercises all the features of the MCP protocol

89,176