earthquake-mcp-server
Allows the MCP server to be deployed and run on Cloudflare Workers, leveraging the Workers platform for serverless execution.
Provides Supabase as a storage backend for the MCP server, enabling persistent storage of configuration or data.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
Public Hosted Server: https://earthquake.caseyjhand.com/mcp
Overview
Seismic data from USGS ComCat and the EMSC SeismicPortal. Fetch real-time earthquake feeds, search and count seismic events by time, magnitude, depth, and location, and pull full analysis detail for a single event.
Tools
Tool | Description |
| Fetch a USGS pre-computed real-time earthquake feed by magnitude tier and time window |
| Search earthquakes by time range, magnitude, depth, location radius, PAGER alert level, felt reports, or ShakeMap and DYFI intensity |
| Count earthquakes matching filters without fetching full records |
| Fetch one earthquake by USGS or EMSC event ID, with USGS analysis products and opt-in origins, magnitudes, phase arrivals, aftershock forecast, and PAGER loss estimates |
Resources
Resource | Description |
| First 100-event page of a USGS real-time feed, with an exact continuation URI |
| Continue the retained feed generation using the returned |
| One earthquake by USGS or EMSC event ID as injectable context, with the same |
Skill
Skill | Description |
Agent guide for the |
Related MCP server: quake-mcp
Capability reference
earthquake_get_feed tool
Choose a magnitude tier (
all,1.0,2.5,4.5,significant) and a window (hour,day,week,month). USGS caches these feeds; useearthquake_search_eventsfor historical or filtered queries.Returns events, page count, generation time, and source feed URL.
allincludes microseisms;significantis USGS-curated using magnitude, felt reports, and PAGER impact.Each page returns
limitevents (default 15), fewer only on the last page. Alimitabove 1,000 returns 1,000 with a notice naming the requested and applied values; withEARTHQUAKE_CLAMP_LIMITS=falseit is rejected instead.limitapplies to the first page; later pages keep the page size in the cursor.totalCountreports the whole feed; passnextCursorback unchanged with the same tier and window.Continuations read the first-read generation, unaffected by upstream edits. Retention lasts up to 15 minutes, subject to capacity eviction and restart.
cursor_expiredmeans restart without a cursor; legacy cursors must also be restarted.
earthquake_search_events tool
Search
usgsoremscby time, magnitude, depth, radius, or bounding box. A radius requireslatitude,longitude, andradius_kmtogether; box edges are independently optional, support antimeridian bounds up to ±360°, and intersect a supplied circle.Returns normalized events with
event_type, EMSC'sevent_certainty, and USGS'sassociated_ids(other network IDs merged into the event).ignoredFiltersnames unsupported filters;queryEchoreports the effective query.Both search and count accept open
magnitude_typevalues on either source; EMSC matches its own lowercase types (mb,mw) exactly and has nomww.product_type(required product, e.g.moment-tensor) andreview_status(automaticorreviewed) apply only to USGS; EMSC names them inignoredFilters. Blank values mean omitted.event_type,magnitude_type, andproduct_typestay open strings; USGS matches them case-insensitively, andevent_typetakes a comma-separated list. USGS answers a value outside its published vocabulary with zero events, so when a USGS search's first page or a USGS count comes back empty,noticenames each unlisted value and the listed values it equals once case and-,_, and spaces are ignored:product_type "moment_tensor"suggests"moment-tensor". The vocabulary read is one attempt within the call's deadline, cached for 24 hours; if it fails, the zero returns as it would without the check. EMSC publishes no vocabulary and is not checked.min_mmi(ShakeMap intensity, Modified Mercalli) andmin_cdi(DYFI community intensity), each 1–12, select events by how strongly they shook, which a magnitude floor oralert_levelmisses. Both apply only to USGS: an event without a ShakeMap or DYFI reports never matches, and EMSC names them inignoredFilters.Date-only bounds (including expanded year/year-month forms) mean midnight at the start of the named day on both sources:
2026-10-10becomes2026-10-10T00:00:00. Explicit time and timezone suffixes are preserved; unpadded date components are padded. Offsetless times use UTC for the 30-day default.queryEchoshows the exact effective bounds.Sort by time or magnitude in either direction. Each call requests
limitevents upstream (default 15, set byDEFAULT_LIMIT) and returns them all, fewer only on the last page. Alimitabove 1,000 returns 1,000 with a notice naming the requested and applied values; withEARTHQUAKE_CLAMP_LIMITS=falseit is rejected instead.queryEcho.limitreports the applied limit. Continue with the returnednextOffset(offset plus the events returned, counting from 1) and the same filters, limit, and order. Search pages read the current catalog, so upstream edits can affect later pages.Strictly inverted magnitude, depth, or explicit time bounds fail locally as
invalid_range, naming both values and recovery. Equal and single bounds remain valid; time comparisons use UTC instants, including explicit offsets. Calendar-invalid values remain for upstream rejection.A nonempty short page establishes
totalCount; an empty first page establishes zero, while an empty later page leaves the total unknown. Full pages use a count lookup, withcountUnavailableon failure. Feed, search, count, and event calls each share one 50-second deadline across their requests and retries; for search that includes the count lookup. Cancellation remains cancellation.
earthquake_count_events tool
Count matches using the same filters as
earthquake_search_events, without fetching events. Omitstart_timefor the last 30 days;queryEchoreports the resolved window and applied filters.exceeds_limitflags the 20,000-event single-request threshold, not a retrieval ceiling: search offset paging can retrieve larger match sets.max_allowedis 20,000 for USGS and null for EMSC;ignoredFiltersnames filters the source cannot apply.A USGS count of zero carries
noticewhen a suppliedevent_type,magnitude_type, orproduct_typevalue is not in the USGS vocabulary, as search's empty first page does.
earthquake_get_event tool
Pass the
idof any feed or search result. An EMSC unid from asource=emscsearch (eight digits, underscore, seven digits, e.g.20190706_0000043) is looked up on EMSC SeismicPortal; every other ID goes to USGS (e.g.us6000sznj).A USGS event returns the normalized event plus optional
detail: PAGER, ShakeMap, DYFI, moment tensor, ground-failure alerts, origin quality (includingdepth_type, which separates an assigned depth from a located one), and finite-fault dimensions. Groups are omitted when none of their projected fields is available; absence does not imply zero impact.associated_idslists the other network IDs USGS holds for the event; an alias such asus70004bn0returns the preferred event (ci38457511) with the alias listed there.An EMSC event returns the same normalized event its search result carries, with no
detailand noassociated_ids.includeopts into more for USGS events:Group
Source
Extra requests
originsEvery
originproduct in the event response, preferred firstNone
magnitudesEvent-level magnitudes from the preferred
phase-dataproduct's QuakeML, with a station count where publishedOne, shared with
arrivalsarrivalsEvery phase arrival of that document's preferred origin, joined to its pick and sorted nearest first
One, shared with
magnitudesaftershock_forecastThe USGS Operational Aftershock Forecast: each window's probability of an aftershock at or above each magnitude, its expected-count range, and the chance of one as large as the mainshock
One
pagerThe PAGER estimates behind the alert, from the preferred
losspagerproduct's JSON files: the fatality and economic-loss alert levels with every probability bracket (economic bounds in millions of USD), PAGER's impact statements, and the people exposed at each shaking intensity, in total and per countryTwo, or three when the product publishes impact statements
A requested group that is not returned is listed in
unavailable_includes:not_publishedwhen the event has no such product (every group on an EMSC event) or its product lacks the files the group reads (PAGER products published before the JSON files existed),fetch_failedwhen the download failed, returned HTML, did not parse, pointed outside the configured USGS origin, or answered with a redirect. The event,detail, and other groups still return; cancellation propagates. The event request and its product downloads share one 50-second deadline.Blank IDs fail locally; canonical IDs and aliases match case-insensitively. ShakeMap includes the producer's
code_versionwhen published.
earthquake://feed/{magnitude_tier}/{time_window} resource
Choose the same magnitude tiers and time windows as
earthquake_get_feed; all 20 combinations are listed as browsable resources.Returns 100 events per
application/jsonpage in the compact event projection, plustotalCount,truncated,nextCursor, andnext_uri. Readnext_uriverbatim until it is absent. The continuation URI isearthquake://feed/{magnitude_tier}/{time_window}/page/{cursor}.Feed resources share retained generations with
earthquake_get_feed. Cache hints are private with zero lifetime because continuation tokens belong to the requesting tenant. Upstream failures classified asServiceUnavailableexposefeed_unavailable; those classified asTimeoutexposefeed_timeout, each with recovery guidance and no captured upstream body. Availability failures preserve numeric HTTP status; HTTP 501 remains non-retryable and points to EMSC search. Other error classes propagate unchanged.
earthquake://event/{event_id} resource
Pass a USGS or EMSC
event_idfrom a feed or search result. Returns the same event and optionaldetailproducts asearthquake_get_event; it takes noinclude.Uses that tool's
event_deleted,not_found,source_unavailable, andsource_timeouterror contract.
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
USGS/EMSC-specific:
Type-safe clients for the USGS FDSN/GeoJSON API and the EMSC FDSN-WS API, normalizing both into one shared earthquake domain schema
Automatic retry with backoff and per-request timeouts on every upstream call; detects USGS's rate-limited/CDN failure mode (HTML served instead of GeoJSON) and maps it to a typed service-unavailable error instead of parsing it as data. A body that is not the expected document fails the same way without a retry, and a connection dropped mid-body is retried; neither passes parser or runtime text to the caller
EMSC's two-character
evtypecode is decoded against the published event-type/certainty nomenclature into the same vocabulary USGS publishes, soevent_typecarries one meaning across both sourcesUSGS-only filters (
alert_level,min_felt,min_significance,min_mmi,min_cdi,event_type,product_type,review_status) are named inignoredFilterswhensource=emsc. On USGS,event_type="earthquake"excludes quarry blasts and other non-tectonic records.No API key or rate-limit tier required — both USGS and EMSC are fully public, keyless APIs
Agent-friendly output:
Provenance —
source: "usgs" | "emsc"on search and count responses, plussource_catalog/authfields naming the catalog and authoritative agency, so agents can weigh two independent solutions against each otherDiscriminated output contracts —
event_typeand EMSC'sevent_certaintypreserve published classifications, with absent fields remaining unknown;exceeds_limit,countUnavailable, andtruncatedflags let callers branch on data instead of parsing proseResponse shaping — fields a source does not publish come back
null, never a fabricated zero (tsunami,status, andmmiare always null on EMSC events); USGS-only filters dropped for an EMSC query are named inignoredFiltersrather than silently ignoredGraceful degradation — an upstream rejection surfaces the service's own explanation (offending parameter, accepted format) in the error message instead of a bare status code, a failed follow-up count degrades to
countUnavailablerather than failing the whole search, and a failed product download lists itsincludegroups asfetch_failedrather than failing the event lookup
Getting started
Public Hosted Instance
A public instance is available at https://earthquake.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"earthquake-mcp-server": {
"type": "streamable-http",
"url": "https://earthquake.caseyjhand.com/mcp"
}
}
}Self-Hosted / Local
Add the following to your MCP client configuration file.
{
"mcpServers": {
"earthquake-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/earthquake-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"earthquake-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/earthquake-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"earthquake-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/earthquake-mcp-server:latest"]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.4.0 or higher.
No API keys required — USGS and EMSC data is fully public.
Installation
Clone the repository:
git clone https://github.com/cyanheads/earthquake-mcp-server.gitNavigate into the directory:
cd earthquake-mcp-serverInstall dependencies:
bun installConfiguration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:
Variable | Description | Default |
| Transport: |
|
| HTTP server port |
|
| HTTP endpoint path where the MCP server is mounted |
|
| Public origin override for TLS-terminating reverse-proxy deployments | none |
| HTTP sessions: |
|
| Authentication: |
|
| Log level ( |
|
| Opt-in Bun-only forced-GC pressure loop (ms). Try |
|
| Directory for log files on Node.js and Bun |
|
| Log failed tool arguments and results, redacted by key name. Secrets inside free-form values remain. |
|
| UTF-8 byte cap per logged failure payload |
|
| Storage backend: |
|
| USGS API base URL. Override for testing or mirroring. Product files (phase-data QuakeML, aftershock forecast, PAGER JSON) are fetched only on this origin, so a mirror must also serve them, with content URLs rewritten to its origin; otherwise those |
|
| EMSC API base URL. Override for testing or mirroring. |
|
| Events |
|
| Clamp a search or feed |
|
| Per-attempt HTTP timeout in milliseconds (1,000–120,000). Every feed, search, count, and event call also runs under one 50-second total deadline across its requests and retries. |
|
| Enable OpenTelemetry |
|
| Base URL for traces ( | none |
| Opt-in OTLP log endpoint, used as-is; the base URL never enables logs | none |
Empty values and unsubstituted whole-value ${…} placeholders use the defaults. See .env.example for optional overrides.
Running the server
Local development
Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Docker
docker build -t earthquake-mcp-server .
docker run --rm -p 3010:3010 earthquake-mcp-serverThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/earthquake-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Directory | Purpose |
| Tool definitions ( |
| Feed, feed continuation, and event resources. |
| Tenant-scoped serialized feed retention with bounded payload and metadata accounting. |
| USGS ComCat service — GeoJSON feed fetcher, FDSN query API client, and the event |
| EMSC SeismicPortal service — FDSN event search, count, and by-ID lookup. |
| Server-specific environment variable parsing and validation with Zod. |
| Unit and integration tests, mirroring the |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging,ctx.statefor storageRegister new tools and resources in the
createApp()arraysValidate upstream data, normalize to domain types, and preserve missing values rather than inventing facts
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
USGS Earthquake Catalog MCP (FDSNWS event API).
Query official USGS real-time earthquake events, magnitudes, and seismic hazard telemetry.
EMSC (European-Mediterranean Seismological Centre) MCP — wraps the seismicportal.eu FDSN event web…
Real-time earthquake events from the US Geological Survey
Related MCP Servers
AlicenseAqualityCmaintenanceAn MCP server for querying the FDSN Web Service Event APIs of multiple seismological datacenters and retrieving earthquake information as JSON.62AGPL 3.0- AlicenseAqualityCmaintenanceMCP server wrapping the USGS Earthquake Hazards API, enabling AI assistants to search the global earthquake catalog, look up event details, count quakes, find 'Did You Feel It' reports, and read realtime feeds.5MIT
- AlicenseAqualityDmaintenanceReal-time earthquake data and seismic monitoring for AI agents via the USGS Earthquake Catalog API.8MIT
- FlicenseAqualityDmaintenanceExposes live earth-science data (e.g., earthquakes from USGS) as tools for MCP-compatible AI agents, enabling them to fetch and reason about real-time geophysical events.1-