MCP server for SRG SSR public APIs โ weather, TV/radio metadata, program guide & Swiss votations/elections since 1900
Project description
๐จ๐ญ Part of the Swiss Public Data MCP Portfolio
๐บ srgssr-mcp
MCP server connecting AI models to SRG SSR public APIs โ weather, TV/radio metadata, program guide and Swiss votations/elections since 1900 (SRF, RTS, RSI, RTR, SWI).
Overview
srgssr-mcp gives AI assistants like Claude direct access to the public APIs of SRG SSR โ Switzerland's national public broadcaster. Weather forecasts, TV and radio metadata, electronic program guides, and historical democratic data (votations and elections since 1900) are all accessible through a single standardised MCP interface.
The server covers five thematic clusters: SRF Weather, Video, Audio, EPG and Polis (Swiss Democracy). Each cluster maps to a group of purpose-built tools that translate raw SRG SSR API data into clean JSON responses.
Anchor demo query: "What were the cantonal results of the popular vote on initiative X in Zurich?" โ answered with historical real-time data from the Polis system, not a hallucination.
Features
- ๐ฆ๏ธ Weather โ location search, current conditions, 24h hourly forecast, 7-day forecast (SRF Meteo)
- ๐บ Video โ TV show listings, latest episodes, live TV channels across all business units
- ๐๏ธ Audio โ radio show listings, audio episodes, live radio stations
- ๐ EPG โ daily program schedule for any TV or radio channel
- ๐ณ๏ธ Polis โ popular votes and elections since 1900, national and cantonal results
- ๐ข Multi-unit โ SRF (DE), RTS (FR), RSI (IT), RTR (RM), SWI (multilingual)
- ๐ OAuth2 โ automatic token management with Client Credentials flow
- โ๏ธ Dual transport โ stdio for Claude Desktop, Streamable HTTP/SSE for cloud deployment
Prerequisites
- Python 3.11+
- API keys from developer.srgssr.ch (free registration):
- Create an account and log in
- Under "My Apps", create a new application
- Add the product SRG SSR PUBLIC API V2
- Note your Consumer Key and Consumer Secret
โ ๏ธ Terms of use: SRG SSR APIs are available for non-commercial use. For commercial use, contact api@srgssr.ch directly.
Installation
# Clone the repository
git clone https://github.com/malkreide/srgssr-mcp.git
cd srgssr-mcp
# Install
pip install -e .
Or with uvx (no permanent installation):
uvx srgssr-mcp
Or via pip:
pip install srgssr-mcp
Quickstart
# Set credentials
export SRGSSR_CONSUMER_KEY="your-consumer-key"
export SRGSSR_CONSUMER_SECRET="your-consumer-secret"
# Start the server (stdio mode for Claude Desktop)
srgssr-mcp
Try it immediately in Claude Desktop:
"What will the weather be like in Zurich tomorrow?" "What's on SRF 1 tonight?" "Which popular votes took place in the canton of Bern between 2010 and 2020?"
Configuration
Claude Desktop
Minimal (recommended):
{
"mcpServers": {
"srgssr": {
"command": "uvx",
"args": ["srgssr-mcp"],
"env": {
"SRGSSR_CONSUMER_KEY": "your-consumer-key",
"SRGSSR_CONSUMER_SECRET": "your-consumer-secret"
}
}
}
}
Config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
After saving, restart Claude Desktop completely.
Other MCP Clients
Compatible with Cursor, Windsurf, VS Code + Continue, LibreChat, Cline, and self-hosted models via mcp-proxy. Set the same environment variables.
Cloud Deployment (SSE for browser access)
For use via claude.ai in the browser (e.g. on managed workstations without local software):
SRGSSR_CONSUMER_KEY=... SRGSSR_CONSUMER_SECRET=... \
python -m srgssr_mcp.server --transport streamable_http --port 8000
๐ก "stdio for the developer laptop, SSE for the browser."
Available Tools
๐ฆ๏ธ SRF Weather (4 tools)
| Tool | Description | Data Source |
|---|---|---|
srgssr_weather_search_location |
Search for a location by name or postal code to obtain a geolocationId |
SRF Meteo |
srgssr_weather_current |
Current weather conditions for a Swiss location | SRF Meteo |
srgssr_weather_forecast_24h |
Hourly 24-hour forecast | SRF Meteo |
srgssr_weather_forecast_7day |
Daily 7-day forecast | SRF Meteo |
๐บ Video (3 tools)
| Tool | Description | Data Source |
|---|---|---|
srgssr_video_get_shows |
List TV shows for a business unit | SRG SSR IL |
srgssr_video_get_episodes |
Retrieve latest episodes of a show | SRG SSR IL |
srgssr_video_get_livestreams |
List live TV channels | SRG SSR IL |
๐๏ธ Audio (3 tools)
| Tool | Description | Data Source |
|---|---|---|
srgssr_audio_get_shows |
List radio shows for a business unit | SRG SSR IL |
srgssr_audio_get_episodes |
Retrieve audio episodes of a show | SRG SSR IL |
srgssr_audio_get_livestreams |
List live radio stations | SRG SSR IL |
๐ EPG โ Electronic Program Guide (1 tool)
| Tool | Description | Data Source |
|---|---|---|
srgssr_epg_get_programs |
Daily program schedule for a TV or radio channel | SRG SSR IL |
๐ณ๏ธ Polis โ Swiss Democracy (3 tools)
| Tool | Description | Data Source |
|---|---|---|
srgssr_polis_get_votations |
Popular votes since 1900 (national or cantonal) | Polis API |
srgssr_polis_get_votation_results |
Detailed results of a specific vote | Polis API |
srgssr_polis_get_elections |
Election results since 1900 | Polis API |
Supported Business Units
| Code | Unit | Language |
|---|---|---|
srf |
SRF (Schweizer Radio und Fernsehen) | German |
rts |
RTS (Radio Tรฉlรฉvision Suisse) | French |
rsi |
RSI (Radiotelevisione svizzera) | Italian |
rtr |
RTR (Radiotelevisiun Svizra Rumantscha) | Romansh |
swi |
SWI swissinfo.ch | Multilingual |
Example Use Cases
| Query | Tool |
|---|---|
| "Weather in Zurich tomorrow?" | srgssr_weather_forecast_24h |
| "What's on SRF 1 tonight?" | srgssr_epg_get_programs |
| "Latest Tagesschau episodes?" | srgssr_video_get_episodes |
| "Popular votes in Canton Bern 2010โ2020?" | srgssr_polis_get_votations |
| "Cantonal results of the mask initiative vote?" | srgssr_polis_get_votation_results |
| "All current RTS radio shows?" | srgssr_audio_get_shows |
Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Claude / AI โโโโโโถโ srgssr-mcp โโโโโโถโ SRG SSR APIs โ
โ (MCP Host) โโโโโโโ (MCP Server) โโโโโโโ โ
โโโโโโโโโโโโโโโโโโโ โ โ โ SRF Meteo (Weather) โ
โ 14 Tools โ โ Integration Layer (A/V) โ
โ Stdio | SSE โ โ Polis (Democracy) โ
โ โ โ developer.srgssr.ch โ
โ OAuth2 token mgmt โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ server.py (FastMCP) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Data Sources
| Source | Data | Access |
|---|---|---|
| developer.srgssr.ch | SRG SSR PUBLIC API V2 (weather, A/V, EPG, Polis) | OAuth2 (free registration) |
Attribution: SRG SSR APIs are subject to the SRG SSR Terms of Use.
Project Structure
srgssr-mcp/
โโโ src/srgssr_mcp/
โ โโโ __init__.py # Package
โ โโโ server.py # FastMCP server: 14 tools, OAuth2 client
โโโ .github/
โ โโโ workflows/
โ โโโ ci.yml # GitHub Actions CI (Python 3.11โ3.13)
โโโ pyproject.toml # Build configuration (hatchling)
โโโ CHANGELOG.md
โโโ CONTRIBUTING.md # English
โโโ CONTRIBUTING.de.md # German
โโโ LICENSE # MIT
โโโ README.md # This file (English)
โโโ README.de.md # German version
Known Limitations
- API keys required โ unlike other portfolio servers, SRG SSR APIs require free OAuth2 credentials
- Non-commercial use โ the SRG SSR API terms restrict commercial use without explicit permission
- Rate limits โ the SRG SSR API may enforce rate limits depending on your application tier
- Weather data โ SRF Meteo covers Switzerland only
Testing
# Unit tests (no network required)
PYTHONPATH=src pytest tests/ -m "not live"
# Integration tests (requires SRG SSR API keys)
PYTHONPATH=src pytest tests/ -m "live"
# Linting
ruff check src/
Contributing
See CONTRIBUTING.md
Changelog
See CHANGELOG.md
License
MIT License โ see LICENSE
The SRG SSR APIs used in this project are subject to the SRG SSR Terms of Use.
Author
Hayal Oezkan ยท github.com/malkreide
Credits & Related Projects
- Data: SRG SSR Developer Portal ยท SRF Meteo ยท Polis API
- Protocol: Model Context Protocol โ Anthropic / Linux Foundation
- Related:
| Server | Description |
|---|---|
| zurich-opendata-mcp | City of Zurich open data (OSTLUFT air quality, weather, parking, geodata) |
| swiss-transport-mcp | Swiss public transport โ OJP 2.0 journey planning, SIRI-SX disruptions |
| swiss-environment-mcp | BAFU environmental data โ air quality, hydrology, natural hazards |
| swiss-statistics-mcp | BFS STAT-TAB โ 682 statistical datasets |
| fedlex-mcp | Swiss federal law via Fedlex SPARQL |
Synergy example: "What were the results of the 2020 popular votes in Canton Zurich โ and how did turnout compare to the national average?"
โ srgssr-mcp (Polis, cantonal results) + swiss-statistics-mcp (BFS, turnout data)
- Portfolio: Swiss Public Data MCP Portfolio
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file srgssr_mcp-0.1.0.tar.gz.
File metadata
- Download URL: srgssr_mcp-0.1.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f23e7503736000ce3de673bd813799fa45e61b79286c09ccbf7bba0f45991eb8
|
|
| MD5 |
0875f0c756fbea8feecfd7294d2e47f9
|
|
| BLAKE2b-256 |
81de13a7c518db10fe50f9ee0b1b5a532514aee1f830b733306e2d11e1ff8b28
|
Provenance
The following attestation bundles were made for srgssr_mcp-0.1.0.tar.gz:
Publisher:
publish.yml on malkreide/srgssr-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
srgssr_mcp-0.1.0.tar.gz -
Subject digest:
f23e7503736000ce3de673bd813799fa45e61b79286c09ccbf7bba0f45991eb8 - Sigstore transparency entry: 1193951488
- Sigstore integration time:
-
Permalink:
malkreide/srgssr-mcp@4707911a12057d55822e08ce3c7b902d9bff8155 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/malkreide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4707911a12057d55822e08ce3c7b902d9bff8155 -
Trigger Event:
release
-
Statement type:
File details
Details for the file srgssr_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: srgssr_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f99fc11a3b27ed25f87e3255f7bfa5dbc982aec67df923d4043f0843a20cb2ec
|
|
| MD5 |
a23eafd6d256ec3975f9b1fbe03225d6
|
|
| BLAKE2b-256 |
b751d4bc5ae318598e29353511b92fb8fa9f620b426442ecb2aed290af2b932b
|
Provenance
The following attestation bundles were made for srgssr_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on malkreide/srgssr-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
srgssr_mcp-0.1.0-py3-none-any.whl -
Subject digest:
f99fc11a3b27ed25f87e3255f7bfa5dbc982aec67df923d4043f0843a20cb2ec - Sigstore transparency entry: 1193951497
- Sigstore integration time:
-
Permalink:
malkreide/srgssr-mcp@4707911a12057d55822e08ce3c7b902d9bff8155 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/malkreide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4707911a12057d55822e08ce3c7b902d9bff8155 -
Trigger Event:
release
-
Statement type: