NA

NASA MCP Server: APOD NEO EPIC GIBS

Explore NASA data via the MCP server, a unified gateway to APOD, NEO, EPIC, GIBS and more for images, orbits and earth imagery.

Quick Install
npx -y @ProgramComputer/NASA-MCP-server

Overview

The NASA MCP Server is a lightweight gateway that exposes curated NASA data sources (APOD, NEO, EPIC, GIBS, and related APIs) via a Model Context Protocol (MCP) compatible interface. It centralizes image assets, near-Earth object (NEO) telemetry, Earth planetary imagery, and map tile access into a single HTTP service, making it easier to incorporate authoritative NASA content into AI agents, chatbots, or developer tools.

By converting NASA endpoints into an MCP-friendly toolset, the server lets language models request precise data (images, metadata, or tile URLs) in a predictable format. This is useful for applications that need programmatic access to space imagery, orbital data, and Earth visualizations without wiring multiple APIs or implementing custom parsing logic.

Features

  • Single MCP-compatible endpoint aggregating multiple NASA services
  • Direct access to APOD (Astronomy Picture of the Day) images and metadata
  • Near-Earth Object (NEO) lookups: objects, close approaches, orbit data
  • EPIC (Earth Polychromatic Imaging Camera) historic image retrieval
  • GIBS (Global Imagery Browse Services) tile or layer access for web maps
  • Simple JSON tool descriptors for LLM tool invocation
  • Configurable via environment variables and runnable with Docker
  • Lightweight and designed to be embedded in AI agent contexts

Installation / Configuration

Clone the repository and run locally or with Docker. Replace <YOUR_NASA_API_KEY> with your NASA developer key.

Clone repository:

git clone https://github.com/ProgramComputer/NASA-MCP-server.git
cd NASA-MCP-server

Node/npm-based local install (if the project is Node-based):

npm ci
cp .env.example .env
# Edit .env to add your NASA API key and options, or use the commands below
export NASA_API_KEY="<YOUR_NASA_API_KEY>"
npm start

Docker build and run:

docker build -t nasa-mcp-server .
docker run -d -p 8080:8080 \
  -e NASA_API_KEY="<YOUR_NASA_API_KEY>" \
  --name nasa-mcp-server nasa-mcp-server

Example .env variables

PORT=8080
NASA_API_KEY=YOUR_KEY_HERE
ENABLE_GIBS=true
ENABLE_EPIC=true
LOG_LEVEL=info

Common environment variables (summary):

VariableDefaultDescription
PORT8080HTTP port the server listens on
NASA_API_KEYRequired: NASA API key for external API calls
ENABLE_GIBStrueToggle GIBS layer support
ENABLE_EPICtrueToggle EPIC image endpoints
LOG_LEVELinfoLogging verbosity

Available Tools / Available Resources

The MCP server exposes a set of resources and tool descriptors suited for LLM tool invocation. Typical endpoints:

PathPurpose
/mcp/toolsJSON listing of MCP tools supported (APOD, NEO, EPIC, GIBS)
/apodFetch APOD image and metadata (optional date query)
/neoQuery NEO by designation or date range
/epicList EPIC images and fetch image URLs for a date
/gibsProvide tile URL templates or layer metadata for GIBS

Example: GET /apod?date=2023-01-01 returns APOD metadata with direct image URL.

MCP tool descriptor (example JSON returned at /mcp/tools):

{
  "tools": [
    {
      "name": "apod",
      "description": "Fetch Astronomy Picture of the Day metadata and image URL",
      "input_schema": { "type": "object", "properties": { "date": { "type": "string" } } }
    },
    {
      "name": "neo",
      "description": "Retrieve near-Earth object details by designation or date range"
    }
  ]
}

Use Cases

  • AI assistants: Expose precise NASA resources as callable tools in an LLM agent. An assistant can call the apod tool to fetch today’s space image or use neo to check close approaches relevant to a user query.
  • Data exploration: Quickly retrieve EPIC images for a given date to build datasets (time-series of Earth views over a region).
  • Visualization: Use GIBS layer descriptors and tile templates to overlay NASA imagery on web maps or GIS applications without manual configuration.
  • Research/education: Provide students or researchers programmatic access to APOD for slides, or NEO metadata for orbital analysis and tracking demos.

Concrete examples

  1. Fetch today’s APOD via curl:
curl "http://localhost:8080/apod"
  1. Search NEOs that approached on a date range (example):
curl "http://localhost:8080/neo?start_date=2024-04-01&end_date=2024-04-07"
  1. Request EPIC images for a date (JSON list of images and URLs):
curl "http://localhost:8080/epic?date=2023-05-01"
  1. Retrieve GIBS tile template for a layer:
curl "http://localhost:8080/gibs?layer=MODIS_Terra_CorrectedReflectance_TrueColor"
  • GitHub: https://github.com/ProgramComputer/NASA-MCP-server
  • NASA APIs and docs: https://api.nasa.gov
  • GIBS documentation: https://earthdata.nasa.gov
  • Model Context Protocol (MCP) reference (useful when integrating with LLM tool frameworks)

Notes: Always respect NASA API usage policies and throttle requests appropriately. Use a valid NASA API key for reliable access to endpoints.