NASA MCP Server
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
Provides access to 20+ NASA data sources including APOD, Mars Rover Photos, EPIC, DONKI, NEO, EONET, TLE, JPL Solar System Dynamics, Earth Data APIs, and POWER, allowing AI models to retrieve and process space imagery, celestial object data, and Earth observation information through a standardized interface.
Implements input validation and sanitization for NASA API requests using Zod schemas to ensure proper formatting and security.
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 | Default |
---|---|---|
NASA_API_KEY | Your NASA API key (get at api.nasa.gov) | DEMO_KEY (limited usage) |
PORT | Port to run the server on | 3000 |
LOG_LEVEL | Logging level (debug, info, warn, error) | info |
CACHE_DURATION | Cache duration in seconds | 3600 (1 hour) |
RATE_LIMIT | Maximum requests per hour | Based on API key |
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 test
- Submit a pull request
License
ISC License - see LICENSE file for details
This server cannot be installed
A Model Context Protocol server that provides a standardized interface for AI models to interact with NASA's vast array of data sources including APOD, Mars Rover photos, satellite imagery, and space weather data.