TMD Earthquake MCP Server Real Time Monitoring
Monitor real-time earthquakes on the TMD MCP server with magnitude filters, location search (Thai/EN), today's events, alerts and global/regional stats.
Overview
This MCP (Model Context Protocol) server provides real-time monitoring of earthquake data collected and served by the Thai Meteorological Department (TMD). It aggregates seismic events and exposes them in a developer-friendly API so applications can filter by magnitude, search by location (Thai and English names), fetch today’s events, receive alerts, and query regional or global statistics.
The server is useful for building dashboards, alerting systems, and location-aware services (mobile apps, websites, operations centers). By providing structured endpoints and real-time feeds, it removes the need to poll raw data sources and simplifies integration with monitoring workflows and downstream analytics.
Features
- Real-time earthquake event stream (push or poll)
- Magnitude-based filtering (min/max magnitude)
- Location search supporting both Thai and English names
- Pre-filtered “today’s events” endpoint
- Alerts endpoint for events that cross thresholds
- Global and regional statistics (counts, magnitude aggregates)
- Simple HTTP/JSON API suitable for dashboards and webhooks
- Configurable via environment variables or Docker
Installation / Configuration
Clone the repository and run locally (Node.js-based example):
# install dependencies (Node.js)
# create .env (see sample below), then start
Run with Docker:
# build and run
Sample .env file (replace values to match your environment):
PORT=3000
DATA_SOURCE_URL=https://tmd.example/api/seismic
MIN_MAG_ALERT=4.5
REGION=thailand
DEFAULT_LANG=en
Configuration options typically include:
- PORT: HTTP port to listen on
- DATA_SOURCE_URL: upstream data feed or MCP registry
- MIN_MAG_ALERT: magnitude threshold that triggers alerts
- REGION: region code used for regional stats
- DEFAULT_LANG: language for location search fallback (en/th)
Available Resources
- Source code and issues: https://github.com/amornpan/tmd-earthquake-server-1.0
- API surface: HTTP/JSON endpoints (examples below)
- Example integrations: use cases for dashboards, Slack/email webhooks, and location-aware apps
If the project includes a Postman collection or OpenAPI/Swagger spec, import that into your tooling for quick testing.
API Endpoints (examples)
The server exposes REST endpoints to read events and stats. Exact paths may vary; adjust to your deployed base URL.
| Endpoint | Method | Description |
|---|---|---|
| /api/events | GET | Query events with filters (magnitude, time range, bbox, location) |
| /api/events/today | GET | Events that occurred today (server timezone) |
| /api/search | GET | Location search (q parameter, supports Thai/EN) |
| /api/alerts | GET | Recent alerts exceeding configured thresholds |
| /api/stats | GET | Global/regional statistics (counts, max magnitude) |
Example queries:
- Get events magnitude ≥ 4.5:
- Search for Chiang Mai (English):
- Search for เชียงใหม่ (Thai):
- Today’s events:
- Get regional stats (e.g., Thailand):
Use Cases
Dashboard: Build a live map that subscribes to the server and applies magnitude filters client-side. Example: query /api/events?min_magnitude=3 and plot coordinates on Leaflet or Mapbox.
Alerting pipeline: Use /api/alerts or poll /api/events for magnitudes above threshold. Forward urgent events to Slack, SMS, or email via a small worker:
# pseudo flow
if
Location-aware notifications: Mobile apps can search by Thai/EN place names using /api/search?q=…, then request nearby events by latitude/longitude and radius to notify users in that area.
Daily summaries and analytics: Cron job that fetches /api/events/today and /api/stats to generate end-of-day reports, charts, or CSV exports for operational review.
Tips for Developers
- Use the DEFAULT_LANG and lang query parameter to control language fallback when performing location searches.
- Cache region statistics where appropriate; stats are inexpensive but can be aggregated on your side for dashboards.
- Respect rate limits (if the deployment or upstream imposes them); prefer WebSocket or SSE feeds for high-frequency updates when available.
- Check the GitHub repo for updates, issues, and example client code.
For full implementation details, sample clients, and issue tracking, see the project repository: https://github.com/amornpan/tmd-earthquake-server-1.0