home / mcp / pikud haoref real-time alert system mcp server
Provides real-time Israeli emergency alerts via a FastAPI middleware and an MCP Server with city-aware filtering and SSE streaming.
Configuration
View docs{
"mcpServers": {
"leonmelamud-pikud-a-oref-mcp": {
"url": "http://127.0.0.1:8001/mcp",
"headers": {
"API_KEY": "YOUR_API_KEY_PLACEHOLDER",
"GEOIP_DB_PATH": "/path/to/GeoLite2-Country.mmdb"
}
}
}
}You can access Israeli emergency alerts in real time through a fast, reliable MCP server setup that publishes alerts from the Pikud Haoref API to AI assistants and other subscribers. This solution uses a FastAPI middleware for polling and SSE streaming, plus an MCP server that offers tools to query current alerts, view history with smart city filtering, and check connection status.
Connect your MCP client to the local MCP endpoint to receive real-time alerts. The MCP server exposes an HTTP transport at http://localhost:8001/mcp, which your MCP client can subscribe to for live alert data. You can interact with three built-in tools to query alerts and status, and you can access two resources that expose recent alerts and system status.
Prerequisites: you need Python and Docker for a streamlined setup, plus an MCP client to consume the HTTP endpoint.
# Install Python dependencies
pip install -r requirements.txt
# Optional: build and run all services with Docker (FastAPI, MCP server, SSE gateway)
make up
# If you want to see logs for all services in real time
make logs
# Check the status and ports
make statusConfigure environment variables for the FastAPI service to secure endpoints and optionally enforce geo-restriction.
# Required for FastAPI SSE endpoints
API_KEY=your-secure-api-key-here
# Optional - Enable geo-restriction (GeoLite2 database path)
GEOIP_DB_PATH=/path/to/GeoLite2-Country.mmdbStart the multi-service environment to run the FastAPI service, MCP server, and SSE gateway. The MCP server will be available to your MCP client as an HTTP transport.
# Start all 3 services (FastAPI:8000 + MCP:8001 + SSE Gateway:8002)
make up
# View logs for all services
make logs
# Check status and ports
make status- FastAPI Swagger: http://localhost:8000/docs - MCP Endpoint: http://localhost:8001/mcp - SSE Gateway: http://localhost:8002 - FastAPI alerts stream (client): http://localhost:8000/api/alerts-stream - Internal webhook for MCP: http://localhost:8000/api/webhook/alerts
All client endpoints require an API key via the X-API-Key header for security. The MCP server connects to the internal webhook endpoint using the same API key. You can optionally enable geo-restriction by providing a GeoIP database path to limit access to Israeli IP addresses.
Configure your MCP client to use the local MCP server as an HTTP transport. Use the following configuration as a starting point in your MCP client settings to connect to the local MCP server.
{
"mcpServers": {
"poha_alerts": {
"type": "http",
"url": "http://127.0.0.1:8001/mcp",
"args": []
}
}
}Check for active alerts from the subscribed SSE stream to see current emergencies in real time.
Retrieve recent alerts with optional filtering by region, cities, and a limit from 1 to 50. Supports exact and fuzzy city matching across Hebrew city names.
Verify the SSE subscription connection status and overall system health.