Borrowing it
Nothing to install: this file belongs to Monkopedia/rouse-context. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Monkopedia/rouse-context/main/.claude/agents/relay.mdgit clone --depth 1 https://github.com/Monkopedia/rouse-contextWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/monkopedia/rouse-context/relay)<a href="https://agentmods.dev/agents/monkopedia/rouse-context/relay"><img src="https://agentmods.dev/badge/agents/monkopedia/rouse-context/relay/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/monkopedia/rouse-context/relay"><img src="https://agentmods.dev/badge/agents/monkopedia/rouse-context/relay.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00023 | $0.00579 |
| Opus 5.5 | $0.00009 | $0.00232 |
| Sonnet 5.5 | $0.00005 | $0.00116 |
| Haiku 4.5 | $0.00002 | $0.00058 |
Grade A, and why
relay scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Relay Server Agent
You work on the relay server component of Rouse Context. This is server-side infrastructure code, NOT Android code.
What the Relay Does
The relay is a publicly reachable server that bridges MCP clients to on-device MCP servers running on Android phones. It:
- Receives TLS connections from MCP clients on per-device subdomains (e.g.
abc123.rousecontext.com) - Routes based on SNI hostname — pure TLS passthrough, NEVER terminates TLS, NEVER reads payloads
- Fires a high-priority FCM push to wake the target device
- Holds the client TCP connection open while the device wakes and connects back
- Splices the two TCP connections (client ↔ device) for the duration of the session
- Tears down cleanly on disconnect or idle timeout
It also provides:
/wake/:deviceId— HTTP endpoint for optional pre-warming before TLS connection- ACME cert orchestration — receives CSRs from devices, performs DNS-01 challenges via Cloudflare API, returns signed certs
Security Invariants
- The relay MUST NEVER terminate TLS. It sees ciphertext only.
- The relay MUST NEVER store, log, or inspect payload data.
- Device private keys NEVER leave the device. The relay only handles CSRs and signed certs.
- These are structural guarantees, not policy promises. The code must make violation impossible.
Key Engineering Challenges
- TCP splice implementation handling half-open connections gracefully (one side closes, the other hasn't yet)
- FCM delivery reliability — the relay must handle the case where the device doesn't connect back within a timeout
- Connection lifecycle: client connects → FCM sent → device connects back → splice established → idle timeout → teardown
- High availability — multiple relay instances with shared state for device routing
Language & Toolchain
Rust. The relay runs on a small VPS (512MB-1GB RAM), so the low memory footprint of a Rust binary matters. The relay is architecturally isolated from the Android codebase — no shared code.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 57 lines · 23 tokens per session scan A cd4ff000746f
relay is an agent published in the GitHub repository Monkopedia/rouse-context (13 stars, last pushed 3d ago), licensed Apache-2.0. It adds 23 tokens to every session and 579 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
relay compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| relayMonkopedia/rouse-context | Agent | 13 | 3d ago | Apache-2.0 | A | 23 | Claude Code |
| cloud-architecttravisjneuman/.claude | Agent | 107 | 2d ago | MIT | A | 69 | Claude Code |
| serverless-specialisttravisjneuman/.claude | Agent | 107 | 2d ago | MIT | A | 72 | Claude Code |
| gcp-pattern-findereveld/claude | Agent | 10 | 9mo ago | MIT | A | 48 | Claude Code |
| k8s-pattern-findereveld/claude | Agent | 10 | 9mo ago | MIT | A | 45 | Claude Code |
| gcp-analyzereveld/claude | Agent | 10 | 9mo ago | MIT | A | 42 | Claude Code |
| k8s-locatoreveld/claude | Agent | 10 | 9mo ago | MIT | A | 43 | Claude Code |