Labsco
MCP SERVER

Pikud Haoref Real-Time Alert System

by LeonMelamud

Real-time Israeli Home Front Command alerts, subscribed once and queried by city — including in Hebrew.

News, Feeds & Trend Monitoring
Summary
Where you run it decides whether it works at all.

The upstream source geo-blocks non-Israeli addresses. That is not a configuration you can override — the machine has to have an Israeli IP, which in practice means running it locally in Israel or on a free-tier GCP e2-micro instance in the me-west1 region. Sort that out before anything else; the rest of the setup is a single make command. Test alerts are built in, so you can prove the path works without waiting for a real event.

What it is

A pair of services: a poller that reads the official Pikud Haoref alert feed and republishes it as a Server-Sent Events stream, and an MCP server that subscribes to that stream once and answers questions from it. One source is polled instead of one per client.

What you get
  • `check_current_alerts` reports whether anything is active on the subscribed stream right now
  • `get_alert_history` returns recent alerts with filtering — a limit between 1 and 50, a region, or a list of cities
  • City matching handles Hebrew names by substring, so one city name finds every district within it, and falls back to fuzzy matching with a threshold of 60 for near-misses; several cities can be searched at once
  • `get_connection_status` tells you whether the subscription is live, which is the first thing to check when nothing is coming through
  • `get_city_alerts` and `get_db_stats` query the local SQLite store, which keeps full alert data and a denormalised city table indexed for fast lookup
  • Two resources, `poha://alerts/recent` and `poha://alerts/current-status`
Requirements

Docker — `make deploy` builds and starts three containers and health-checks them. The MCP server listens over HTTP at port 8001 under /mcp; the alert poller is on 8000 and an SSE relay on 8002. Both SSE endpoints require an API key in an X-API-Key header, set through API_KEY in the environment file. Geo-restriction to Israeli addresses is optional and needs a MaxMind GeoLite2 database at GEOIP_DB_PATH.