nasa
NASA MCP Server - Comprehensive access to NASA's open APIs including APOD, Mars rovers, asteroids, and Earth imagery
claude mcp add --transport stdio jezweb-nasa-mcp-server python nasa_server.py \ --env PORT="8000" \ --env API_KEY="your_nasa_api_key_here" \ --env LOG_LEVEL="INFO" \ --env TRANSPORT="stdio" \ --env DEFAULT_COUNT="10" \ --env CACHE_TTL_IMAGES="1800" \ --env MAX_HOURLY_CALLS="1000" \ --env CACHE_TTL_DYNAMIC="600" \ --env DEMO_HOURLY_LIMIT="30"
How to use
This NASA MCP Server exposes a suite of tools that give you access to NASA open APIs from a single MCP endpoint. It aggregates content across Astronomy Picture of the Day (APOD), Mars Rover Photos, Near Earth Objects (Asteroids), and the NASA Media Library, with caching and rate-limit awareness to improve reliability. You can query today’s APOD, fetch APODs over a date range, retrieve Mars rover images by sol or Earth date, browse asteroid data, and search NASA media assets. The server includes helpers for development and testing, as well as a collection of prompts and usage examples to help you build downstream applications and chat-based interfaces.
How to install
Prerequisites:
- Python 3.8+
- A NASA API key (free at api.nasa.gov)
- Python dependencies listed in requirements.txt
Install and run:
- Clone the repository:
git clone https://github.com/jezweb/nasa-mcp-server.git
cd nasa-mcp-server
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables:
cp .env.example .env
# Edit .env to include your NASA API key and desired settings
- Run the server (STDIO transport by default):
python nasa_server.py
- Optional: Run with HTTP transport (if configured):
TRANSPORT=http PORT=8000 python nasa_server.py
- For development with FastMCP (if you use it):
fastmcp dev nasa_server.py
- Test the server locally:
python nasa_server.py --test
Additional notes
Tips and notes:
- Ensure your NASA API key is configured in the .env file to avoid request failures.
- The server caches image data for 30 minutes and dynamic data for 10 minutes to balance freshness and latency.
- The TRANSPORT and LOG_LEVEL settings can be adjusted to fit your deployment environment (e.g., cloud, container, or local development).
- If you hit API rate limits, consider using multiple keys or raising the DEMO_HOURLY_LIMIT in your environment as appropriate for testing.
- The server supports multiple transport modes; default is STDIO, but HTTP transport can be enabled via environment variables.
- When deploying behind a reverse proxy, ensure the port mapping matches your deployment configuration.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP