io.github.cyanheads/earthquake-mcp-server
Search USGS and EMSC seismic data — real-time feeds, event queries, and earthquake counts.
Que pouvez-vous faire avec io.github.cyanheads/earthquake-mcp-server ?
- 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 sources - USGS-only filters (
alert_level,min_felt,min_significance,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
- 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 other - Discriminated 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 prose - Response 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 ign...
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
claude mcp add --transport http earthquake-mcp-server 'https://earthquake.caseyjhand.com/mcp'
{
"mcpServers": {
"earthquake-mcp-server": {
"type": "http",
"url": "https://earthquake.caseyjhand.com/mcp"
}
}
}
@cyanheads/earthquake-mcp-serverclaude mcp add earthquake-mcp-server -e 'MCP_LOG_LEVEL=info' -e 'USGS_BASE_URL=https://earthquake.usgs.gov' -e 'EMSC_BASE_URL=https://www.seismicportal.eu' -e 'DEFAULT_LIMIT=15' -e 'REQUEST_TIMEOUT_MS=10000' -e 'EARTHQUAKE_CLAMP_LIMITS=true' -- npx -y @cyanheads/earthquake-mcp-server@0.5.0
{
"mcpServers": {
"earthquake-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/earthquake-mcp-server@0.5.0"
],
"env": {
"MCP_LOG_LEVEL": "info",
"USGS_BASE_URL": "https://earthquake.usgs.gov",
"EMSC_BASE_URL": "https://www.seismicportal.eu",
"DEFAULT_LIMIT": "15",
"REQUEST_TIMEOUT_MS": "10000",
"EARTHQUAKE_CLAMP_LIMITS": "true"
}
}
}
}
Variables d'environnement
MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').USGS_BASE_URLUSGS API base URL. Override for testing or mirroring.EMSC_BASE_URLEMSC API base URL. Override for testing or mirroring.DEFAULT_LIMITEvents earthquake_search_events returns when a call omits limit (1-1000).REQUEST_TIMEOUT_MSPer-attempt HTTP timeout in milliseconds (1000-120000). Feed, search, and event calls also share a 50-second total deadline across every request and retry; standalone count calls use this per-attempt value.EARTHQUAKE_CLAMP_LIMITSClamp a search or feed limit above 1000 to 1000 with a notice. Set false to advertise and enforce a maximum of 1000 instead.
@cyanheads/earthquake-mcp-serverclaude mcp add earthquake-mcp-server -e 'MCP_HTTP_HOST=127.0.0.1' -e 'MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE>' -e 'MCP_HTTP_PORT=3010' -e 'MCP_HTTP_ENDPOINT_PATH=/mcp' -e 'MCP_AUTH_MODE=none' -e 'MCP_LOG_LEVEL=info' -- npx -y @cyanheads/earthquake-mcp-server@0.5.0
{
"mcpServers": {
"earthquake-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/earthquake-mcp-server@0.5.0"
],
"env": {
"MCP_HTTP_HOST": "127.0.0.1",
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>",
"MCP_HTTP_PORT": "3010",
"MCP_HTTP_ENDPOINT_PATH": "/mcp",
"MCP_AUTH_MODE": "none",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Variables d'environnement
MCP_HTTP_HOSTThe hostname for the HTTP server.MCP_TRANSPORT_TYPESelects the HTTP transport.MCP_HTTP_PORTThe port to run the HTTP server on.MCP_HTTP_ENDPOINT_PATHThe endpoint path for the MCP server.MCP_AUTH_MODEAuthentication mode to use: 'none', 'jwt', or 'oauth'.MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
Sommaire
@cyanheads/earthquake-mcp-server
Search USGS and EMSC seismic data — real-time feeds, event queries, and earthquake counts via MCP. STDIO or Streamable HTTP.
4 Tools • 3 Resources
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 |
|---|---|
earthquake_get_feed | Fetch a USGS pre-computed real-time earthquake feed by magnitude tier and time window |
earthquake_search_events | Search earthquakes by time range, magnitude, depth, location radius, PAGER alert level, or felt reports |
earthquake_count_events | Count earthquakes matching filters without fetching full records |
earthquake_get_event | Fetch complete detail for a specific earthquake by USGS event ID |
Resources
| Resource | Description |
|---|---|
earthquake://feed/{magnitude_tier}/{time_window} | First bounded page of a USGS real-time feed, with an exact continuation URI |
earthquake://feed/{magnitude_tier}/{time_window}/page/{cursor} | Continue the retained feed generation using the returned next_uri |
earthquake://event/{event_id} | Full USGS earthquake event detail by ID as injectable context, including the same detail product projection as earthquake_get_event |
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. limitdefaults to 100 and accepts up to 1000. Pages fit a 24,000-byte serialized result, so they can contain fewer events.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_typeand EMSC'sevent_certainty.ignoredFiltersnames unsupported filters;queryEchoreports the effective query. - Both search and count accept open
magnitude_typevalues on either source.product_type(required product, e.g.moment-tensor) andreview_status(automaticorreviewed) apply only to USGS; EMSC names them inignoredFilters. Blank values mean omitted. - 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.
limitdefaults to 100 and accepts up to 20,000; each call fetches at most 100 candidates and returns a 24,000-byte serialized page. Paging uses the exact returnednextOffset, counting from 1, with the same filters and order.queryEcho.limitreports the effective upstream candidate limit. 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 upstream page establishes
totalCountbefore byte shaping; an empty first page establishes zero, while an empty later page leaves the total unknown. Full upstream pages use a count lookup, withcountUnavailableon failure. Feed and search requests share a 50-second deadline across retries; search includes its optional 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.
earthquake_get_event tool
- Pass a USGS
event_idfrom theidfield of a feed or USGS search result (e.g.us6000sznj). This tool currently accepts USGS IDs only. - Returns the normalized event plus optional
detail: PAGER, ShakeMap, DYFI, moment tensor, ground-failure alerts, origin quality, and finite-fault dimensions. Groups are omitted when none of their projected fields is available; absence does not imply zero impact. - 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 a bounded
application/jsonpage using the existing 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
event_idfrom a feed or search result. Returns the same event and optionaldetailproducts asearthquake_get_event. - 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
- 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 sources - USGS-only filters (
alert_level,min_felt,min_significance,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 every response, plussource_catalog/authfields naming the catalog and authoritative agency, so agents can weigh two independent solutions against each other - Discriminated 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 prose - Response 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 ignored - Graceful 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/mcp
Prerequisites
- 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.git
- Navigate into the directory:
cd earthquake-mcp-server
- Install dependencies:
bun install
Configuration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT_TYPE | Transport: stdio or http | stdio |
MCP_HTTP_PORT | HTTP server port | 3010 |
MCP_HTTP_ENDPOINT_PATH | HTTP endpoint path where the MCP server is mounted | /mcp |
MCP_PUBLIC_URL | Public origin override for TLS-terminating reverse-proxy deployments | none |
MCP_SESSION_MODE | HTTP sessions: stateful, stateless, or auto (resolves to stateful). Overrides the createApp() declaration; Docker and .env.example also pin stateless. | stateless (declared in src/index.ts) |
MCP_AUTH_MODE | Authentication: none, jwt, or oauth | none |
MCP_LOG_LEVEL | Log level (debug, info, warning, error, etc.) | info |
MCP_GC_PRESSURE_INTERVAL_MS | Opt-in Bun-only forced-GC pressure loop (ms). Try 60000 if heap growth is observed under sustained HTTP load. | 0 (disabled) |
LOGS_DIR | Directory for log files on Node.js and Bun | <project-root>/logs |
LOG_TOOL_FAILURE_PAYLOADS | Log failed tool arguments and results, redacted by key name. Secrets inside free-form values remain. | false |
LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES | UTF-8 byte cap per logged failure payload | 16384 |
STORAGE_PROVIDER_TYPE | Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1 | in-memory |
USGS_BASE_URL | USGS API base URL. Override for testing or mirroring. | https://earthquake.usgs.gov |
EMSC_BASE_URL | EMSC API base URL. Override for testing or mirroring. | https://www.seismicportal.eu |
DEFAULT_LIMIT | Default result limit for earthquake_search_events | 100 |
REQUEST_TIMEOUT_MS | Per-attempt HTTP timeout in milliseconds; feed/search also share a 50-second total cap. Standalone event/count calls use this per-attempt value. | 10000 |
OTEL_ENABLED | Enable OpenTelemetry | false |
OTEL_EXPORTER_OTLP_ENDPOINT | Base URL for traces (/v1/traces) and metrics (/v1/metrics); signal-specific endpoint variables override it | none |
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | 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:stdio - Run 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-server
The 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 |
|---|---|
src/mcp-server/tools | Tool definitions (*.tool.ts). Four tools across USGS and EMSC. |
src/mcp-server/resources | Feed, feed continuation, and event resources. |
src/services/feed-snapshots.ts | Tenant-scoped serialized feed retention with bounded payload and metadata accounting. |
src/services/usgs | USGS ComCat service — GeoJSON feed fetcher and FDSN query API client. |
src/services/emsc | EMSC SeismicPortal service — FDSN event search and count endpoints. |
src/config | Server-specific environment variable parsing and validation with Zod. |
tests/ | Unit and integration tests, mirroring the src/ structure. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor logging,ctx.statefor storage - Register new tools and resources in the
createApp()arrays - Validate 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 test
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Questions fréquentes
Qu'est-ce que io.github.cyanheads/earthquake-mcp-server ?
Search USGS and EMSC seismic data — real-time feeds, event queries, and earthquake counts.
Comment installer io.github.cyanheads/earthquake-mcp-server ?
Il fonctionne comme serveur distant. Dans Claude Code : claude mcp add --transport http earthquake-mcp-server 'https://earthquake.caseyjhand.com/mcp'. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour io.github.cyanheads/earthquake-mcp-server ?
Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.
io.github.cyanheads/earthquake-mcp-server est-il open source ?
Oui. Son code est sur GitHub sous licence Apache-2.0.
Qui maintient io.github.cyanheads/earthquake-mcp-server ?
Il est publié par cyanheads. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.