Logo di NASA MCP Server

NASA MCP Server

Community
jezweb

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

Autorejezweb
Repositorynasa-mcp-server
LinguaPython
Fork
1
Stelle
9
Strumenti disponibili
0
Tipo di trasportostdio, streamable-http
Categorie
Link
  • Collega gli strumenti ai flussi di lavoro IA

    NASA MCP Server mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    9 stelle e 1 fork nel repository collegato.

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! 🌌🚀✨

Installazione

TypingMind
Prerequisiti:

Node.js 18+

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

Usa MCP NASA MCP Server con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso NASA MCP Server, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Puoi eseguire MCP localmente sul tuo dispositivo o connetterti all'URL di un server MCP remoto.

Opzione 1: usa il connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi NASA MCP Server come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di NASA MCP Server.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "jezweb-nasa-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "nasa-mcp-server"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di NASA MCP Server, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di NASA MCP Server.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare NASA MCP Server per aiutarmi con questa attività?
NASA MCP Server
Certo. Ho letto.
Ecco cosa ho trovato con NASA MCP Server.

Opzione 2: aggiungi l'URL di un server MCP

Usa questo metodo se NASA MCP Server è già ospitato in remoto o se il tuo team vuole un unico connettore condiviso accessibile a più utenti.

1

Apri Connettori MCP

In TypingMind, vai su Plugin, apri Connettori MCP e scegli Aggiungi URL.

  1. Apri TypingMind nel tuo browser.
  2. Vai a Plugin.
  3. Apri Connettori MCP.
  4. Fai clic su Aggiungi URL.
Modulo di TypingMind per aggiungere l'URL di un server MCP personalizzato
2

Incolla l'URL del server

Inserisci URL del tuo server nel campo URL del server. Aggiungi un nome per la connessione, una descrizione, un'icona, header HTTP personalizzati o le impostazioni del client OAuth se richiesti dal server.

  1. Incolla URL del tuo server nel campo URL del server.
  2. Inserisci un nome per la connessione a NASA MCP Server.
  3. Aggiungi una descrizione e un'icona per riconoscere più facilmente la connessione.
  4. Aggiungi header HTTP personalizzati o i dati del client OAuth se il server richiede l'autenticazione.
3

Crea la connessione

Fai clic su Crea connessione, poi torna all'elenco dei plugin e verifica che la nuova connessione MCP sia attiva.

  1. Fai clic su Crea connessione.
  2. Torna all'elenco dei connettori MCP.
  3. Verifica che la connessione NASA MCP Server risulti attiva.
  4. Aggiorna l'elenco dei plugin se la connessione non appare subito.
4

Cambia modello senza riconnetterti

Avvia una chat con il tuo modello preferito, abilita gli strumenti di NASA MCP Server dalla sezione Plugin e passa a un altro modello quando serve. La connessione MCP rimane disponibile nell'area di lavoro di TypingMind.

  1. Avvia una nuova chat in TypingMind.
  2. Seleziona il modello IA che vuoi usare.
  3. Abilita gli strumenti di NASA MCP Server dalla sezione Plugin.
  4. Chiedi al modello di usare lo strumento quando serve.
  5. Passa a un altro modello IA e riutilizza la stessa connessione MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare NASA MCP Server per aiutarmi con questa attività?
NASA MCP Server
Certo. Ho letto.
Ecco cosa ho trovato con NASA MCP Server.

Domande frequenti

A cosa serve il server MCP NASA MCP Server?

NASA MCP Server è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare NASA MCP Server MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare NASA MCP Server con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP NASA MCP Server con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando NASA MCP Server, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego NASA MCP Server MCP a TypingMind?

Puoi collegare NASA MCP Server a TypingMind con il connettore MCP locale oppure aggiungendo l'URL di un server MCP remoto. Usa il connettore locale quando il server deve accedere a file, app o risorse private sul tuo dispositivo; usa invece l'URL del server quando il server MCP è ospitato in remoto.

Quali strumenti offre NASA MCP Server MCP in TypingMind?

NASA MCP Server mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare NASA MCP Server MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se NASA MCP Server richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇