MCP server for global news monitoring via WorldNewsAPI โ search, sentiment analysis, top headlines, and media monitoring for Swiss public institutions
Project description
๐จ๐ญ Part of the Swiss Public Data MCP Portfolio
๐ฐ news-monitor-mcp
MCP server for global news monitoring, media analysis and sentiment tracking via WorldNewsAPI โ full-text search across 150+ countries, German/English sentiment analysis, top headlines, GL briefings, newspaper front pages and geo-search. API key required.
Overview
news-monitor-mcp transforms any AI assistant into a proactive media intelligence agent. The server connects LLMs like Claude with global news data: from Swiss institutional reputation monitoring to weekly leadership briefings and trend detection across categories.
Source: WorldNewsAPI (worldnewsapi.com) โ the only freely available news API with German-language sentiment analysis.
API key required. Get a free key at worldnewsapi.com/console (1,000 calls/month free tier).
Anchor demo query: "How has the Schulamt Zรผrich been portrayed in the media over the last 30 days, and what is the overall sentiment?"
Features
- ๐ Full-text search โ 150+ countries, 50+ languages, Boolean queries and exact phrase matching
- ๐ Sentiment analysis โ German and English only (WorldNewsAPI unique feature); scores from โ1 (negative) to +1 (positive)
- ๐ฐ Top headlines โ clustered by country and language, ranked by number of sources reporting
- ๐ Media briefing โ multi-topic weekly report with sentiment overview for GL / leadership updates
- ๐๏ธ Newspaper front pages โ digital covers from 6,000+ publications in 125 countries
- ๐ก Trend radar โ category-based trend detection (politics, technology, education, โฆ) per country
- ๐ Geo-search โ location-specific news (Zรผrich, Bern, Basel, Kanton Zรผrich, โฆ)
- โ๏ธ Dual transport โ stdio for Claude Desktop, Streamable HTTP for cloud deployment
| # | Tool | Description |
|---|---|---|
| 1 | news_search |
Full-text news search in 150+ countries |
| 2 | news_top_headlines |
Top headlines by country and language |
| 3 | news_sentiment_monitor |
Sentiment analysis for entity or topic |
| 4 | news_media_briefing |
Multi-topic weekly briefing report |
| 5 | news_retrieve_article |
Fetch full article by ID |
| 6 | news_search_sources |
Find available news sources by name/country |
| 7 | news_front_pages |
Digital newspaper front pages |
| 8 | news_trend_radar |
Category-based trend detection per country |
| 9 | news_geo_search |
Location-specific news search |
| 10 | news_alert_create |
Create a persistent alert (sentiment / volume / keyword) |
| 11 | news_alert_list |
List configured alerts with status |
| 12 | news_alert_check |
Evaluate alerts against current data |
| 13 | news_alert_delete |
Permanently remove an alert |
| 14 | news_cache_stats |
Cache hit-rate and entries by type |
| 15 | news_cache_clear |
Clear cache (entirely or per tool type) |
Demo
"Create a media briefing for: AI in education, Volksschule Zรผrich, school digitalisation"
Data Sources
| Source | API Type | Content |
|---|---|---|
| WorldNewsAPI | REST JSON | 150+ countries, 50+ languages, full text, sentiment |
Prerequisites
- Python 3.11+
uvorpip- API key from worldnewsapi.com/console (free tier available)
Installation
# Recommended: uvx (no install step needed)
uvx news-monitor-mcp
# Alternative: pip
pip install news-monitor-mcp
Quickstart
# Start the server (stdio mode for Claude Desktop)
WORLD_NEWS_API_KEY=your-key uvx news-monitor-mcp
Try it immediately in Claude Desktop:
"Show me the top news from Switzerland today" "How is the Schulamt Zรผrich covered in German-language media this month?" "Create a media briefing on: Volksschule Zรผrich, AI in education, school digitalisation"
Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
WORLD_NEWS_API_KEY |
โ | Required. API key from worldnewsapi.com |
MCP_TRANSPORT |
stdio |
Transport: stdio or streamable_http |
MCP_HOST |
127.0.0.1 |
HTTP bind host. Use 0.0.0.0 only inside a container. |
MCP_PORT |
8000 |
Port for HTTP transport |
MCP_BEARER_TOKEN |
โ | Required in --http mode. Bearer token clients must present in Authorization: Bearer <token>. Generate via python -c "import secrets; print(secrets.token_urlsafe(32))". |
MCP_ALLOWED_ORIGINS |
โ | Optional CSV allowlist for the Origin header (DNS-rebinding protection). Example: https://claude.ai. |
LOG_LEVEL |
INFO |
Log level: DEBUG / INFO / WARNING / ERROR. Logs are emitted as JSON to stderr with automatic redaction of api-key= query params and Authorization: Bearer headers. |
NEWS_MONITOR_ALERTS_DIR |
~/.news-monitor-mcp |
Directory that holds alerts.json. The parent dir must not be a symlink (refused at startup as a defense against path-injection). File is created with mode 0o600, directory with 0o700. |
NEWS_MONITOR_ALERTS_FILE |
โ | (Back-compat) explicit path to the alerts file. Same symlink check applies. Prefer NEWS_MONITOR_ALERTS_DIR. |
MCP_ALERT_RETENTION_DAYS |
90 |
Alerts older than this many days are deleted on server start (Privacy default per docs/privacy-dsg.md). Set to 0 to disable retention. |
MCP_CACHE_MAX_PER_TYPE |
1000 |
Maximum cache entries per tool type. When exceeded, the least-recently-used entry of that type is evicted. Set to 0 to disable the cap (unbounded growth โ only safe for short-lived processes). |
MCP_CACHE_SWEEP_SECONDS |
300 |
Interval for the background task that removes TTL-expired entries from the cache. Set to 0 to disable the sweep (expired entries are still pruned lazily on news_cache_stats). |
Claude Desktop Configuration
{
"mcpServers": {
"news-monitor": {
"command": "uvx",
"args": ["news-monitor-mcp"],
"env": {
"WORLD_NEWS_API_KEY": "your-api-key-here"
}
}
}
}
Config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
After restarting Claude Desktop, all tools are available. Example queries:
- "Show me the top Swiss news today"
- "What is the media sentiment on AI in education this month?"
- "Create a weekly briefing for: Schulamt Zรผrich, Volksschule, KI Bildung"
- "Find all German-language articles about school digitalisation in the last 14 days"
- "Show me the front pages of Swiss newspapers today"
Cloud Deployment (Streamable HTTP)
For use via claude.ai in the browser (e.g. on managed workstations without local software):
Authentication is mandatory. The HTTP transport refuses any request without a valid Authorization: Bearer <token> header. Generate a token once and keep it secret:
python -c "import secrets; print(secrets.token_urlsafe(32))"
Render.com (recommended):
- Push/fork the repository to GitHub
- On render.com: New Web Service โ connect GitHub repo
- Set the following environment variables in the Render dashboard:
WORLD_NEWS_API_KEYโ your WorldNewsAPI keyMCP_BEARER_TOKENโ the token generated aboveMCP_HOST=0.0.0.0โ bind on all interfaces inside the containerMCP_ALLOWED_ORIGINS=https://claude.ai(optional, recommended)
- In claude.ai under Settings โ MCP Servers, add the URL
https://your-app.onrender.com/mcpand configure the Bearer token as the auth header.
# Local HTTP mode (binds 127.0.0.1 by default)
WORLD_NEWS_API_KEY=your-key \
MCP_BEARER_TOKEN=$(python -c "import secrets; print(secrets.token_urlsafe(32))") \
news-monitor-mcp --http --port 8000
# Verify auth is enforced
curl -i http://127.0.0.1:8000/mcp # โ 401
curl -i -H "Authorization: Bearer $MCP_BEARER_TOKEN" http://127.0.0.1:8000/mcp
Scaling notes
This server is currently single-process / single-replica:
- The TTL cache lives in process memory (
NewsCache). If you run multiple Render or Kubernetes replicas, each replica has its own cache โ hit-rates drop linearly with the replica count. - Alerts persist to a local
alerts.json(defaults to/datainside the container). Multiple replicas mounting the same persistent volume serialize viafcntl.flock, but for true cluster operation a shared store (Redis / Postgres) is needed โ see the open findingSCALE-STATEFUL. - On Render Free Tier, the container sleeps after ~15 minutes of inactivity and loses non-persistent state. Attach a Persistent Disk for
/dataif you need alerts to survive restarts. For Render Free + alerts you must accept that the cache is lost on every wake-up.
The MCP_CACHE_MAX_PER_TYPE cap (default 1000 entries / type) and the background sweep (MCP_CACHE_SWEEP_SECONDS, default 5 min) prevent the in-process cache from growing without bound.
Container image
A non-root multi-stage Dockerfile is included and built on every CI run. Inside the container the server defaults to --http, binds 0.0.0.0:8000, persists alerts under /data, and refuses to start if MCP_BEARER_TOKEN is missing.
docker build -t news-monitor-mcp .
docker run --rm -p 8000:8000 \
-e WORLD_NEWS_API_KEY=your-key \
-e MCP_BEARER_TOKEN=$(python -c "import secrets; print(secrets.token_urlsafe(32))") \
-e MCP_ALLOWED_ORIGINS=https://claude.ai \
-v news-monitor-data:/data \
news-monitor-mcp
Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Claude / AI โโโโโโถโ News Monitor MCP โโโโโโถโ WorldNewsAPI โ
โ (MCP Host) โโโโโโโ (MCP Server) โโโโโโโ REST JSON API โ
โโโโโโโโโโโโโโโโโโโ โ โ โ 150+ countries โ
โ 9 Tools โ โ 50+ languages โ
โ Stdio | Streamable HTTP โ โ Sentiment DE/EN โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Project Structure
news-monitor-mcp/
โโโ src/
โ โโโ news_monitor_mcp/
โ โโโ __init__.py
โ โโโ server.py # All 9 tools
โโโ tests/
โ โโโ __init__.py
โ โโโ test_server.py # 20 tests (unit + live)
โโโ pyproject.toml
โโโ CHANGELOG.md
โโโ CONTRIBUTING.md
โโโ LICENSE
โโโ README.md # This file (English)
โโโ README.de.md # German version
Testing
# Unit tests (no API key required)
PYTHONPATH=src pytest tests/ -m "not live"
# Integration tests (live API calls, API key required)
PYTHONPATH=src pytest tests/ -m "live"
Example Use Cases
Schulamt / Institutional Communication
"How has the Schulamt Zรผrich been portrayed in media over the last 30 days?"
โ news_sentiment_monitor(entity="Schulamt Zรผrich", language="de", days_back=30)
"Create a weekly media briefing for leadership"
โ news_media_briefing(topics=["Volksschule Zรผrich", "KI Bildung", "Schuldigitalisierung"])
"What are Swiss media reporting on school digitalisation?"
โ news_search(query="Schuldigitalisierung", language="de", source_country="ch")
KI-Fachgruppe / AI Working Group
"What are the current tech trends in Swiss press this week?"
โ news_trend_radar(category="technology", source_country="ch", language="de")
"How are AI developments in education covered internationally?"
โ news_search(query="AI education classroom", language="en", number=20)
"Compare Swiss and German media coverage of AI regulation"
โ news_search(query="KI Regulierung", source_country="ch", language="de")
โ news_search(query="KI Regulierung", source_country="de", language="de")
City Administration / Location Research
"What is being reported about Zรผrich school infrastructure?"
โ news_geo_search(location="Zรผrich", query="Schule")
"Show today's front pages of Swiss newspapers"
โ news_front_pages(source_country="ch")
โ More use cases by audience โ
Sentiment Analysis
WorldNewsAPI offers German-language sentiment analysis โ rare among news APIs:
| Score | Label | Meaning |
|---|---|---|
| > 0.3 | positiv ๐ | Positive coverage |
| โ0.3 to 0.3 | neutral ๐ | Neutral / factual coverage |
| < โ0.3 | negativ ๐ | Critical / negative coverage |
โ ๏ธ Sentiment is only available for German (de) and English (en).
Safety, Limits & Responsible Use
Read-Only Operation
12 of the 15 tools carry readOnlyHint: true. All 9 monitoring tools (search,
headlines, sentiment, briefing, article, sources, front_pages, trend, geo) are
fully read-only and issue GET requests to WorldNewsAPI only. The 3 exceptions
are local-only operations: news_alert_create and news_alert_delete (write/
delete ~/.news-monitor-mcp/alerts.json) and news_cache_clear (clears
in-memory cache). None of the 15 tools modify any external data source.
API Rate Limits
| Constraint | WorldNewsAPI Free Tier | Paid Plans |
|---|---|---|
| Calls/month | 1,000 | Up to 1M |
| Articles/call | 10 | Up to 100 |
| Historical depth | 30 days | Extended |
| Timeout per call | 30 seconds | 30 seconds |
The TTL cache (v0.2+) reduces redundant calls by up to 80%.
Data Privacy
- No personal data stored: The server holds no persistent user data. Cache entries are in-memory and reset on server restart.
- No profiling: The server retrieves publicly published journalism only. It is not designed for surveillance or personal profiling.
- Alert data: Alert configurations are stored locally in
~/.news-monitor-mcp/alerts.jsonโ on your machine only, never transmitted.
Responsible Use
- Query public news only โ do not use as a profiling tool for individuals.
- Sentiment scores reflect algorithmic analysis of journalistic tone, not verified editorial judgements.
- Results depend on WorldNewsAPI's indexing; Swiss regional media may be less well-covered than national outlets.
Terms of Service
Users must comply with:
This MCP server is an independent open-source project and is not affiliated with WorldNewsAPI.
Synergies with Other MCP Servers
news-monitor-mcp can be combined with other servers in the portfolio:
| Combination | Use Case |
|---|---|
+ fedlex-mcp |
Law meets discourse: legal framework + media coverage |
+ global-education-mcp |
OECD stats + current media context |
+ srgssr-mcp |
Swiss public media + international news comparison |
+ swiss-environment-mcp |
Environmental data + media reporting |
+ swiss-statistics-mcp |
BFS statistics + current media narrative |
+ zurich-opendata-mcp |
City data + local media coverage |
Changelog
See CHANGELOG.md
Security & Compliance
- Report vulnerabilities privately: see SECURITY.md
- Swiss public-sector deployment: see
docs/isds-klassifikation.mdfor the ISDS / Schutzbedarfsfeststellung - Swiss data protection (revDSG) โ duties, profiling, retention, drittlandtransfer:
docs/privacy-dsg.md - Audit history:
audits/
License
MIT License โ see LICENSE
Author
Hayal Oezkan ยท malkreide
Credits & Related Projects
- Data: WorldNewsAPI โ global news data with sentiment analysis
- Protocol: Model Context Protocol โ Anthropic / Linux Foundation
- Related: swiss-culture-mcp โ MCP server for Swiss cultural heritage data
- Related: srgssr-mcp โ MCP server for SRG SSR Swiss public media
- Portfolio: Swiss Public Data MCP Portfolio
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
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 news_monitor_mcp-0.3.0.tar.gz.
File metadata
- Download URL: news_monitor_mcp-0.3.0.tar.gz
- Upload date:
- Size: 167.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65299add5624c0d59a6a736247150b79f15866d42255cf027bb7429299e93b46
|
|
| MD5 |
d311095fa69c923ea51a75cb0fa47534
|
|
| BLAKE2b-256 |
4b9c54b08a7773ca14d2198175b4af9f6f503d5b0ef6d52f63972de808e275bb
|
Provenance
The following attestation bundles were made for news_monitor_mcp-0.3.0.tar.gz:
Publisher:
publish.yml on malkreide/news-monitor-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
news_monitor_mcp-0.3.0.tar.gz -
Subject digest:
65299add5624c0d59a6a736247150b79f15866d42255cf027bb7429299e93b46 - Sigstore transparency entry: 1567067422
- Sigstore integration time:
-
Permalink:
malkreide/news-monitor-mcp@31f916319f967b5f6d3a01b5d6fbbff4fbd7a0d2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/malkreide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@31f916319f967b5f6d3a01b5d6fbbff4fbd7a0d2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file news_monitor_mcp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: news_monitor_mcp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 40.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bb03580b7a6e7cb10007ede55de7d573279a206acc7292c560766b2e9de4ced
|
|
| MD5 |
2eeb3a2639496f30e9d09fdc6552e213
|
|
| BLAKE2b-256 |
1de19d133dcca45e8201c4d1d0484c5b718ba17a2179cb7b5578cbb6cf29c605
|
Provenance
The following attestation bundles were made for news_monitor_mcp-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on malkreide/news-monitor-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
news_monitor_mcp-0.3.0-py3-none-any.whl -
Subject digest:
8bb03580b7a6e7cb10007ede55de7d573279a206acc7292c560766b2e9de4ced - Sigstore transparency entry: 1567067458
- Sigstore integration time:
-
Permalink:
malkreide/news-monitor-mcp@31f916319f967b5f6d3a01b5d6fbbff4fbd7a0d2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/malkreide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@31f916319f967b5f6d3a01b5d6fbbff4fbd7a0d2 -
Trigger Event:
push
-
Statement type: