Nasa Mcp Server

Created byProgramComputerProgramComputer

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.

Overview

What is NASA-MCP-server?

NASA-MCP-server is a Model Context Protocol (MCP) server specifically designed for NASA APIs. It provides a standardized interface that allows various AI models to interact seamlessly with NASA's extensive array of data sources. This server acts as a bridge between AI applications and NASA's data, enabling efficient data retrieval and processing.

Features of NASA-MCP-server

  • Standardized Interface: The MCP server offers a consistent and uniform interface for AI models, simplifying the integration process with NASA's data.
  • Data Accessibility: It facilitates easy access to a wide range of NASA's datasets, making it easier for developers and researchers to utilize this valuable information.
  • AI Model Compatibility: The server is designed to work with various AI models, ensuring flexibility and adaptability for different applications.
  • Open Source: Being a public repository, NASA-MCP-server is open for contributions, allowing developers to enhance its features and capabilities collaboratively.

How to Use NASA-MCP-server

  1. Clone the Repository: Start by cloning the NASA-MCP-server repository from GitHub to your local machine.

    git clone https://github.com/ProgramComputer/NASA-MCP-server.git
    
  2. Set Up the Environment: Ensure you have the necessary dependencies installed. Follow the instructions in the repository's README file for setting up the environment.

  3. Run the Server: Launch the server using the provided scripts or commands. This will start the MCP server, making it ready to accept requests from AI models.

  4. Integrate with AI Models: Use the standardized API endpoints provided by the server to connect your AI models. This will allow your models to fetch data from NASA's databases seamlessly.

  5. Contribute: If you have improvements or features to add, consider contributing to the project by submitting a pull request on GitHub.

Frequently Asked Questions

Q1: What is the purpose of the NASA-MCP-server?

A1: The NASA-MCP-server serves as a bridge between AI models and NASA's data sources, providing a standardized interface for easier data access and integration.

Q2: Is NASA-MCP-server open source?

A2: Yes, NASA-MCP-server is an open-source project available on GitHub, allowing anyone to contribute and enhance its functionality.

Q3: How can I contribute to the NASA-MCP-server?

A3: You can contribute by forking the repository, making your changes, and submitting a pull request. Ensure to follow the contribution guidelines provided in the repository.

Q4: What kind of data can I access using NASA-MCP-server?

A4: You can access a wide variety of datasets provided by NASA, including satellite imagery, climate data, and other scientific datasets.

Q5: Do I need special permissions to use NASA-MCP-server?

A5: No special permissions are required to use the NASA-MCP-server, as it is publicly available for anyone interested in utilizing NASA's data.

Details

NPM Version

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

env NASA_API_KEY=YOUR_API_KEY npx -y @programcomputer/nasa-mcp-server@latest

You can also pass the API key as a command line argument:

npx -y @programcomputer/nasa-mcp-server@latest --nasa-api-key=YOUR_API_KEY

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

### Clone the repository
git clone https://github.com/ProgramComputer/NASA-MCP-server.git

### Install dependencies
cd NASA-MCP-server
npm install

### Run with your API key
NASA_API_KEY=YOUR_API_KEY npm start

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:

{
  "mcpServers": {
    "nasa-mcp": {
      "command": "npx",
      "args": ["-y", "@programcomputer/nasa-mcp-server@latest"],
      "env": {
        "NASA_API_KEY": "your-api-key"
      }
    }
  }
}

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:

VariableDescription
NASA_API_KEYYour NASA API key (get at api.nasa.gov)

Included NASA APIs

This MCP server integrates the following NASA APIs:

  1. 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)
  2. JPL Solar System Dynamics API (ssd-api.jpl.nasa.gov):

    • SBDB (Small-Body DataBase)
    • SBDB Close-Approach Data
    • Fireball Data
    • Scout API
  3. 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)

{
  "method": "nasa/apod",
  "params": {
    "date": "2023-01-01", // Optional: YYYY-MM-DD format
    "count": 5, // Optional: Return a specified number of random images
    "thumbs": true // Optional: Return URL of video thumbnail
  }
}

Mars Rover Photos

{
  "method": "nasa/mars-rover",
  "params": {
    "rover": "curiosity", // Required: "curiosity", "opportunity", or "spirit"
    "sol": 1000, // Either sol or earth_date is required
    "earth_date": "2023-01-01", // YYYY-MM-DD format
    "camera": "FHAZ" // Optional: Filter by camera type
  }
}

Near Earth Objects

{
  "method": "nasa/neo",
  "params": {
    "start_date": "2023-01-01", // Required: YYYY-MM-DD format
    "end_date": "2023-01-07" // Required: YYYY-MM-DD format (max 7 days from start)
  }
}

GIBS (Global Imagery Browse Services)

{
  "method": "nasa/gibs",
  "params": {
    "layer": "MODIS_Terra_CorrectedReflectance_TrueColor", // Required: Layer ID
    "date": "2023-01-01", // Required: YYYY-MM-DD format
    "format": "png" // Optional: "png" or "jpg"
  }
}

POWER (Prediction Of Worldwide Energy Resources)

{
  "method": "nasa/power",
  "params": {
    "parameters": "T2M,PRECTOTCORR,WS10M", // Required: Comma-separated list
    "community": "re", // Required: Community identifier
    "latitude": 40.7128, // Required: Latitude
    "longitude": -74.0060, // Required: Longitude
    "start": "20220101", // Required: Start date (YYYYMMDD)
    "end": "20220107" // Required: End date (YYYYMMDD)
  }
}

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:

[INFO] NASA MCP Server initialized successfully
[INFO] Processing APOD request for date: 2023-01-01
[INFO] Fetching Mars Rover data for Curiosity, sol 1000
[WARNING] Rate limit threshold reached (80%)
[ERROR] Invalid parameter: 'date' must be in YYYY-MM-DD format

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

### Clone the repository
git clone https://github.com/ProgramComputer/NASA-MCP-server.git

### Install dependencies
npm install

### Copy the example environment file and update with your API keys
cp .env.example .env

### Build the TypeScript code
npm run build

### Start the development server
npm run dev

### Run tests
npm test

Testing with MCP Inspector

The NASA MCP Server includes a script to help you test the APIs using the MCP Inspector:

### Run the provided test script
./scripts/test-with-inspector.sh

This will:

  1. Build the project to ensure the latest changes are included
  2. Start the MCP Inspector with the NASA MCP server running
  3. 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:

### View the example test requests
cat docs/inspector-test-examples.md

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:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { HttpClientTransport } from "@modelcontextprotocol/sdk/client/http.js";

const transport = new HttpClientTransport({
  url: "http://localhost:3000",
});

const client = new Client({
  name: "mcp-client",
  version: "1.0.0",
});

await client.connect(transport);

// Example: Get today's Astronomy Picture of the Day
const apodResult = await client.request({
  method: "nasa/apod", 
  params: {}
});

// Example: Get Mars Rover photos
const marsRoverResult = await client.request({
  method: "nasa/mars-rover",
  params: { rover: "curiosity", sol: 1000 }
});

// Example: Search for Near Earth Objects
const neoResults = await client.request({
  method: "nasa/neo",
  params: {
    start_date: '2023-01-01',
    end_date: '2023-01-07'
  }
});

// Example: Get satellite imagery from GIBS
const satelliteImage = await client.request({
  method: "nasa/gibs",
  params: {
    layer: 'MODIS_Terra_CorrectedReflectance_TrueColor',
    date: '2023-01-01'
  }
});

// Example: Use the new POWER API
const powerData = await client.request({
  method: "nasa/power",
  params: {
    parameters: "T2M,PRECTOTCORR,WS10M",
    community: "re",
    latitude: 40.7128,
    longitude: -74.0060,
    start: "20220101",
    end: "20220107"
  }
});

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Run tests: npm test
  4. Submit a pull request

License

ISC License - see LICENSE file for details

Server Config

{
  "mcpServers": {
    "nasa-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/metorial/mcp-container--programcomputer--nasa-mcp-server--nasa-mcp-server",
        "npm run start"
      ],
      "env": {
        "NASA_API_KEY": "nasa-api-key"
      }
    }
  }
}

Project Info

Author
ProgramComputer
Created At
Aug 19, 2025
Star
66
Language
TypeScript
Tags
-

Nasa Mcp Server Alternative

For some alternatives to Nasa Mcp Server that you may need, we provide you with sites divided by category.

MCP server for Hugging Face dataset viewer

Connect any Open Data to any LLM with Model Context Protocol.

A MCP for searching and downloading academic papers from multiple sources like arXiv, PubMed, bioRxiv, etc.

MCP server for searching and querying the PubMed medical papers/research database

A MCP server to search for accurate academic articles.

Audiense Insights MCP Server is a server based on the Model Context Protocol (MCP) that enables Claude and other MCP-compatible clients to interact with your Audiense Insights account.

Mcp.env
@chaseSpace

mcp_fetch_xhs_post

View More >>