Search USGS and EMSC seismic data — real-time feeds, event queries, and earthquake counts.
Search USGS and EMSC seismic data — real-time feeds, event queries, and earthquake counts via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://earthquake.caseyjhand.com/mcp
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.
| Tool | Description |
|---|---|
earthquake_get_feed | Fetch a USGS pre-computed real-time earthquake feed by magnitude tier and time window |
earthquake_search | Search earthquakes by time range, magnitude, depth, location radius, PAGER alert level, or felt reports |
earthquake_count | Count earthquakes matching filters without fetching full records |
earthquake_get_event | Fetch complete detail for a specific earthquake by USGS event ID |
| Resource | Description |
|---|---|
earthquake://feed/{magnitude_tier}/{time_window} | USGS real-time earthquake feed as injectable context — returns the whole feed, so use the earthquake_get_feed tool for the broad tiers |
earthquake://event/{event_id} | Full USGS earthquake event detail by ID as injectable context, including the same detail product projection as earthquake_get_event |
earthquake_get_feed toolearthquake_search for historical or filtered queries)all (microseisms), 1.0, 2.5, 4.5, significant (USGS-curated by magnitude, felt reports, and PAGER impact); four time windows: hour, day, week, monthcursor: limit bounds a page (default 100, max 1000), totalCount reports the whole feed, nextCursor retrieves the rest — the broad tiers run past 10,000 events for monthearthquake_search toolusgs (global, PAGER/DYFI/ShakeMap metadata) or emsc (independent European-Mediterranean catalog, for cross-verification anywhere); USGS-only filters (alert_level, min_felt, min_significance, event_type) are dropped and named in ignoredFilters when source=emsclatitude + longitude + radius_km together for a radius search, or independently-optional min_latitude/max_latitude/min_longitude/max_longitude for a bounding box (longitude up to ±360 to cross the antimeridian); combining both intersects the twoevent_type in one vocabulary regardless of source (USGS's QuakeML names, EMSC's code decoded to match), with event_certainty alongside for EMSC; the event_type filter narrows to one value on USGStime or magnitude, ascending or descending; up to 20,000 events per call, paged with a 1-based offset forwarded straight to the upstream FDSN APItotalCount and nextOffset for the next page, or countUnavailable when the follow-up count query failed — use earthquake_count first to size the match setearthquake_count toolearthquake_search for statistical queries; same filter surface (time, magnitude, depth, location radius, bounding box, PAGER, DYFI, significance, event type)exceeds_limit flags when the count exceeds 20,000, signaling a full search would need paging; USGS returns the max_allowed cap (20,000), EMSC's count endpoint does not (max_allowed is null)start_time counts only the last 30 days — queryEcho reports the resolved window and every filter actually appliedevent_type="earthquake" on USGS to exclude themignoredFilters when source=emsc, the same as earthquake_searchearthquake_get_event tooldetail — a projection of the analysis products only the single-event response holdsdetail groups: 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 widthid field of earthquake_get_feed and earthquake_search results (e.g. us6000sznj, hv74966427)earthquake://feed/{magnitude_tier}/{time_window} resourcemagnitude_tier (all / 1.0 / 2.5 / 4.5 / significant) and time_window (hour / day / week / month)application/json, no paging — the broad combinations (all or 1.0 with week/month) can run to thousands of events; use earthquake_get_feed for thoseearthquake://event/{event_id} resourceevent_id is a USGS event ID from an earthquake_get_feed or earthquake_search resultdetail product projection (PAGER, ShakeMap, DYFI, moment tensor, ground-failure alerts, origin quality, finite-fault), omitted when USGS produced nonenot_found, source_unavailable, and source_timeout errors — the same contract as earthquake_get_eventBuilt 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:
evtype code is decoded against the published event-type/certainty nomenclature into the same vocabulary USGS publishes, so event_type carries one meaning across both sourcesAgent-friendly output:
source: "usgs" | "emsc" on every response, plus source_catalog/auth fields naming the catalog and authoritative agency, so agents can weigh two independent solutions against each otherevent_type and event_certainty travel with every event so a quarry blast or a suspected explosion is never silently read as a confirmed earthquake; exceeds_limit, countUnavailable, and truncated flags let callers branch on data instead of parsing prosenull, never a fabricated zero (tsunami, status, and mmi are always null on EMSC events); USGS-only filters dropped for an EMSC query are named in ignoredFilters rather than silently ignoredcountUnavailable rather than failing the whole searchA 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"
}
}
}
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
git clone https://github.com/cyanheads/earthquake-mcp-server.git
cd earthquake-mcp-server
bun install
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 session handling: stateful, stateless, or auto. src/index.ts declares stateless via createApp(); setting this variable overrides that. The Docker image and .env.example set it explicitly too. | 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 (Node.js only) | <project-root>/logs |
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 | 100 |
REQUEST_TIMEOUT_MS | HTTP timeout in milliseconds for upstream API calls | 10000 |
OTEL_ENABLED | Enable OpenTelemetry | false |
Empty values and unsubstituted whole-value ${…} placeholders use the defaults. See .env.example for optional overrides.
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 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.
| Directory | Purpose |
|---|---|
src/mcp-server/tools | Tool definitions (*.tool.ts). Four tools across USGS and EMSC. |
src/mcp-server/resources | Resource definitions. Feed and event resources. |
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. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for logging, ctx.state for storagecreateApp() arraysIssues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y @cyanheads/earthquake-mcp-serverMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-cyanheads-earthquake-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/earthquake-mcp-server"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceio.github.cyanheads/earthquake-mcp-server works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.