Provides access to 20+ NASA data sources including Astronomy Picture of the Day (APOD), Mars Rover photos, Near Earth Objects (NEO), Earth imagery (GIBS, EPIC), space weather data (DONKI), exoplanet information, and energy resource predictions (POWER) through a standardized interface for querying NASA's public APIs.
NASA MCP Server
A Model Context Protocol (MCP) server for NASA APIs, providing a standardized interface for AI models to interact with NASA's vast array of data sources. This server implements the official Model Context Protocol specification.
Big thanks to the MCP community for their support and guidance!
Features
Access to 20+ NASA data sources through a single, consistent interface
Standardized data formats optimized for AI consumption
Automatic parameter validation and error handling
Rate limit management for NASA API keys
Comprehensive documentation and examples
Support for various NASA imagery formats
Data conversion and formatting for LLM compatibility
Cross-platform support (Windows, macOS, Linux)
Disclaimer
This project is not affiliated with, endorsed by, or related to NASA (National Aeronautics and Space Administration) or any of its subsidiaries or its affiliates. It is an independent implementation that accesses NASA's publicly available APIs. All NASA data used is publicly available and subject to NASA's data usage policies.
Installation
Running with npx
You can also pass the API key as a command line argument:
Using SuperGateway for Server-Sent Events (SSE)
You can use SuperGateway for Server-Sent Events (SSE).
The developers of NASA-MCP-server DO NOT ENDORSE the SuperGateway repository. This information is provided for those who wish to implement SSE functionality at their own discretion.
Manual Installation
Running on Cursor
Configuring Cursor 🖥️ Note: Requires Cursor version 0.45.6+
To configure NASA MCP Server in Cursor:
Create or edit an mcp.json file in your Cursor configuration directory with the following content:
Replace your-api-key with your NASA API key from https://api.nasa.gov/.
After adding the configuration, restart Cursor to see the new NASA tools. The Composer Agent will automatically use NASA MCP when appropriate for space-related queries.
Environment Variables
The server can be configured with the following environment variables:
Variable | Description |
| Your NASA API key (get at api.nasa.gov) |
Included NASA APIs
This MCP server integrates the following NASA APIs:
NASA Open API (api.nasa.gov):
APOD (Astronomy Picture of the Day)
EPIC (Earth Polychromatic Imaging Camera)
DONKI (Space Weather Database Of Notifications, Knowledge, Information)
Insight (Mars Weather Service)
Mars Rover Photos
NEO (Near Earth Object Web Service)
EONET (Earth Observatory Natural Event Tracker)
TLE (Two-Line Element)
NASA Image and Video Library
Exoplanet Archive
NASA Sounds API (Beta)
POWER (Prediction Of Worldwide Energy Resources)
JPL Solar System Dynamics API (ssd-api.jpl.nasa.gov):
SBDB (Small-Body DataBase)
SBDB Close-Approach Data
Fireball Data
Scout API
Earth Data APIs:
GIBS (Global Imagery Browse Services)
CMR (Common Metadata Repository) - Enhanced with advanced search capabilities
EPIC (Earth Polychromatic Imaging Camera)
FIRMS (Fire Information for Resource Management System)
API Methods
Each NASA API is exposed through standardized MCP methods:
APOD (Astronomy Picture of the Day)
Mars Rover Photos
Near Earth Objects
GIBS (Global Imagery Browse Services)
POWER (Prediction Of Worldwide Energy Resources)
For complete documentation of all available methods and parameters, see the API reference in the /docs directory.
Logging System
The server includes comprehensive logging:
Operation status and progress
Performance metrics
Rate limit tracking
Error conditions
Request validation
Example log messages:
Security Considerations
This MCP server implements security best practices following the Model Context Protocol specifications:
Input validation and sanitization using Zod schemas
No execution of arbitrary code
Protection against command injection
Proper error handling to prevent information leakage
Rate limiting and timeout controls for API requests
No persistent state that could be exploited across sessions
Development
Testing with MCP Inspector
The NASA MCP Server includes a script to help you test the APIs using the MCP Inspector:
This will:
Build the project to ensure the latest changes are included
Start the MCP Inspector with the NASA MCP server running
Allow you to interactively test all the NASA APIs
Example Test Requests
The repository includes example test requests for each API that you can copy and paste into the MCP Inspector:
For detailed examples, see the Inspector Test Examples document.
MCP Client Usage
This server follows the official Model Context Protocol. Here's an example of how to use it with the MCP SDK:
Contributing
Fork the repository
Create your feature branch
Run tests:
npm testSubmit a pull request
License
ISC License - see LICENSE file for details
This server cannot be installed