Skip to main content

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

Version License: MIT Python 3.11+ MCP CI Data Source

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).

๐Ÿ‡ฉ๐Ÿ‡ช Deutsche Version


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):
    1. Create an account and log in
    2. Under "My Apps", create a new application
    3. Add the product SRG SSR PUBLIC API V2
    4. 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

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

srgssr_mcp-0.1.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

srgssr_mcp-0.1.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

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

Hashes for srgssr_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f23e7503736000ce3de673bd813799fa45e61b79286c09ccbf7bba0f45991eb8
MD5 0875f0c756fbea8feecfd7294d2e47f9
BLAKE2b-256 81de13a7c518db10fe50f9ee0b1b5a532514aee1f830b733306e2d11e1ff8b28

See more details on using hashes here.

Provenance

The following attestation bundles were made for srgssr_mcp-0.1.0.tar.gz:

Publisher: publish.yml on malkreide/srgssr-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for srgssr_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f99fc11a3b27ed25f87e3255f7bfa5dbc982aec67df923d4043f0843a20cb2ec
MD5 a23eafd6d256ec3975f9b1fbe03225d6
BLAKE2b-256 b751d4bc5ae318598e29353511b92fb8fa9f620b426442ecb2aed290af2b932b

See more details on using hashes here.

Provenance

The following attestation bundles were made for srgssr_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on malkreide/srgssr-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page