Labsco
MCP SERVER

Pikud Haoref Real-Time Alert System

by LeonMelamud

Israeli Home Front Command alerts in an assistant — current alerts, filtered history with Hebrew city matching, and the health of the live stream behind it.

News, Feeds & Trend Monitoring
Summary
Check the connection before you trust the silence.

The tools read from a subscribed stream rather than polling on demand, which is what makes them fast — and it means a dropped subscription looks exactly like a quiet day. That is what the status tool is for, and it is worth asking for it alongside any "is anything happening" question. The geo-block is the hard constraint: there is no configuration that makes this work from outside Israel.

What it is

Two services in one repository: a FastAPI middleware that polls the official Pikud Haoref alerts feed and republishes it as a Server-Sent Events stream, and an MCP server that subscribes to that stream. The split means one poller serves every consumer instead of each client hitting the government API itself.

What you get
  • `check_current_alerts` — whether anything is active right now, read from the subscribed stream rather than a fresh poll
  • `get_alert_history` — recent alerts with a `limit` between 1 and 50, a `region` filter, and a `cities` list
  • City matching that handles how these alerts are actually written: exact substring matching, so `תל אביב` finds every Tel Aviv district, fuzzy matching at threshold 60 for partial or near names, and several cities searched at once
  • `get_connection_status` — whether the subscription is live, for when silence might mean no alerts or might mean a dropped stream
  • Two resources: `poha://alerts/recent` for the alert data as JSON and `poha://alerts/current-status` for system state
  • Alerts covering rocket warnings, aerial intrusions, earthquakes and other emergencies, with automatic reconnection on the SSE side
Requirements

An Israeli IP address — the official API geo-blocks everyone else, so this runs either on a machine in Israel or on a GCP `me-west1` VM, and nowhere else. `make deploy` builds and starts the three containers and health-checks them; the MCP server then answers at `http://localhost:8001/mcp`, which is what you add to your client as an HTTP server, with FastAPI and its Swagger UI on 8000 and the SSE gateway on 8002. Both SSE endpoints require an `X-API-Key` header. Optionally set `GEOIP_DB_PATH` to a MaxMind GeoLite2 database to restrict access to Israeli addresses. Without Docker, the three processes run separately with uvicorn. Package `pikud-haoref-alerts`.