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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@earthquake-mcp-servershow recent earthquakes in California"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
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, or felt reports |
| Count earthquakes matching filters without fetching full records |
| Fetch complete detail for a specific earthquake by USGS event ID |
Resources
Resource | Description |
| USGS real-time earthquake feed as injectable context — returns the whole feed, so use the |
| Full USGS earthquake event detail by ID as injectable context, including the same |
Related MCP server: usgs-earthquakes
Capability reference
earthquake_get_feed tool
CDN-cached by USGS — faster and more available than the FDSN query API; best for real-time "what's happening now" queries (use
earthquake_searchfor historical or filtered queries)Five magnitude tiers:
all(microseisms),1.0,2.5,4.5,significant(USGS-curated by magnitude, felt reports, and PAGER impact); four time windows:hour,day,week,monthReturns event list with counts and the source feed URL
Paged with an opaque
cursor:limitbounds a page (default 100, max 1000),totalCountreports the whole feed,nextCursorretrieves the rest — the broad tiers run past 10,000 events formonth
earthquake_search tool
Dual-source:
usgs(global, PAGER/DYFI/ShakeMap metadata) oremsc(independent European-Mediterranean catalog, for cross-verification anywhere); USGS-only filters (alert_level,min_felt,min_significance,event_type) are dropped and named inignoredFilterswhensource=emscLocation filters:
latitude+longitude+radius_kmtogether for a radius search, or independently-optionalmin_latitude/max_latitude/min_longitude/max_longitudefor a bounding box (longitude up to ±360 to cross the antimeridian); combining both intersects the twoEvery event carries
event_typein one vocabulary regardless of source (USGS's QuakeML names, EMSC's code decoded to match), withevent_certaintyalongside for EMSC; theevent_typefilter narrows to one value on USGSSort by
timeormagnitude, ascending or descending; up to 20,000 events per call, paged with a 1-basedoffsetforwarded straight to the upstream FDSN APIA capped result carries
totalCountandnextOffsetfor the next page, orcountUnavailablewhen the follow-up count query failed — useearthquake_countfirst to size the match set
earthquake_count tool
Lightweight alternative to
earthquake_searchfor statistical queries; same filter surface (time, magnitude, depth, location radius, bounding box, PAGER, DYFI, significance, event type)exceeds_limitflags when the count exceeds 20,000, signaling a full search would need paging; USGS returns themax_allowedcap (20,000), EMSC's count endpoint does not (max_allowedis null)Omitting
start_timecounts only the last 30 days —queryEchoreports the resolved window and every filter actually appliedA radius over a mining region counts quarry blasts alongside earthquakes — pass
event_type="earthquake"on USGS to exclude themUSGS-specific filters are dropped and named in
ignoredFilterswhensource=emsc, the same asearthquake_search
earthquake_get_event tool
Returns the normalized event a search result already carries, plus
detail— a projection of the analysis products only the single-event response holdsdetailgroups: PAGER alert and report link, ShakeMap peak MMI/PGA/PGV and intensity map, DYFI response count and max CDI, moment-tensor scalar moment and nodal planes, landslide and liquefaction alerts, origin quality (azimuthal gap, station count, location and depth uncertainty), finite-fault rupture length and widthA group is omitted when USGS produced no such product — a small automatic event usually has none, a large reviewed one has most of them
Event IDs appear in the
idfield ofearthquake_get_feedandearthquake_searchresults (e.g.us6000sznj,hv74966427)USGS-only — EMSC events have no per-event detail endpoint
earthquake://feed/{magnitude_tier}/{time_window} resource
Path params:
magnitude_tier(all/1.0/2.5/4.5/significant) andtime_window(hour/day/week/month)Returns the whole feed in one read as
application/json, no paging — the broad combinations (allor1.0withweek/month) can run to thousands of events; useearthquake_get_feedfor thoseCached 60 seconds, public scope — USGS regenerates the underlying feed about once a minute
Lists all 20 tier/window combinations as browsable resources
earthquake://event/{event_id} resource
event_idis a USGS event ID from anearthquake_get_feedorearthquake_searchresultReturns the same normalized event plus the
detailproduct projection (PAGER, ShakeMap, DYFI, moment tensor, ground-failure alerts, origin quality, finite-fault), omitted when USGS produced noneTyped
not_found,source_unavailable, andsource_timeouterrors — the same contract asearthquake_get_event
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
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 sourcesNo API key or rate-limit tier required — both USGS and EMSC are fully public, keyless APIs
Agent-friendly output:
Provenance —
source: "usgs" | "emsc"on every response, plussource_catalog/authfields naming the catalog and authoritative agency, so agents can weigh two independent solutions against each otherDiscriminated output contracts —
event_typeandevent_certaintytravel with every event so a quarry blast or a suspected explosion is never silently read as a confirmed earthquake;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, and a failed follow-up count degrades to
countUnavailablerather than failing the whole search
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 session handling: |
|
| Authentication: |
|
| Log level ( |
|
| Opt-in Bun-only forced-GC pressure loop (ms). Try |
|
| Directory for log files (Node.js only) |
|
| Storage backend: |
|
| USGS API base URL. Override for testing or mirroring. |
|
| EMSC API base URL. Override for testing or mirroring. |
|
| Default result limit for |
|
| HTTP timeout in milliseconds for upstream API calls |
|
| Enable OpenTelemetry |
|
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 ( |
| Resource definitions. Feed and event resources. |
| USGS ComCat service — GeoJSON feed fetcher and FDSN query API client. |
| EMSC SeismicPortal service — FDSN event search and count endpoints. |
| 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).
EMSC (European-Mediterranean Seismological Centre) MCP — wraps the
Real-time earthquake events from the US Geological Survey
Geospatial MCP server for earthquake, tsunami, volcano, disaster, and FX data queries.
Related MCP Servers
AlicenseAqualityBmaintenanceAn MCP server for querying the FDSN Web Service Event APIs of multiple seismological datacenters and retrieving earthquake information as JSON.62AGPL 3.0- AlicenseNot gradedqualityCmaintenanceProvides access to the USGS Earthquake Catalog for querying earthquake events via the FDSNWS API, enabling natural language questions about earthquake data.3 npmMIT
- 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