Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/monkopedia/rouse-context/relaygit clone --depth 1 https://github.com/Monkopedia/rouse-contextWhat 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 | $0.00023 | $0.00579 |
| Opus 5 | $0.00012 | $0.00290 |
| Sonnet 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 2d 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.
- 2d ago First seen · 57 lines · 23 tokens per session scan A cd4ff000746f
relay is an agent published in the GitHub repository Monkopedia/rouse-context (3 stars, last pushed 2d ago), licensed Apache-2.0. It adds 23 tokens to every session and 579 once invoked, about $0.0001 per session on Opus 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.
Other agents, from other repositories
mobile-developer
Cross-platform mobile development specialist for React Native and Flutter. Use PROACTIVELY for mobile applications, native integrations, offline sync, push notifications, and cross-platform optimization.
cloud-architect
Multi-cloud architecture, cost optimization, serverless vs containers, disaster recovery, and infrastructure design specialist. Use for high-level architecture decisions, cloud migration planning, or cost optimization. Trigger phrases: cloud, AWS, GCP, Azure, serverless, containers, Kubernetes, infrastructure, cost…
dependency-browser
Extracts a Maven dependency's JAR (or sources JAR) into the project build dir so you can browse its classes and source. Use when you need to explore the API or internals of a library. Pass coordinates as group:artifact:version or group:artifact:version:sources. Omit version to have it looked up from…
mobile-architect
Mobile architecture expert. Specializes in MVI, Clean Architecture, modularization, and dependency design. Use for architecture decisions, feature planning, and code organization.
kmp-architect
KMP architecture expert. Designs shared module structures, expect/actual patterns, navigation, and DI for Kotlin Multiplatform projects.
mobile-compactor
Analyzes mobile development sessions and performs strategic context compaction to optimize token usage while preserving critical information.