Phin Tech docs Rabbit Ears Manager in the store →

Antenna Tower's MCP server

Antenna Tower runs an MCP server, so an assistant like Claude Code can manage the station. It can add channels, look at what's available, sort out IPTV feeds and fix sport channels, sharing the tower's lineup, job, and catalog engines. Anything it changes is saved in station.sqlite and synced to every screen through Antenna Tower (and R2 when away), like any other change.

Decisions #

  1. It runs in Antenna Tower as a Streamable HTTP server on http://127.0.0.1:8765/mcp (configured with -mcp or STATION_MCP; "off" disables it). While tower/internal/mcp/server.go implements a stdio transport (ServeStdio) internally, antenna-tower exposes the HTTP listener only.

  2. It can change the lineup, feeds, sports and logins, but never reveals a secret. It can add, swap and remove IPTV logins (add_login, swap_login, remove_login; each checks or counts first and changes nothing until told to apply) and point feeds at other streams (remap_feeds). A password can be given to it, but no tool ever returns a password, token or stream URL with credentials in it, and nothing logs the values of its arguments.

  3. It's on by default on loopback only (127.0.0.1:8765, no token; pass -mcp off or STATION_MCP=off to disable it). Any request with an Origin header gets a 403, so a web page can't reach it through DNS rebinding.

  4. test_stream checks streams over HTTP before they're trusted. tower/internal/tools/probe.go asks for the stream (following an HLS playlist to its first segment, 12 seconds at most) without launching a media player, and reports why it succeeded or failed. add_stream_url only adds what answers cleanly.

  5. Slow tools run in the background. These are the audit, the sports rescan, the full refresh, finding feeds, reloading the lineup and syncing catalogs.

    • A client with the tasks extension (io.modelcontextprotocol/tasks in the request's _meta client capabilities) gets a CreateTaskResult, then polls with tasks/get. tasks/cancel stops the job.
    • A client without it gets a job id, and polls with the job_status tool.

    Both paths share the same jobs, which are kept for an hour after they finish.

Protocol #

It supports both eras of the protocol, which the spec calls dual-era:

Each request answers with JSON only, with no SSE and no GET stream. Notifications get a 202. The Go server and tools live in tower/:

(The earlier Swift AssistantServer and StationJobs/MCP / control-room host were retired once the Go tower took over all tools; see history/linux-server.md.)

The Go tower serves the full lineup, search, probe, audit, module, sports, login, and health tools: list_channels, get_channel, remove_channel, restore_channel, renumber_channel, rename_channel, release_number, set_buffer, set_feeds, set_entries, set_preferred_login, merge_channels, list_groups, add_group, set_group, set_on_dial (a Plex or Pluto channel the tower can't see shows as a held number, not on the dial), search_channels, add_channel, add_stream_url, add_feed, find_feeds, reload_lineup, sync_catalogs, add_sport_channel, test_stream, audit, and the health tools get_errors, whats_playing, get_provider_speeds, get_storage, clear_cache, and get_diagnostics. Behavior notes:

Tools #

Channels

Groups (see group-channels.md)

Feeds

Health

Logins

Sports

Channel modules (see channel-modules.md)

Other

The Sports pane and the assistant share the tower's sports scan (tower/internal/jobs/scan.go, also backing /v1/admin/commands/sports-scan), so a rescan from either shows in both.

Connecting #

Clients connect via Streamable HTTP to Antenna Tower's loopback endpoint (default http://127.0.0.1:8765/mcp, configured via -mcp or STATION_MCP):

claude mcp add --transport http retrotv http://127.0.0.1:8765/mcp