Skip to main content
Glama
README.md
# @pipeworx/nasa-firms

Satellite active-fire detections from NASA FIRMS — every pixel MODIS or VIIRS
measured as actively burning, published within ~3 hours of satellite overpass.

Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1865+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.

## Tools

- `firms_hotspots_area(bbox, source?, day_range?, date?, limit?)` — detections inside a
  bounding box. `bbox` is `west,south,east,north` in degrees, or `"world"`.
- `firms_hotspots_near(latitude, longitude, radius_km?, source?, day_range?, date?)` —
  detections around a point, sorted nearest first with `distance_km`.
- `firms_data_availability(source?)` — first and last date each sensor product covers.
  Call it before a historical query so an empty result can be read as "outside the
  archive" rather than "no fires".

## Auth

BYO only. FIRMS requires a MAP_KEY and publishes no keyless or demo path —
verified 2026-09-17: every route answers `Invalid MAP_KEY.` (HTTP 400/401)
without one. Pass it as `_apiKey`; the platform fallback env var is
`PLATFORM_NASA_FIRMS_KEY`.

The key is free and self-service at
<https://firms.modaps.eosdis.nasa.gov/api/map_key/> — an email address, no
approval step. Limit is 5,000 transactions per 10 minutes, and a multi-day
query counts as several transactions.

## Data sources

- <https://firms.modaps.eosdis.nasa.gov/api/area/csv/{KEY}/{SOURCE}/{BBOX}/{DAYS}[/{DATE}]> —
  hotspot detections. The key goes in the PATH, not a header or a query param.
- <https://firms.modaps.eosdis.nasa.gov/api/data_availability/csv/{KEY}/{SENSOR}> — archive coverage.

### Things the next person would otherwise rediscover

- **`acq_time` is HHMM with leading zeros dropped.** `"52"` means 00:52Z. A naive
  two-character slice reports it as 52:00 and gets the hour wrong for every
  pre-10:00 overpass.
- **Brightness column names differ by sensor.** VIIRS reports `bright_ti4` /
  `bright_ti5`; MODIS reports `brightness` / `bright_t31`. Both are mapped to
  `brightness_k` / `bright_t31_k`.
- **The `/api/country/` and `/api/countries/` routes are dead.** FIRMS' own API
  index lists them as "Feature currently not available" and they answer
  `Invalid API call.` (HTTP 400). `firms_hotspots_country` was therefore NOT
  built. Do not emulate it with a country bounding box — a box around Chile
  contains Argentina, and the caller would get neighbouring fires labelled as
  the country they asked for. `firms_hotspots_near` is the honest shape.
- **`day_range` is capped at 5** by the upstream, and is counted FORWARD from
  `date` when one is given, backward from today when it is not.
- **Errors arrive as a bare English sentence**, not JSON, at HTTP 400/401/403 —
  so the response body is the diagnosis and is surfaced verbatim.

## Quick Start

Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):

```json
{
  "mcpServers": {
    "nasa-firms": {
      "url": "https://gateway.pipeworx.io/nasa-firms/mcp"
    }
  }
}
```

### What this endpoint actually serves

`tools/list` at `https://gateway.pipeworx.io/nasa-firms/mcp` returns the tools in the table
above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
`discover_tools`, `search_within`, `remember`/`recall` and the rest of the
gateway-wide set. So the tool count you see is larger than this table: a
single-pack endpoint currently lists roughly 30 shared tools alongside the
pack's own. The connection's `initialize` response states its exact scope, and
is the authoritative answer for a given day.

This is deliberate, not multiplexing by accident. The meta-tools are what let a
scoped connection answer a question this pack does not cover — via
`ask_pipeworx`, which routes across the whole catalog — without you adding a
second MCP server. There is currently no way to mount a pack endpoint without
them; if the extra schemas cost you more context than the routing is worth,
connect to the full gateway once rather than to several pack endpoints.

Or connect to the full Pipeworx gateway to get every pack's tools listed
directly, instead of just this one's:

```json
{
  "mcpServers": {
    "pipeworx": {
      "url": "https://gateway.pipeworx.io/mcp"
    }
  }
}
```

Both URLs reach the same gateway and the same 1865+ data sources. The
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
reaches all of them from either one.

## No MCP client? Call it over HTTP

```bash
curl -X POST https://gateway.pipeworx.io/v1/tools/firms_hotspots_area \
  -H 'Content-Type: application/json' \
  -d '{"bbox":"-125,32,-114,42","source":"VIIRS_SNPP_NRT","day_range":1}'
```

No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/firms_hotspots_area`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.

## Run it from npm

`@pipeworx/mcp-nasa-firms` is a local stdio bridge to the Pipeworx gateway: your MCP client
starts it with `npx`, and it forwards every call to the same
`https://gateway.pipeworx.io/nasa-firms/mcp` endpoint shown above. It needs network access;
there is no offline mode.

```json
{
  "mcpServers": {
    "nasa-firms": {
      "command": "npx",
      "args": ["-y", "@pipeworx/mcp-nasa-firms"]
    }
  }
}
```

Without a key it calls anonymously, capped at 50 calls a day. A free account
raises that to 200 a day: get a key at https://pipeworx.io/signup and add
`"env": { "PIPEWORX_API_KEY": "<your key>" }` to the server entry.
The key is sent as a Bearer token, the same way a hosted connection sends it,
so calls are metered and billed exactly as they are there.

It lists **only** this pack's tools by default. Set `PIPEWORX_META_TOOLS=1` to
also list `ask_pipeworx` and the other gateway-wide tools.

Behind an HTTPS proxy: Node's built-in `fetch` does not read `HTTPS_PROXY` by
default. Newer Node releases honour it when `NODE_USE_ENV_PROXY=1` is set; check
your Node version's documentation.

## Using with ask_pipeworx

Instead of calling tools directly, you can ask questions in plain English —
this works on the pack endpoint above as well as on the full gateway:

```
ask_pipeworx({ question: "your question about Nasa Firms data" })
```

The gateway picks the right tool and fills the arguments automatically.

## More

- [Docs and guides](https://pipeworx.io/docs)
- [pipeworx.io](https://pipeworx.io)

## License

MIT