Skip to content

Migrate APOD and DONKI to their new APIs and add InSight, TLE, SSC, TechPort, TechTransfer, Trek and Mission Design tools - #15

Merged
ProgramComputer merged 2 commits into
mainfrom
programcomputer/nasa-api-migrations
Sep 30, 2026
Merged

ProgramComputer merged 2 commits into
mainfrom
programcomputer/nasa-api-migrations

Conversation

@ProgramComputer

@ProgramComputer ProgramComputer commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

APOD migration

api.nasa.gov/planetary/apod returns 503/504, and the api.nasa.gov catalog says the legacy API goes offline on 2026-12-01. nasa_apod, the nasa://apod/image resource template and both APOD prompts now use the NASA Science API (science.nasa.gov/wp-json/wp/v2/apod-basic), which needs no key.

What I found while probing it:

  • date_from/date_to only accept YYMMDD (260901). 2026-09-01, 20260901 and ISO timestamps all return HTTP 400. Single dates use /apod-basic/{YYMMDD}.
  • per_page is capped at 25, so ranges (still up to 100 days) are paged using x-wp-totalpages and returned oldest first.
  • url is the article permalink, not the image. The picture is the first <img> in basic_html. Posts from before about 2005 have a generic placeholder hdurl (…/cosmic-origins/images/misc/news-thumbnail.png), which is ignored.
  • Videos have no video URL in the JSON. It is read from the <video><source> or <iframe> in basic_html, and hdurl is shown as the still frame.
  • Missing days return 404 apod_basic_not_found, which is reported as "has no picture for YYYY-MM-DD".

Changes:

  • count and thumbs are retired through retiredParameters: the new API has no random mode, and the catalog says thumbs is disabled. They were also removed from the prompts.
  • Dates before 1995-06-16 and future dates are rejected before any request. Future dates are rejected because YYMMDD would wrap around after 2094.
  • Title, credit/copyright and explanation are plain text. HTML is stripped and entities decoded (new src/util/html.ts).
  • Embedded images use a 1024 px rendition from assets.science.nasa.gov/dynamicimage, falling back to the original (resized GIFs return 404).
  • The resource template returns one entry, without the 6–9 KB basic_html page.

DONKI move

CCMC moved the public DONKI API from kauai.ccmc.gsfc.nasa.gov/DONKI/WS/get/... to ccmc.gsfc.nasa.gov/DONKI-API/get/... on 2026-09-30, and api.nasa.gov/DONKI/* now returns a 301 to CCMC's news page even with a valid key. The new endpoints returned 404 during the maintenance window and started serving data at 16:43 UTC (12:43 PM EDT).

Before switching I checked all 11 endpoints (GST, CME, CMEAnalysis, IPS, FLR, SEP, MPC, RBE, HSS, WSAEnlilSimulations, notifications) on the new host:

  • All return application/json arrays, with the same record fields as before (flrID, beginTime, classType, activityID, ...).
  • No key is needed; an api_key parameter is ignored.
  • Empty ranges return []. Without dates, DONKI defaults to the last 30 days.
  • Paths are case-sensitive (/flr and /FLR/ return JSON 404s), and the tool already uses the documented case.

nasa_donki now calls the new host through httpRequest instead of nasaApiGet, with no key. Its unit test, description, the key lists in .env.example, the README, --help and config.ts, the Inspector examples and the CHANGELOG are updated.

New tools

Each tool was probed live before being added.

Tool Source Key
nasa_insight_weather api.nasa.gov/insight_weather/ NASA_API_KEY
nasa_tle tle.ivanstanojevic.me/api/tle (CelesTrak data) none
nasa_ssc_observatories, nasa_ssc_locations sscweb.gsfc.nasa.gov/WS/sscr/2 none
nasa_techport techport.nasa.gov/api (GET search and project) none
nasa_techtransfer technology.nasa.gov/api/api/{patent,patent_issued,software,spinoff}/{q} none
nasa_trek_layers, nasa_trek_tile trek.nasa.gov catalog and WMTS (Mars, Moon, Vesta) none
jpl_mission_design ssd-api.jpl.nasa.gov/mdesign.api (modes A and Q) none

Notes:

  • InSight is labelled historical in the description and in every result. The feed still returns sols 675–681 (2020-10-19 to 2020-10-26), and the catalog says "Last Updated: 3/30/2021". Its PDF documentation calls AT "degrees Celsius" in the quick start but "°F" in the field table. The values (−97 to −16) match Celsius, so the tool labels them °C.
  • SSC returns Jackson-typed JSON (["java.util.ArrayList", [...]]), which is unwrapped. A month of ISS positions at 60 s is 7.8 MB, so resolutionFactor is chosen automatically to keep each call to about 8,000 values, or rejected with a suggested minimum when the caller sets one too small.
  • TechTransfer: every api.nasa.gov/techtransfer/... form I tried (with the key) returns the HTML help page, and that page points to technology.nasa.gov/api/api/..., which returns JSON without a key. The service ignores paging and returns all matches, so limit is applied locally.
  • TechPort: GET /api/projects/search and /api/projects/{id} work without a token. POST search returns 401 (it needs a session nonce), so it isn't used. GET search honours limit but ignores offset. Contact emails are kept out of text and resources.
  • Trek: the catalog filter mirrors the one the Trek API docs page uses, plus the layer's trekProjection, because the polar index mixes north and south layers. Tiles are addressed through each layer's WMTSCapabilities.xml, and matrices inside XML comments are ignored (the Moon WAC mosaic has some). Tiles can also be picked by latitude/longitude on global equirectangular grids. Tile URLs outside trek.nasa.gov are refused.
  • SSD/CNEOS: the catalog entry lists CAD, Fireball, Mission Design, NHATS, Scout and Sentry. Mission Design was the only one without a tool.
  • The TLE API's {"response":{"message":…}} error bodies are now summarized.
  • No new credentials are needed, so config.ts gets no new registerSecret. .env.example, the README table, the --help text and the config.ts comment now list which tools use NASA_API_KEY.

Not added, and why

  • Mission Design modes M and T: mode M returns porkchop grids (104 KB for about 1,300 points, up to 1.5 million points). Mode T took 29 s for a 30-day span and over 120 s for the documented one-year example, beyond the 30 s request deadline.
  • Ceres Trek: its catalog returns HTTP 500. The api.nasa.gov entry only covers Vesta, Moon and Mars.
  • SSD APIs outside the catalog entry (sb_ident, sb_radar, sb_sat, sbdb_query, sbwobs, horizons_lookup): not in scope of the catalog comparison. They are candidates for a follow-up.

Known issue (not changed here)

nasa_donki still returns the full upstream JSON. With the solar-storm prompt, a month of CMEs (106 records) exceeded the server's 250,000-character limit, and a month of CMEAnalysis output was too large for the client's tool-output limit. The client recovered using the FLR, GST and IPS results, but compact per-record summaries for DONKI would be a worthwhile follow-up. This behavior predates the move.

Verification

  • npm test (143 tests), npm run lint and npm run docs:check pass. NASA_MCP_LIVE=1 runs the new live APOD check, which passes without a key.
  • Unit tests use test/helpers/fake-fetch.ts for every new tool and for APOD (range paging, placeholder hdurl, GIF fallback, video URLs, retired parameters).
  • Every new or changed tool was called over MCP stdio with the Inspector CLI (node dist/index.js, keys read from .env) and returned real data. That covered tools/list (32 tools); APOD for latest, 2015-07-14, a 7-day range, count (migration error), resources/read and prompts/get; InSight; TLE by ID and by search; SSC observatories and locations; TechPort search and project; TechTransfer patents and software; Trek layers (Mars, Vesta south pole) and tiles (Mars by lat/lon, Moon zoom 2, Vesta south pole); and Mission Design objects and lists. No key value appeared in any output.
  • README example prompts were added only for tools that returned real data, including the solar-storm prompt once DONKI was live.
  • nasa_donki was called over MCP stdio for all 11 types (2026-09-20 to 2026-09-29) with NASA_API_KEY blanked for the server process, and every call returned data or an explicit "No DONKI ... events".
  • Each new README example prompt was also run through an MCP client in a non-interactive session with only this server enabled. Every prompt selected the intended tools (for example nasa_trek_layers then nasa_trek_tile by latitude/longitude for Olympus Mons, and jpl_mission_design with crit: 3 for the lowest delta-v NEOs) and answered from live data.

@ProgramComputer ProgramComputer changed the title Migrate APOD to the NASA Science API and add InSight, TLE, SSC, TechPort, TechTransfer, Trek and Mission Design tools Migrate APOD and DONKI to their new APIs and add InSight, TLE, SSC, TechPort, TechTransfer, Trek and Mission Design tools Sep 30, 2026
@ProgramComputer
ProgramComputer merged commit d199c32 into main Sep 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant