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 #
-
It runs in Antenna Tower as a Streamable HTTP server on
http://127.0.0.1:8765/mcp(configured with-mcporSTATION_MCP;"off"disables it). Whiletower/internal/mcp/server.goimplements a stdio transport (ServeStdio) internally,antenna-towerexposes the HTTP listener only. -
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. -
It's on by default on loopback only (
127.0.0.1:8765, no token; pass-mcp offorSTATION_MCP=offto disable it). Any request with anOriginheader gets a 403, so a web page can't reach it through DNS rebinding. -
test_streamchecks streams over HTTP before they're trusted.tower/internal/tools/probe.goasks 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_urlonly adds what answers cleanly. -
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/tasksin the request's_metaclient capabilities) gets aCreateTaskResult, then polls withtasks/get.tasks/cancelstops the job. - A client without it gets a job id, and polls with the
job_statustool.
Both paths share the same jobs, which are kept for an hour after they finish.
- A client with the tasks extension
(
Protocol #
It supports both eras of the protocol, which the spec calls dual-era:
- Modern (
2026-07-28): the version and client capabilities come in each request's_meta. The server handlesserver/discover, and list results carryttlMsandcacheScope, which Claude Code requires. An unknown version gets-32022with the supported list. - Legacy (
2025-03-26,2025-06-18and2025-11-25): these start withinitialize. The server has no sessions, since it doesn't need any.
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/:
tower/cmd/antenna-tower/assistant.go: wires up the MCP server and tool dependencies (startAssistant).tower/internal/mcp/: HTTP/JSON-RPC dual-era protocol (server.go), tool registry (registry.go), tasks and jobs (jobs.go), and results (result.go).tower/internal/tools/: the tool registrations (lineup*.go,search.go,probe.go,audit.go,health.go,logins*.go,sports*.go,modules*.go,tools.go).tower/internal/lineup/: dial number calculation fromchannelNumbers,channelNames,hiddenChannels,offDialChannels,addedChannels,iptvLineup, andchannelGroups(matchingRetroLineup'sDialNumbersand checked against the compiled Swift).
(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:
- Streams are checked by asking for them, not by playing them.
test_streamandadd_stream_urlfollow a playlist to its first segment (12 seconds at most);auditreads the start of each stream. Provider streams go throughSTATION_PROXY, anything else direct. - Plex Live TV is not searched or tested: the tower holds no Plex account's
channel list.
sync_catalogsreportsplex: 0. Tubi's streams can't be tested either (the audit skips them); Xumo's and Pluto's can. - Search looks through Xumo, Tubi, Pluto, the iptv-org US list (each kept in the cache folder, fetched again once a day) and every login's channels; names are matched by the same words and typo rules, in memory rather than in SQLite FTS.
get_diagnosticsfinds Apple TVs with Bonjour from the tower's network, so the tower must be on the Apple TV's network.- The channel modules' tools (MBTA, World, Video Store) are in Go. The MBTA and
World channels' settings are each profile's, kept in the profile's history
(
pref.mbta,pref.world), so these tools take an optionalprofile(defaultmain, the first). The Video Store's look is the station's syncedvideostoresetting; its rating and year are the profile's (pref.videostoreTaste).add_world_areafinds a place with OpenStreetMap's Nominatim (the Manager used Apple's search), so an area is named for its town and the full state name (Medford, Massachusetts, notMedford, MA). The MBTA's API key isMBTA_KEY(optional).
Tools #
Channels
list_channels,get_channelsearch_channels: covers Plex Live TV, Xumo, Tubi, Pluto, iptv-org and every IPTV login, and hands out refs.add_channel: adds a result from another login as a feed of the channel you already have, as the Live TV pane does.add_stream_url,remove_channel,restore_channel,renumber_channel,rename_channel,release_number,set_buffer,test_stream
Groups (see group-channels.md)
list_groups,add_group,set_groupset_on_dial: off the dial, a channel still plays in its groups.get_channellists a group's channels, or the groups a channel is in;list_channelstakesinclude_off_dial.
Feeds
set_feeds: one stream's feeds: order, take off, and which login Earlier Shows uses.set_entries: an IPTV channel's streams and folders, in play order.set_preferred_login: the login every stream and game on a channel tries first.add_feed(to a stream, or as a new stream withas_new_stream),merge_channelsfind_feeds: runs Go's feed linker (tower/internal/jobs/linker.go).audit
Health
get_errors: what the screens reported (the Errors pane), filtered byareaorcontains. Read-only.whats_playing: what each device is playing now, from which login and for which profile, and each login's devices (Settings › Server › Devices). Read-only.get_provider_speeds: how fast each IPTV login has sent On Demand files fetched by the tower (median, last, slowest, fastest MB/s). Read-only.get_storage: each On Demand cache's size and file count (the Storage pane). Read-only.clear_cache: clears one cache by id (readahead,posters,subtitles,tmdb); the title catalog can't be cleared.get_diagnostics: lists the Apple TVs on the network, or withdevicefetches one's recent playback log (the Diagnostics pane).
Logins
list_logins: read-only.add_login,swap_login,remove_login,remap_feeds: manage IPTV logins and remap feeds (checking/counting before applying, never returning secrets).list_vod_categories: each login's On Demand categories with title counts, which the adult filter drops (by name, or by a cached Jev tag), titles the menus drop by their own names (their names too, withshow_titles), the titles in no listed category, and totals. Slow (a background job); never asks Jev.search_vod: search On Demand's merged catalog (api/README.md, historical context in history/vod-relay.md): titles, best first, each with its copies (login or Plex, tag, quality, file type, whether it plays as is);with_plotsadds the first five titles' descriptions.vod_catalog: the merged catalog on Antenna Tower, each source's titles, size and last fetch;refreshfetches it all again (a background job).
Sports
list_sports,get_sport,add_sport_channel,set_sport_folderoverride_folder,override_game: become labelled examples.set_alias,set_followed_sports,set_regionslist_review,decide_review: Jev's queue.test_game_feed- Always-on channels:
find_always_on,add_always_on,remove_always_on,list_guide_channels,set_always_on_guide rescan_sports,refresh_all
Channel modules (see channel-modules.md)
get_<name>,set_<name>: generated for every module from its settings. The MBTA channel's areget_mbtaandset_mbta; the Video Store's areget_video_storeandset_video_store(case sizes, what's shelved: see video-store.md).find_mbta_stations,list_mbta_lines: the idsset_mbtatakes.add_world_area: a ZIP code or place as a page of the World channel.- The MBTA, World and Video Store tools also take an optional
profile.
Other
sync_catalogs,reload_lineup,job_status
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
Phin Tech docs
Rabbit Ears Manager in the store →