swr-mcp
README.md
# swr-mcp 📻
mcp-name: io.github.mohammad-abbasi-sh/swr-mcp
Unofficial **read-only** MCP server for **[SWR](https://www.swr.de)** (Südwestrundfunk) — the ARD public broadcaster for Baden-Württemberg and Rheinland-Pfalz (about 13.5 million people in its coverage area) — via its official RSS feeds (no key, no login) and article pages, whose full text lives in the server-rendered `<article class="detail">` block's `detail-body` paragraphs. Latest news, the SWR Aktuell news feed, news by region, keyword search, stories by topic, the topics in today's feed, and full article text. No key, no login.
> Built by Mohammad Abbasi as part of the "Germany MCP factory". Not affiliated with SWR.
## For AI agents
Add to your MCP client config (stdio):
```json
{
"mcpServers": {
"swr": {
"command": "uvx",
"args": ["swr-mcp==0.1.0"]
}
}
}
```
Or run locally: `python -m swr_mcp.server` (needs `mcp<2`, `httpx`).
## Tools
| Tool | Description |
|------|-------------|
| `swr_latest` | Latest SWR news (the official main RSS feed, 55 items), newest first — `limit` 1..60. Every item carries a title, a per-article link, a teaser, topics (the feed's `<category>` tags), section, region (Baden-Württemberg / Rheinland-Pfalz, when in the topics), an image URL and publish time |
| `swr_aktuell` | Latest SWR Aktuell news (the official SWR Aktuell RSS feed, 58 items), newest first — `limit` 1..60. Same item shape as `swr_latest` |
| `swr_region` | Latest SWR Aktuell news from one region (the official regional RSS feed) — `region`: `baden-wuerttemberg` (77 items) or `rheinland-pfalz` (45 items); `limit` 1..60 |
| `swr_search_news` | Search SWR news by keyword (title + teaser + topics) across the official main RSS feed — `query` (e.g. "Grundsteuer" or "Mercedes"), `limit` 1..60 |
| `swr_by_topic` | Newest SWR stories on one topic — `topic`: Politik, Wirtschaft, Wissen, Verkehr, Umwelt, Kultur, Gesundheit, … (matched exactly, case-insensitively); `limit` 1..60 |
| `swr_topics` | The topics in today's SWR main feed, with how many stories each carries — most stories first |
| `swr_get_article` | Full text of one SWR article page (the server-rendered `<article class="detail">` block's `detail-body` paragraphs) — `url`: an swr.de article URL (/swraktuell/<region>/<slug>-<id>.html). Returns title, subheading, author, publish time, body text and word count. Video pages (/video/...) return `kind: "video"` with a short description. Feed URLs, the home page and off-site links are refused |
| `swr_health` | Reachability probe (ok / blocked / error) — one polite request |
Example output (`swr_latest`, `limit` 1):
```json
{"feed_title": "Südwestrundfunk | SWR.de", "total_results": 46, "count": 1,
"items": [
{"title": "Höhere Grundsteuer: Wohnen wird für viele in RLP erneut teurer",
"link": "https://www.swr.de/swraktuell/rheinland-pfalz/wohnen-wird-fuer-viele-in-rlp-erneut-teurer-hoehere-grundsteuer-100.html",
"description": "Mieter und Hausbesitzer aufgepasst: Zahlreiche Kommunen müssen im kommenden Jahr die Grundsteuer anheben. Es ist die dritte Erhöhung innerhalb von nur fünf Jahren.",
"published": "2026-11-30T08:47:40+00:00",
"topics": ["Nachrichten", "Politik", "Landespolitik RLP", "Welt", "Europa", "Deutschland", "Rheinland-Pfalz", "Grundsteuer"],
"topic": "Nachrichten", "section": "Nachrichten", "region": "Rheinland-Pfalz",
"image_url": "https://images.swr.de/image/4ecb456a-09be-4e36-a7f1-24d3ccefe908/AAABoirnwhw/AAABknZhdnQ/16x9-XL/grundsteuer-wird-2027-steigen-100.jpg"},
...]}
```
Notes:
- The server reads the official **RSS feeds** — main feed `https://www.swr.de/~rss/index.xml` (55 items, verified live 2026-11-30), SWR Aktuell `https://www.swr.de/~rss/swraktuell/index.xml` (58 items), Baden-Württemberg `https://www.swr.de/~rss/swraktuell/baden-wuerttemberg/index.xml` (77 items) and Rheinland-Pfalz `https://www.swr.de/~rss/swraktuell/rheinland-pfalz/index.xml` (45 items). Every SWR page carries its own "Seite als RSS-Feed" link — the feeds were discovered from those links. Feed titles: "Südwestrundfunk | SWR.de", "SWR Aktuell", "SWR Aktuell Baden-Württemberg".
- **Off-site links are dropped, never fetched:** the main feed mixes in 9 off-site items (swr3.de, YouTube, ARD Mediathek, ARD Audiothek, swr-vote.de) — only `https://www.swr.de/` links are returned (46 of 55). The SWR Aktuell feed keeps 45 of 58, the Baden-Württemberg feed 62 of 77. Some feed links carry a `?cfd=...` tracking parameter — it is stripped.
- **Categories are hierarchical and comma-separated** ("Nachrichten, Politik, Landespolitik RLP, Welt, Europa, Deutschland, Rheinland-Pfalz, Grundsteuer") — topics are split on commas and de-duplicated (Deutschland 27, Europa 27, Welt 27, Nachrichten 22, Baden-Württemberg 14, Rheinland-Pfalz 11 — sampled 2026-11-30). 6 of the 46 main-feed items carry no `<category>` at all — they are returned with empty topics. The region (Baden-Württemberg / Rheinland-Pfalz) is derived from the topics.
- The feed carries **no author** (no `dc:creator`) — the author comes from the article page's byline ("Von Autor/in …", e.g. "Gernot Ludwig" or "Geli Hensolt, Christian Spöcker") and is returned by `swr_get_article` only. There is no by-author tool. The feed description is a clean plain-text teaser. Feed items carry an image (`<enclosure>`, images.swr.de).
- **Article text, honestly:** SWR pages carry NO JSON-LD at all. The headline is the `<h1 class="headline">`, the subheading the `<p class="topline">`, the teaser the `<meta itemprop="description">`, the author the meta-persons byline and the date the `<time datetime>`. The body comes from the `<div class="container detail-body">` paragraphs (an RLP news article sampled 8 body paragraphs / 408 words, a Stuttgart article 5 paragraphs / 299 words, a Leben article 47 paragraphs). The Google-preferred-source promo paragraphs ("Wenn Sie bei Google …", "Wenn Sie SWR Aktuell …", "→ Hier können Sie …") and related-audio teasers ("Expertin im Interview …") live inside the same container and are filtered out; the related-article teaser sits outside it and is never included.
- **Video pages** (/video/...) carry the same detail template with a single short description paragraph — `kind: "video"`, usually `teaser_only: true`.
- **No paywall:** SWR is a public broadcaster, all articles are free — zero paywall markers ("SWR Plus", "Bezahl", "Abo", "paywall", "isAccessibleForFree") on either sampled article and none in the feed. No paywall branch is implemented; a page with no usable body raises an error, never a fabricated paywall claim.
- Data: SWR's public RSS feeds and article pages — no key, no login, read-only.
## Development
```bash
python3 -m venv .venv && .venv/bin/pip install "mcp<2" httpx pytest
.venv/bin/pip install -e .
.venv/bin/python -m pytest tests/ -q
```
- `tests/test_domain.py` — offline, parses the real captured feeds (main 55 items, SWR Aktuell 58, Baden-Württemberg 77) plus three real article pages (an RLP news article, a Stuttgart article with two authors, a video page)
- `tests/test_live.py` — cautious live requests against swr.de
Tests: 32/32 green (23 offline + 9 live, 2026-11-30).
## License
[PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/) — free for personal and non-commercial use; commercial use needs a separate license (see LICENSE).
---
Built by [Mohammad Abbasi](https://github.com/mohammad-abbasi-sh) — [Almanibama](https://almanibama.ir) · [mabbasi.ir](https://mabbasi.ir)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues