home / mcp / nasa mcp server

NASA MCP Server

Provides MCP-based access to NASA APIs for APOD, asteroid data, space weather, Landsat imagery, EPIC, and exoplanet info.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ancode666-nasa-mcp": {
      "command": "uvx",
      "args": [
        "nasa_mcp"
      ],
      "env": {
        "NASA_API_KEY": "YOUR_NASA_API_KEY"
      }
    }
  }
}

NASA MCP lets you query NASA APIs through MCP-compatible clients, enabling you to fetch data such as the Astronomy Picture of the Day, near-Earth objects, space weather, Earth imagery, EPIC images, and exoplanet information in a secure, structured way. This server handles API keys safely and provides clear results or informative errors for failed requests.

How to use

You connect to the NASA MCP server from any MCP-compatible client. After configuring the client with the MCP entry and your NASA API key, you can ask for data like the current Astronomy Picture of the Day, asteroid information, space weather events, Landsat imagery for specific coordinates, EPIC Earth images, or exoplanet details. The server handles authentication, request routing to NASA APIs, and returns structured responses suitable for embedding into your conversations.

How to install

Prerequisites you need before installing: Python 3.10 or higher and the uv package manager.

Install uv (example using the official installer):

curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows, install uv with PowerShell (admin rights may be required):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Alternatively, install uv via Python's package manager:

pip install uv

Once uv is installed, configure the MCP server in the client you use (example shown for Claude Desktop). You will add a new MCP server configuration with the NASA API key you obtain from NASA.

If you already have other MCP servers configured, separate each entry with a comma when you add the new one.

Configuration example for Claude Desktop and NASA API key

Add the NASA MCP server under your MCP servers list with the following block. This runs the server via uvx and passes the NASA API key as an environment variable.

"nasa-mcp": {
  "command": "uvx",
  "args": [
    "nasa_mcp"
  ],
  "env": {
    "NASA_API_KEY": "YOUR_NASA_API_KEY"
  }
}

How to obtain a NASA API key

Get a free API key from NASA at https://api.nasa.gov/. Replace YOUR_NASA_API_KEY in your MCP configuration with the key you receive. If you just want to test quickly, you can use the public DE MO KEY for limited access.

Usage notes and examples

Once configured, you can ask for data such as today’s Astronomy Picture of the Day, near-Earth object data for upcoming weeks, solar flare events, Earth imagery for particular coordinates, EPIC Earth disk images, or exoplanet details.

Troubleshooting and tips

If a request fails, check that your NASA API key is correct and not expired, ensure network access to NASA APIs is available, and verify that the MCP client is correctly pointing to your nasa_mcp configuration. Use the DEMO_KEY only for quick tests and limited data.

Notes

The NASA MCP server is designed to securely manage API keys and provide structured results. You can integrate it with Claude Desktop or any MCP-compatible client by configuring the nasa_mcp server entry and supplying the NASA_API_KEY in your environment.

Available tools

apod

Retrieves the Astronomy Picture of the Day with explanations and imagery; supports querying the current image and related metadata.

neoWs

Fetches Near Earth Object data and asteroid information, including upcoming close approaches and orbital details.

donki

Provides space weather data from the DONKI database, including solar flares, geomagnetic storms, and related events.

earth_imagery

Returns Landsat 8 satellite imagery for specified coordinates and date ranges.

epic

Accesses Earth Polychromatic Imaging Camera images showing the full Earth disk for given timestamps.

exoplanet_archive

Queries the Exoplanet Archive for information about planets outside our solar system, including discovery methods and characteristics.