NASA MCP Server logo

NASA MCP Server

Community
jezweb

NASA MCP Server - Comprehensive access to NASA's open APIs including APOD, Mars rovers, asteroids, and Earth imagery

Publisherjezweb
Repositorynasa-mcp-server
LanguagePython
Forks
1
Stars
9
Available tools
0
Transport typestdio, streamable-http
Categories
Links
  • Connect tools to AI workflows

    NASA MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    9 stars and 1 forks from the linked repository.

NASA MCP Server

A comprehensive Model Context Protocol (MCP) server providing access to NASA's open APIs, including astronomy imagery, Mars rover photos, asteroid tracking, Earth observations, and NASA's media library.

✨ Features

🌌 Astronomy Picture of the Day (APOD)

  • Daily astronomy images with scientific explanations
  • Historical APOD lookup by date or date range
  • Random APOD discovery
  • High-resolution image support

🚀 Mars Rover Photos

  • Photos from all active and historical rovers (Curiosity, Perseverance, Opportunity, Spirit)
  • Search by Martian sol (day) or Earth date
  • Multiple camera support (FHAZ, RHAZ, MAST, CHEMCAM, etc.)
  • Latest mission updates and rover manifests

☄️ Near Earth Objects (Asteroids)

  • Real-time asteroid approach tracking
  • Potentially hazardous asteroid identification
  • Detailed orbital and physical characteristics
  • Comprehensive asteroid database browsing

📸 NASA Media Library

  • Search NASA's vast image and video collection
  • High-resolution space imagery
  • Historical mission photography
  • Educational content discovery

🚄 Performance & Reliability

  • Smart caching (30min for images, 10min for dynamic data)
  • Rate limit awareness and management
  • Comprehensive error handling
  • Multi-tier caching strategy

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • NASA API key (get free at api.nasa.gov)
  • pip or uv package manager

Installation

  1. Clone the project:
bash
git clone https://github.com/jezweb/nasa-mcp-server.git
cd nasa-mcp-server
  1. Install dependencies:
bash
pip install -r requirements.txt
  1. Configure environment:
bash
cp .env.example .env
# Edit .env with your NASA API key
  1. Run the server:
bash
# STDIO transport (default)
python nasa_server.py

# HTTP transport
TRANSPORT=http PORT=8000 python nasa_server.py

# Development with FastMCP
fastmcp dev nasa_server.py

# Test the server
python nasa_server.py --test

🛠 Available Tools

APOD Tools

get_apod

Get today's Astronomy Picture of the Day or specific date.

Parameters:

  • date_str (optional): Date in YYYY-MM-DD format
  • hd (bool): Request high-definition image URL (default: true)
  • include_concepts (bool): Include concept tags (default: false)

Example:

json
{
  "date_str": "2024-01-15",
  "hd": true,
  "include_concepts": false
}

get_random_apod

Get random APOD images for discovery.

Parameters:

  • count (int): Number of random images (1-100, default: 5)

get_apod_date_range

Get APOD images for a date range.

Parameters:

  • start_date (str): Start date in YYYY-MM-DD format
  • end_date (str): End date in YYYY-MM-DD format (max 7 days)
  • hd (bool): Request high-definition images (default: true)

Mars Rover Tools

get_mars_photos_by_sol

Get Mars rover photos by Martian sol (day).

Parameters:

  • rover (str): Rover name (curiosity, perseverance, opportunity, spirit)
  • sol (int): Martian sol number (default: 1000)
  • camera (optional): Camera abbreviation (fhaz, rhaz, mast, chemcam, etc.)
  • page (int): Page number for pagination (default: 1)

Example:

json
{
  "rover": "curiosity",
  "sol": 3000,
  "camera": "mast"
}

get_mars_photos_by_date

Get Mars rover photos by Earth date.

Parameters:

  • rover (str): Rover name (default: "curiosity")
  • earth_date (optional): Date in YYYY-MM-DD format (defaults to today)
  • camera (optional): Camera abbreviation

get_latest_mars_photos

Get the latest photos from a Mars rover.

Parameters:

  • rover (str): Rover name (default: "curiosity")
  • camera (optional): Camera abbreviation

get_rover_manifest

Get Mars rover mission information and photo availability.

Parameters:

  • rover (str): Rover name (default: "curiosity")

Asteroid Tools

get_asteroids_feed

Get asteroids approaching Earth within a date range.

Parameters:

  • start_date (optional): Start date in YYYY-MM-DD format (defaults to today)
  • end_date (optional): End date in YYYY-MM-DD format (max 7 days from start)
  • detailed (bool): Include detailed orbital data (default: false)

Example:

json
{
  "start_date": "2024-08-18",
  "end_date": "2024-08-25",
  "detailed": true
}

lookup_asteroid

Look up specific asteroid by NASA JPL ID.

Parameters:

  • asteroid_id (str): NASA JPL small body database ID

browse_asteroids

Browse the Near Earth Objects database.

Parameters:

  • page (int): Page number (0-based, default: 0)
  • size (int): Results per page (max 20, default: 20)

NASA Media Tools

search_nasa_media

Search NASA's image and video library.

Parameters:

  • query (str): Search terms
  • media_type (str): Type of media (image, video, audio) (default: "image")
  • page (int): Page number (default: 1)
  • page_size (int): Results per page (max 100, default: 100)

Example:

json
{
  "query": "apollo moon landing",
  "media_type": "image",
  "page": 1,
  "page_size": 20
}

📋 Resources

nasa://api/status

Get API status, usage statistics, and rate limiting information.

nasa://cache/stats

Get cache performance statistics for both image and dynamic caches.

nasa://rovers/info

Get detailed information about all Mars rovers, their cameras, and capabilities.

🎯 Prompts

space_exploration

Generate comprehensive space exploration analysis for any topic.

Parameters:

  • topic (str): Space exploration topic to analyze

mars_mission_report

Create detailed Mars rover mission reports.

Parameters:

  • rover (str): Rover name (default: "curiosity")

asteroid_watch

Generate asteroid monitoring and threat assessment reports.

Parameters:

  • days_ahead (int): Days to monitor (default: 30)

daily_space_brief

Generate comprehensive daily space exploration briefings.

⚙️ Configuration

Edit the .env file to customize server behavior:

env
# API Configuration
API_KEY=your_nasa_api_key_here
DEFAULT_COUNT=10

# Cache Settings
CACHE_TTL_IMAGES=1800      # 30 minutes
CACHE_TTL_DYNAMIC=600      # 10 minutes

# Rate Limiting
MAX_HOURLY_CALLS=1000      # For registered API keys
DEMO_HOURLY_LIMIT=30       # For DEMO_KEY

# Server Settings
LOG_LEVEL=INFO
TRANSPORT=stdio
PORT=8000

NASA API Key

  1. Free Tier (DEMO_KEY): 30 requests/hour, 50/day per IP
  2. Registered Key: 1,000 requests/hour (free signup at api.nasa.gov)

🚀 Deployment

Local Installation (Claude Desktop)

bash
fastmcp install claude-desktop nasa_server.py

FastMCP Cloud Deployment

  1. Create GitHub repository:
bash
git init
git add .
git commit -m "NASA MCP Server"
gh repo create nasa-mcp-server --public
git push -u origin main
  1. Deploy on fastmcp.cloud:

    • Sign in with GitHub
    • Create new project from repository
    • Set entrypoint: nasa_server.py
    • Add environment variables from .env
    • Deploy
  2. Connect to Claude Desktop:

json
{
  "mcpServers": {
    "nasa": {
      "url": "https://your-project.fastmcp.app/mcp",
      "transport": "http"
    }
  }
}

📚 Usage Examples

Space Exploration Analysis

"Analyze the current status of Mars exploration missions and show me recent rover discoveries."

Asteroid Monitoring

"What potentially hazardous asteroids are approaching Earth in the next 30 days?"

Daily Space Brief

"Give me today's space exploration update including APOD, Mars photos, and Earth imagery."

Historical Space Events

"Show me APOD images from the Apollo 11 anniversary week in July 2019."

Mars Mission Comparison

"Compare the latest photos from Curiosity and Perseverance rovers, what are they currently investigating?"

Educational Content

"Search NASA's media library for educational content about black holes and show me the most relevant images."

🔧 Development

Testing

bash
# Run test mode
python nasa_server.py --test

# Test with FastMCP client
fastmcp dev nasa_server.py

Logging

Enable debug logging in .env:

env
LOG_LEVEL=DEBUG

Adding New Features

The server is modular and extensible:

  1. Add new tools by creating @mcp.tool decorated functions
  2. Add new resources using @mcp.resource(uri) decorators
  3. Add new prompts using @mcp.prompt(name) decorators
  4. Update configuration in Config class
  5. Add caching strategy for new endpoints

🚨 Rate Limits & Best Practices

  • DEMO_KEY: 30 requests/hour, 50/day per IP address
  • Registered Key: 1,000 requests/hour
  • Caching: 30 minutes for images, 10 minutes for dynamic data
  • Batch Requests: Use date ranges and pagination wisely
  • Error Handling: Server gracefully handles API limits and errors

📖 API Documentation

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Update documentation
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

🆘 Support


Explore the universe with NASA's data! 🌌🚀✨

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "jezweb-nasa-mcp-server": {
      "command": "",
      "args": []
    }
  }
}

Use NASA MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once NASA MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add NASA MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the NASA MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "jezweb-nasa-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "nasa-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the NASA MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the NASA MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use NASA MCP Server to help me with this task?
NASA MCP Server
Sure. I read it.
Here is what I found using NASA MCP Server.

Option 2: Add an MCP server URL

Use this when NASA MCP Server is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter your server URL in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste your server URL into the Server URL field.
  2. Enter a connection name for NASA MCP Server.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the NASA MCP Server connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the NASA MCP Server tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the NASA MCP Server tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use NASA MCP Server to help me with this task?
NASA MCP Server
Sure. I read it.
Here is what I found using NASA MCP Server.

Frequently asked questions

What is the NASA MCP Server MCP server used for?

NASA MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use NASA MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use NASA MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use NASA MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With NASA MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect NASA MCP Server MCP to TypingMind?

NASA MCP Server can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does NASA MCP Server MCP provide in TypingMind?

NASA MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use NASA MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If NASA MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇