earth-data-mcp

earth-data-mcp

An MCP server that makes live Earth data usable by AI agents. Its initial data sources cover natural hazards: earthquakes from the USGS FDSN event catalog and volcanic activity from the Smithsonian Global Volcanism Program.

Category
访问服务器

README

earth-data-mcp

An MCP server that makes live Earth data usable by AI agents. Its initial data sources cover natural hazards: earthquakes from the USGS FDSN event catalog and volcanic activity from the Smithsonian Global Volcanism Program.

It is deliberately multi-consumer. The same server backs an unattended Discord bot and an interactive Claude Code session — one tool definition, two callers, one place to fix a bug. That is the argument for MCP here; wrapping an API in a protocol for a single client would just be a network hop with extra steps.

Tools

Parameterised queries the model composes per question.

Tool Purpose
search_earthquakes Query the USGS catalog by magnitude, time window, and location radius.
get_earthquake Full detail for one event, by USGS event id.
search_volcanic_activity Current Weekly Volcanic Activity Report, optionally filtered by volcano or country.

Every search_earthquakes call maps onto documented FDSN parameters and is echoed back in the response under query, so any result can be replayed as a plain URL and checked against the raw feed. That property is what makes the eval (below) possible.

Resources

Whole documents, no arguments — the model doesn't decide anything to fetch them, so they don't belong in the tool surface.

URI Contents
hazard://earthquakes/significant-week USGS curated significant-events feed, past 7 days.
hazard://volcanoes/weekly-report The full current GVP weekly report, unfiltered.

Usage

Two transports, one server definition (src/server.js).

bun install
bun run start      # stdio — local clients spawn the process
bun run start:http # HTTP  — remote and serverless clients connect to it

Register it with Claude Code (stdio):

claude mcp add earth-data -- bun /absolute/path/to/earth-data-mcp/src/index.js

The HTTP mode listens on PORT (default 3000) at /mcp, plus /health for liveness probes. It runs stateless — a fresh server and transport per request — so concurrent clients cannot observe each other and a dropped connection leaves nothing to clean up. That also makes it deployable to any serverless platform without sticky sessions.

The transport choice is a deployment concern, not a design one: stdio requires the client to spawn the process, which a serverless function cannot reasonably do per invocation.

Hosting it

GitHub Pages cannot host this. Pages serves static files with no server-side execution; MCP over Streamable HTTP needs a live process to answer POSTs. The same rules out any purely static host.

What works, all with usable free tiers:

Host Notes
Vercel api/mcp.js + vercel.json are already in this repo — vercel deploy works as-is
Cloudflare Workers Needs a Workers-flavoured entry point instead of api/mcp.js
Deno Deploy Needs a Deno-flavoured entry point
Render / Fly.io Run bun run start:http as a long-lived process

Deploying to Vercel:

bunx vercel deploy --prod    # → https://<project>.vercel.app/mcp

vercel.json selects Vercel's Bun runtime, and bun.lock makes Vercel use Bun to install dependencies.

There is nothing to configure: the server holds no secrets and needs no environment variables, because every upstream it talks to is a public, unauthenticated feed. /api/mcp?health returns a liveness probe.

The serverless entry (api/mcp.js) and the long-running entry (src/index.js) share src/server.js, so the tool surface cannot drift between them.

This endpoint is public and unauthenticated once deployed. That is acceptable here — it is a thin, read-only, cached proxy in front of two public feeds, so it exposes nothing that isn't already public and cannot be used to mutate anything. It is not a template for a server that touches private data: that one needs auth on the transport before it goes anywhere near the internet.

Eval

eval/ measures whether an agent given only these tools and a question (1) picks the right tool, (2) parameterises it correctly, and (3) reports an answer consistent with the raw upstream data.

ANTHROPIC_API_KEY=... bun run eval
MODEL=claude-opus-4-8 EFFORT=high RUNS=3 bun run eval    # sweep settings
MOCK=1 bun run eval                                      # exercise the harness, no tokens

Design decisions worth stating:

  • Deterministic scoring, no LLM judge. Every check is a predicate over recorded tool calls or a comparison against ground truth. Where an objective check is available it beats a graded opinion: reproducible, free, and it cannot itself hallucinate.
  • Ground truth is fetched at run time, never hardcoded. Seismic data changes hourly; a fixed expected answer would rot within a day and the eval would start reporting failures that aren't real.
  • Argument checks are predicates, not exact matches. There is no single correct radius for "near Tokyo". A grader demanding one measures obedience to an arbitrary convention, not competence — so the assertion is that each argument falls in the band that answers the question (centre within 3° of Tokyo, radius 50–2000 km, window within 2 days of 7 days back).
  • Negative cases carry equal weight. A definitional question that triggers a live API call is a failure, and so is answering half a two-part question. Over-triggering costs latency and tokens on every conversational aside.
  • RUNS=n measures consistency, not just correctness. Non-determinism is the central problem with LLM evals; a single green run says little. The report shows per-check pass rates across runs.
  • MOCK=1 runs a deliberately imperfect scripted agent (eval/mock-agent.js) that plants a known failure in each dimension. A scorer that has only ever seen passing input is not known to discriminate.

The suite exits non-zero on any failure, so it drops into CI unchanged.

Operational notes

Read-only public data, so there is no auth and no persistence — a deliberate scope limit, not a gap. What the server does handle:

  • Caching. 5-minute TTL on earthquake queries, 1 hour on the weekly volcano report (which only changes weekly). Agents re-ask the same question often.
  • Upstream failure. 4xx is a bad query and surfaces immediately; 5xx and network errors get one retry, then report. Retrying a real outage twice is just hammering the origin.
  • Timeouts. 10s per request, so a hung feed can't wedge the agent loop.
  • Errors as tool results. Upstream failures come back as isError tool results, not transport crashes — an agent that reads "USGS is down" can say so; one that sees a dead server cannot.

Design notes

Tools vs. resources. The split is whether the model has a decision to make. A magnitude threshold and a time window are decisions, so they are tool arguments. "The current weekly report" is not, so it is a resource.

Argument validation over silent defaults. A partial latitude/longitude/ radius_km triple is rejected rather than quietly falling back to a worldwide search. A tool that silently answers a different question than the one asked is worse than one that fails.

Response shaping. A raw USGS feature carries ~30 fields, most of them internal bookkeeping. Each event is flattened to the dozen that matter. Context spent on properties.detail URLs is context not spent on the answer.

Data sources

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选