Files
lg-smtv-mcp/docs/adr/0001-streamable-http-daemon-with-stdio-fallback.md
T
kiskaadee 1ab5246fbf
Core Architecture & Invariant CI / validate (push) Successful in 15s
docs: reconcile M1 architecture, roadmap, ADRs, and design spec
- Add ARCHITECTURE.md documenting canonical present-state M1 topology, components, boundaries, and ADR index
- Add ROADMAP.md recording M1 (#1-#4) completion and M2 (#5, #11) trajectory
- Extract Alternatives A-E from docs/designs/lg-smtv-mcp.md into docs/adr/0001-0005 MADR records
- Update README.md milestone status (#1-#4 merged on main, #5/#11 in M2) and Documentation links
- Reconcile docs/designs/lg-smtv-mcp.md module statuses, FrameCapturer seam, and KeysResult/TextResult.image_bytes
2026-11-16 13:52:16 -05:00

1.4 KiB
Raw Blame History

ADR-0001: Streamable HTTP Daemon with Stdio Fallback

  • Status: Accepted
  • Date: 2026-11-15
  • Deciders: kiskaadee

Context and Problem Statement

One-shot CLI scripts against an LG webOS TV incur ~8–10s per step in repeated wss://:3001 TLS + register handshakes, getPointerInputSocket acquisition, and SSH setup, and cannot maintain subscribe state streams across tool calls.

Decision Outcome

Chosen option: "Run lg-smtv-mcp primarily as a persistent streamable-http ASGI daemon (with stdio supported for local test harnesses)", because a long-lived daemon keeps SSAP, subscribe state, and pointer/capture sessions warm while BearerAuthMiddleware and TransportSecuritySettings secure LAN access.

Consequences

  • Positive: Eliminates per-step TLS/SSAP handshake overhead, preserves subscribe cache (volume, muted, sound_output, foreground_app), and serializes ui_lock across concurrent calls.
  • Negative: Requires MCP_BEARER_TOKEN configuration and daemon lifecycle management (serve / SIGHUP) when deployed over HTTP.

Alternatives Considered

  • Single-process stdio per client only: Rejected because each client session spawns a fresh process, repeating handshakes and contending for the TV's single pointer socket.