Skip to main content
Glama
README.md
# nasa-mcp

An [MCP](https://modelcontextprotocol.io/) server (spec 2026-07-28, stateless core) that gives AI agents
read-only access to the NASA open data services listed on [api.nasa.gov](https://api.nasa.gov/): the Astronomy
Picture of the Day, near-Earth asteroids, space weather, Earth and planetary imagery, natural events, exoplanets,
space biology, spacecraft positions and NASA technology. 37 tools over 16 services; every result carries units,
redacted source URLs and the citation for its service.

Several api.nasa.gov gateway routes are broken, slow or retiring (November 2026), so nasa-mcp calls each service on
the host that works. Only NeoWs and InSight use the api.nasa.gov key; the other 14 services need no key.

| Service | Tools | Key | Host and notes |
| --- | --- | --- | --- |
| APOD | `nasa_apod_get` | no | science.nasa.gov (the legacy api.nasa.gov APOD retires 2026-12-01) |
| Asteroids NeoWs | `nasa_neo_feed`, `nasa_neo_lookup`, `nasa_neo_browse` | **yes** | api.nasa.gov; feed windows at most 7 days |
| DONKI space weather | `nasa_donki_events`, `nasa_donki_notifications` | no | ccmc.gsfc.nasa.gov (the gateway route returns 404) |
| EPIC Earth images | `nasa_epic_images`, `nasa_epic_available_dates` | no | epic.gsfc.nasa.gov; archive image URLs |
| InSight Mars weather | `nasa_insight_weather` | **yes** | api.nasa.gov; **frozen archive**, sols 675-681 (October 2020) |
| TechTransfer | `nasa_techtransfer_search` | no | technology.nasa.gov (the gateway redirects to its docs) |
| Solar System Treks | `nasa_trek_list_layers`, `nasa_trek_tile_url` | no | trek.nasa.gov; Moon, Mars, Vesta WMTS URLs |
| GIBS Earth imagery | `nasa_gibs_list_layers`, `nasa_gibs_snapshot_url` | no | gibs.earthdata.nasa.gov; WMS snapshot URLs built offline |
| EONET natural events | `nasa_eonet_events`, `nasa_eonet_categories` | no | eonet.gsfc.nasa.gov |
| Image and Video Library | `nasa_images_search`, `nasa_images_asset` | no | images-api.nasa.gov |
| JPL SSD / CNEOS | `nasa_ssd_close_approaches`, `nasa_ssd_fireballs`, `nasa_ssd_sentry`, `nasa_ssd_scout`, `nasa_ssd_nhats`, `nasa_ssd_sbdb_lookup` | no | ssd-api.jpl.nasa.gov |
| Exoplanet Archive | `nasa_exoplanet_search`, `nasa_exoplanet_query` | no | exoplanetarchive.ipac.caltech.edu (TAP/ADQL) |
| OSDR (GeneLab) | `nasa_osdr_search`, `nasa_osdr_study`, `nasa_osdr_files` | no | osdr.nasa.gov |
| SSCWeb | `nasa_ssc_observatories`, `nasa_ssc_locations` | no | sscweb.gsfc.nasa.gov; at most 2 days per call |
| TechPort | `nasa_techport_projects`, `nasa_techport_project` | no | techport.nasa.gov |
| TLE API | `nasa_tle_search`, `nasa_tle_get` | no | tle.ivanstanojevic.me: **third-party**, mirrors CelesTrak |

Plus `nasa_ping` and `nasa_list_services`.

* Dates are `YYYY-MM-DD` (UTC); numbers that upstream sends as strings are converted and their units named.
* Image, video and tile tools return **URLs**, never bytes.
* Long lists are paged and trimmed to a 50 KB result budget (200 KB hard cap).
* Errors are tool results `{"error": {code, message, details, hint}}`.

## Quick start

```bash
uv sync --frozen
uv run nasa-mcp --check                                  # offline self-test
claude mcp add nasa -- uv run --directory "$PWD" nasa-mcp
uv run nasa-mcp --transport http                         # Streamable HTTP on 127.0.0.1:8080/mcp
docker compose up --build                                # container, 127.0.0.1:8080 only
```

## The api.nasa.gov key

Get a free key at <https://api.nasa.gov/>. The server reads it **only** from the environment variable
`NASA_MCP_NASA__API_KEY`, never from YAML, flags, tool arguments or HTTP headers:

```bash
export NASA_MCP_NASA__API_KEY=...   # from your own secret store
```

**Never commit the key** (`.env` files are not loaded, and an `api_key` in the YAML config is rejected). Without a
key the server falls back to `DEMO_KEY`, documented at 30 requests/hour but observed at **10 per hour followed by a
block of about 22 hours**; only the NeoWs and InSight tools are affected. Over HTTP the operator's key is used only
with `NASA_MCP_NASA__ALLOW_KEY_IN_HTTP_MODE=true`. The key is sent only to `api.nasa.gov` and redacted
(`api_key=***`) everywhere else. `nasa_ping` reports which key is in use and the remaining quota.

## Client configuration

Claude Desktop (or any stdio client):

```json
{
  "mcpServers": {
    "nasa": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/nasa-mcp", "nasa-mcp"],
      "env": { "NASA_MCP_NASA__API_KEY": "<your-api-key>" }
    }
  }
}
```

More clients: `docs/getting-started/clients.md`.

## Documentation

`docs/` is an Open Knowledge Format (OKF v0.2) bundle built with Zensical and published at
<https://idss-mesa.github.io/nasa-mcp/>; agents can read `docs/llms.txt` and `docs/llms-full.txt`. Start with
`docs/getting-started/quickstart.md`. Design and decision register: `DESIGN.md`; verified upstream facts:
`RESEARCH.md`.

## Development

```bash
uv sync --extra dev
uv run ruff check src tests scripts && uv run ruff format --check src tests scripts
uv run mypy --strict src
uv run pytest                                    # hermetic (recorded fixtures, no network)
uv run pytest -m network tests/live              # live; NeoWs/InSight tests also carry -m apikey
uv run python scripts/record_fixtures.py check   # fixture sizes, hosts, no secrets
uv run python scripts/record_fixtures.py record  # re-record (uses NASA_MCP_NASA__API_KEY or DEMO_KEY)
```

Docs: `uv sync --extra docs`, then `scripts/gen_tools_reference.py`, `scripts/gen_config_reference.py`,
`scripts/gen_llms_txt.py`, `scripts/okf_validate.py docs` and `zensical build --strict` (see `AGENTS.md`).

## Status

Version 0.1.0, published at <https://github.com/idss-mesa/nasa-mcp>. Every tool, including the
api.nasa.gov ones, has been verified live and has recorded test fixtures.

## Licence

Code: MIT (see `LICENSE`; `NOTICE` credits code adapted from idss-mesa/neon-mcp via weather-station-mcp). Docs:
CC BY 4.0. Data returned by the server are **not** covered by the MIT licence: NASA material is generally not
copyrighted, but credit NASA and do not imply endorsement; APOD images are often copyrighted by their authors; the
Exoplanet Archive and GIBS ask for acknowledgements; TLE data come from a third-party service mirroring CelesTrak.
Every result's `source.citation` gives the credit line.

TDQS

A3.9/5.0

Scored across 37 tools

Disambiguation4/5

Each tool is scoped to one NASA service and one action, and the embedded "Next: call ..." pointers make the intended chaining explicit (e.g. search → asset, sentry → sbdb_lookup). A few boundaries are genuinely fuzzy: nasa_neo_feed vs nasa_ssd_close_approaches both return close approaches, and nasa_neo_lookup vs nasa_ssd_sbdb_lookup both look up a single object by ID/designation, so an agent could reasonably pick the wrong one. Descriptions mitigate this but don't fully dissolve the overlap.

Naming Consistency4/5

Names follow a reliable `nasa_<service>_<action>` snake_case namespace (nasa_osdr_search, nasa_gibs_list_layers, nasa_techport_project), which makes service grouping obvious. The only deviation is that roughly a third of tools are noun-only with no verb (nasa_donki_events, nasa_eonet_categories, nasa_epic_images, nasa_ssd_sentry, nasa_ssd_fireballs, nasa_ssd_nhats, nasa_insight_weather), so verb_noun predictability is not uniform.

Tool Count3/5

37 tools is a heavy surface for an agent to select from, and it sits above the comfortable 3-15 band. It is defensible because the server federates ~16 genuinely distinct NASA services, and most tools earn their place, but a few thin wrappers (nasa_ping, nasa_epic_available_dates, nasa_eonet_categories, nasa_gibs_snapshot_url) add selection load without adding much capability.

Completeness4/5

Lifecycle coverage per service is largely complete for read-only science data: discovery → detail → derivative URL across images, EPIC, GIBS, NEO, SSD, OSDR, TechPort, TLE and Trek, plus meta tools for quotas and service inventory. Remaining gaps are modest — no pagination on several search tools, no way to search TechPort by keyword (date-window only), and nasa_neo_feed hard-capped at 7 days — all workable around with other tools.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues