Author SHA1 Message Date
kiskaadee edc9a58cbf fix(deploy): correct pairing command and document remote-access env requirements
Core Architecture & Invariant CI / validate (pull_request) Successful in 15s
- README.md: replace 'lg-smtv-mcp pair --fetch-ssh-key' with
  'python -m lg_smtv_mcp pair --fetch-ssh-key' — the console script
  is not on PATH inside nix develop; the unit's ExecStart uses the
  same python -m invocation (CR-01)
- README.md: extend remote-access note to document that HOST and
  ALLOWED_HOSTS=<proxy-or-vpn-hostname> must both be set when
  exposing the server remotely; the DNS-rebinding check in auth.py
  rejects Host headers not in the allowlist (CR-04)
2026-11-17 01:54:13 -05:00
kiskaadee bf13d3914b docs(readme): state M2 delivery status instead of open deployment work
Core Architecture & Invariant CI / validate (pull_request) Successful in 16s
- README.md: flip the status banner headline and body from "M2 in
  progress - capture delivered" / "remaining M2 work is #13" to M2
  delivered, because this change adds the systemd unit and deployment
  documentation that #13 tracks.
- README.md: update the M2 milestone row from "#13 open" to delivered,
  recording #12, #11, and #13 as complete.
- README.md: point the outstanding work at #17 (unit sandboxing
  hardening) rather than #13, so the banner no longer describes the
  change it ships as still pending.

ROADMAP.md and docs/designs/lg-smtv-mcp.md still describe #13 as active
and are intentionally left to the post-merge documentation reconcile,
matching how the #12 delivery was reconciled after PR #15 merged.
2026-11-16 23:45:50 -05:00
+5 -5
View File
@@ -6,8 +6,8 @@ A Python Model Context Protocol (MCP) server for persistent, local-network contr
The server is deliberately **LLM-free**: it exposes bounded, deterministic operations so external AI agents (such as Antigravity, Claude, or a vision-guided decision loop) can reason over UI state and control the television without embedding model APIs into the daemon. The server is deliberately **LLM-free**: it exposes bounded, deterministic operations so external AI agents (such as Antigravity, Claude, or a vision-guided decision loop) can reason over UI state and control the television without embedding model APIs into the daemon.
> **Status: M2 in progress — capture delivered.** > **Status: M2 delivered — capture, E2E hardening, and `systemd` deployment.**
> Configuration validation, error taxonomy, [`tv_core`](src/lg_smtv_mcp/tv_core/) (SSAP multiplexer, `PointerClient`, `TvManager`), FastMCP server & Bearer auth ([`server.py`](src/lg_smtv_mcp/server.py), [`auth.py`](src/lg_smtv_mcp/auth.py)), `pair` / `serve` CLI ([`cli.py`](src/lg_smtv_mcp/cli.py)), full-stack offline E2E verification ([`test_e2e_mvp.py`](tests/test_e2e_mvp.py)), and Developer Mode SFTP screenshot capture ([`capture.py`](src/lg_smtv_mcp/tv_core/capture.py)) are implemented and tested. The remaining M2 work is the `systemd` unit and deployment documentation ([#13](https://gitea.roadtotech.me/kiskaadee/lg-smtv-mcp/issues/13)). > Configuration validation, error taxonomy, [`tv_core`](src/lg_smtv_mcp/tv_core/) (SSAP multiplexer, `PointerClient`, `TvManager`), FastMCP server & Bearer auth ([`server.py`](src/lg_smtv_mcp/server.py), [`auth.py`](src/lg_smtv_mcp/auth.py)), `pair` / `serve` CLI ([`cli.py`](src/lg_smtv_mcp/cli.py)), full-stack offline E2E verification ([`test_e2e_mvp.py`](tests/test_e2e_mvp.py)), and Developer Mode SFTP screenshot capture ([`capture.py`](src/lg_smtv_mcp/tv_core/capture.py)) are implemented and tested. Milestone M2 is delivered; `systemd` unit sandboxing hardening is tracked separately in [#17](https://gitea.roadtotech.me/kiskaadee/lg-smtv-mcp/issues/17).
--- ---
@@ -61,7 +61,7 @@ Implementation is tracked on the [Project Pipeline](https://gitea.roadtotech.me/
| Milestone | Scope | Status | | Milestone | Scope | Status |
| :--- | :--- | :--- | | :--- | :--- | :--- |
| **M1** | Core config, `tv_core` engine, FastMCP tools, Bearer auth, `pair`/`serve` CLI, E2E verification | Complete (`#1`–`#4` merged on `main`) | | **M1** | Core config, `tv_core` engine, FastMCP tools, Bearer auth, `pair`/`serve` CLI, E2E verification | Complete (`#1`–`#4` merged on `main`) |
| **M2** | Developer Mode SFTP screenshot capture (`asyncssh`), systemd unit, E2E test hardening | In progress — capture (`#12`) and E2E hardening (`#11`) merged; systemd deployment (`#13`) open | | **M2** | Developer Mode SFTP screenshot capture (`asyncssh`), systemd unit, E2E test hardening | Delivered — capture (`#12`), E2E hardening (`#11`), and systemd deployment (`#13`); unit sandboxing hardening tracked in `#17` |
Implemented in [`TvManager`](src/lg_smtv_mcp/tv_core/manager.py) and exposed via [`server.py`](src/lg_smtv_mcp/server.py): Implemented in [`TvManager`](src/lg_smtv_mcp/tv_core/manager.py) and exposed via [`server.py`](src/lg_smtv_mcp/server.py):
- Persistent SSAP multiplexing and `subscribe`-backed state snapshots (`get_state`: `volume`, `muted`, `sound_output`, `foreground_app`) - Persistent SSAP multiplexing and `subscribe`-backed state snapshots (`get_state`: `volume`, `muted`, `sound_output`, `foreground_app`)
@@ -187,14 +187,14 @@ The repository includes a unit template at [`deploy/lg-smtv-mcp.service`](deploy
sudo journalctl -u lg-smtv-mcp.service sudo journalctl -u lg-smtv-mcp.service
``` ```
The HTTP server binds to `127.0.0.1` by default and requires `MCP_BEARER_TOKEN`. Use a trusted reverse proxy or VPN if clients need remote access. The HTTP server binds to `127.0.0.1` by default and requires `MCP_BEARER_TOKEN`. Use a trusted reverse proxy or VPN if clients need remote access. When exposing the server remotely, set **both** `HOST=0.0.0.0` (or the LAN bind address) **and** `ALLOWED_HOSTS=<proxy-or-vpn-hostname>` in `.env`; the DNS-rebinding check in `auth.py` rejects any request whose `Host` header is not in the allowlist.
### Developer Mode SSH Capture Setup ### Developer Mode SSH Capture Setup
Enable Developer Mode and the TV's Key Server in the Developer Mode app. Run pairing from the configured checkout as the same service user so the client key and SSH key are saved where the service can read them: Enable Developer Mode and the TV's Key Server in the Developer Mode app. Run pairing from the configured checkout as the same service user so the client key and SSH key are saved where the service can read them:
```bash ```bash
lg-smtv-mcp pair --fetch-ssh-key python -m lg_smtv_mcp pair --fetch-ssh-key
``` ```
Accept the on-screen pairing prompt. The command fetches the SSH key from the TV and saves it with mode `0600` (default path `.webos_rsa`); set `SSH_KEY_PATH` in `.env` to that path. Developer Mode provides SSH/SFTP on port `9922`. Its on-TV countdown timer eventually expires and disables Developer Mode, so screenshot capture then returns `SCREENSHOT_UNAVAILABLE` until Developer Mode is enabled again. Other SSAP tools remain available. Accept the on-screen pairing prompt. The command fetches the SSH key from the TV and saves it with mode `0600` (default path `.webos_rsa`); set `SSH_KEY_PATH` in `.env` to that path. Developer Mode provides SSH/SFTP on port `9922`. Its on-TV countdown timer eventually expires and disables Developer Mode, so screenshot capture then returns `SCREENSHOT_UNAVAILABLE` until Developer Mode is enabled again. Other SSAP tools remain available.