kotty-radio-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| WEB_API | No | Publica la API web en /api/v1. | false |
| HTTP_HOST | No | Dirección de escucha del servidor HTTP/WS. | 127.0.0.1 |
| HTTP_PORT | No | Puerto HTTP/WS; 0 usa un puerto aleatorio. | 8787 |
| LOG_LEVEL | No | Nivel de log: fatal…trace o silent; siempre a stderr. | info |
| FFMPEG_PATH | No | Ruta del binario de ffmpeg. | ffmpeg |
| SESSION_TTL | No | Vida de una sesión sin oyentes en segundos; con oyentes conectados no caduca. | 7200 |
| MAX_SESSIONS | No | Sesiones de reproducción simultáneas. | 50 |
| MCP_TRANSPORT | No | Transporte MCP: stdio o http. | stdio |
| RB_TIMEOUT_MS | No | Timeout de la API de radio-browser. | 5000 |
| RB_USER_AGENT | No | User-Agent hacia radio-browser y las emisoras. | kotty-radio-mcp/0.1.0 (+…) |
| WS_MAX_BUFFER | No | Bytes pendientes por cliente antes de descartar audio. | 1048576 |
| DEFAULT_FORMAT | No | Formato si play_station no indica uno. | passthrough |
| MCP_AUTH_TOKEN | No | Token Bearer de /mcp; obligatorio en modo http fuera de loopback. | |
| WEB_RATE_LIMIT | No | Peticiones por minuto e IP a la API web. | 120 |
| ALLOWED_ORIGINS | No | Orígenes de navegador permitidos para WS y /mcp, separados por comas. | http://localhost:5173 |
| PUBLIC_BASE_URL | No | Base ws(s):// con la que se construyen las wsUrl. | ws://localhost:8787 |
| WEB_TRUST_PROXY | No | Toma la IP del cliente de X-Real-IP, detrás de nginx. | false |
| MCP_ALLOWED_HOSTS | No | Si se define, únicos nombres de Host (además de loopback) que acepta /mcp. | |
| WEB_ALLOWED_ORIGINS | No | Orígenes CORS que pueden usar la API web, separados por comas. | |
| WEB_PLAY_RATE_LIMIT | No | Sesiones nuevas por minuto e IP. | 10 |
| MAX_CLIENTS_PER_SESSION | No | Clientes WS por sesión. | 5 |
| WEB_SESSIONS_PER_CLIENT | No | Sesiones abiertas por IP; al crear otra se cierra la más antigua. | 2 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Internet radio search and playback via radio-browser.info. Use get_random_stations for "surprise me"/no preference, recommend_stations for vague or descriptive requests (style, mood, artist: translate artists into genre/country/decade hints), search_stations for explicit filters, and list_tags/list_countries/list_languages to map the user's words to real values. To listen, call play_station and give its wsUrl to the player; now_playing gives the current song and stop_stream ends playback. Station ids are radio-browser stationuuids; never invent them. See the "play-music" prompt for the full flow.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_stationsA | Search internet radio stations on radio-browser.info with EXPLICIT filters (name, tags, country, language, codec, bitrate). Use this when the user names a station or gives concrete filters. For vague requests ("something like Soda Stereo", "music to study") use recommend_stations instead; for "surprise me" use get_random_stations. Returns compact station objects; pass a station "id" to play_station to listen. |
| get_random_stationsA | Get random, currently working internet radio stations, optionally filtered by tags, country or language. Use when the user says "surprise me", "play something", "anything" or gives no real preference. Offer up to 3 of them to the user, then call play_station with the chosen "id". |
| recommend_stationsA | Recommend internet radio stations that fit a free-form music request ("jazz francés tranquilo", "something like Soda Stereo", "music to study"). radio-browser has NO artist or album search, so BEFORE calling, translate any artist/album/song into hints: genres (radio-browser tags), countryCodes, languages, decade and moods. E.g. "algo como Soda Stereo" -> hints {genres:["rock en español","rock"], countryCodes:["AR"], languages:["spanish"], decade:"80s", artist:"Soda Stereo"}. Always pass the original prompt too; the server also parses it as a fallback. Returns ranked stations with matchReason and confidence (0–1): if the top confidence is high (≥0.8) you may play the first one directly with play_station, otherwise offer up to 3 options. If the user just wants anything, prefer get_random_stations. |
| get_stationA | Get the details of one radio station by its "id" (stationuuid), including whether it passed the last health check and its click trend. |
| list_tagsA | List radio-browser genre/style tags with how many working stations use each, most used first. Use it to map the user's words to real tags before searching (e.g. filter "rock" -> "rock en español", "classic rock"). |
| list_countriesA | List countries (English name + ISO 3166-1 alpha-2 code) with their station counts. Filter matches the English country name, e.g. "argen" -> Argentina (AR). |
| list_languagesA | List station languages as radio-browser names them (lowercase English, e.g. "spanish", "french") with station counts. Use these names for the "language" filter of other tools. |
| list_codecsA | List audio codecs used by stations (MP3, AAC, OGG…) with station counts. |
| vote_stationA | Upvote a station on radio-browser.info (public, community-visible). ONLY call this when the user explicitly asks to vote for / like the station. radio-browser allows one vote per station per IP every few minutes; ok=false with a message means it was not counted. |
| play_stationA | Start streaming a radio station (by "id" from the search/recommend tools) and return a WebSocket URL (wsUrl) the client player connects to. The server does not play audio itself: hand wsUrl to the player. Binary WS frames carry the audio; JSON text frames carry {type:"ready"|"metadata"|"reconnecting"|"error"|"ended"}. format: "passthrough" (original codec, default) or "mp3"/"opus"/"pcm16" (48 kHz stereo)/"pcm16_24k_mono" (transcoded, need ffmpeg). Use now_playing for the current song and stop_stream when done. |
| stop_streamA | Stop a playback session started with play_station: connected players receive {type:"ended"} and are disconnected, and the wsUrl stops working. |
| now_playingA | Current song of a playback session, from the station's ICY metadata (StreamTitle, usually "Artist - Title"). title is null if the station sends no metadata or no player is connected yet (the stream only starts when a player connects to wsUrl). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| play-music | Guide the assistant to find and play an internet radio station for a request. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| top-tags | The 100 most used genre/style tags with station counts. |
| countries | All countries with stations: English name, ISO 3166-1 alpha-2 code and station count. |
| languages | The 100 most common station languages (names to use in "language" filters). |
TDQS
Scored across 12 tools
The three discovery tools (search_stations, get_random_stations, recommend_stations) share a surface but their descriptions give explicit routing rules (explicit filters vs. 'surprise me' vs. free-form/artist prompts), which largely resolves the overlap. The list_* facet tools and the play/stop/now_playing trio are clearly distinct. Only residual risk is an agent picking recommend vs. random for a vague query.
Almost everything follows a snake_case verb_noun pattern (get_station, list_tags, vote_station, play_station, search_stations, recommend_stations). The single deviation is now_playing, which is a state-noun rather than a verb phrase, and 'get_random_stations' uses a different verb than 'recommend_stations' for a similar read operation.
Twelve tools is well within the sweet spot and every tool maps to a real step in the radio workflow: browse facets, discover, play, inspect, stop, vote. No tool feels redundant padding.
The lifecycle is essentially covered: enumerate facets, search/random/recommend, get details, stream, poll now_playing, stop, and a community vote. Minor gaps: no station-id-based 'similar stations' lookup, no batch detail fetch for result sets, and no stream-health/retry surface beyond the error frame, but agents can work around these.