home / mcp / nasa mcp server

NASA MCP Server

NASA-MCP-server - 由 MCP工厂自动创建

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bach-ai-tools-nasa-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@bachstudio/nasa-mcp-server@latest"
      ],
      "env": {
        "NASA_API_KEY": "your-api-key"
      }
    }
  }
}

You can access NASA data through a unified MCP server that exposes multiple NASA APIs with a consistent interface. This makes it easier to build AI-assisted applications, test queries, and integrate space data into workflows without handling each API’s quirks separately.

How to use

You connect to the NASA MCP Server using an MCP client and issue standardized method calls to fetch data from various NASA APIs. Start by ensuring you have a valid NASA API key and that the MCP server is running. Then, request data like the Astronomy Picture of the Day, Mars Rover photos, near-earth object data, or satellite imagery through the same querying pattern regardless of the underlying API. The server handles input validation, error handling, and formatting the responses for easy consumption by your AI models.

Typical usage patterns include: discovering available data sources, issuing queries with required parameters, paging through results when supported, and handling rate limits gracefully. Use the MCP client to send requests with the method name that corresponds to a NASA API (for example apod, mars-rover, neo, gibs, power) and supply the required parameters. The client receives structured results optimized for AI consumption.

How to install

Prerequisites you need before installing: Node.js (recommended latest LTS) and npm. You also need a NASA API key to access NASA data.

# Install Node.js and npm if you do not have them
# Visit https://nodejs.org to download the installer for your OS

# Option A: Run the MCP server directly with npx (no local install required)
env NASA_API_KEY=YOUR_API_KEY npx -y @bachstudio/nasa-mcp-server@latest

# Option B: Install locally and start with npm (requires npm install)
# Clone or copy from the source repository into your project directory
# Then install dependencies
npm install

# Start the server with your API key
NASA_API_KEY=YOUR_API_KEY npm start

Configuration and secure usage

Configure the server to use your NASA API key and to integrate with your client and environment. The NASA API key should be supplied as an environment variable and can be passed through your deployment or local development environment.

If you use Cursor or a similar tooling environment, you can register a NASA MCP server configuration that tells the tool how to start the server and where to find the API key. The example shows running the server via npx and providing the API key in the environment.

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

Available tools

APOD

Astronomy Picture of the Day data exposed through nasa/apod with parameters like date, count, and thumbnail option.

Mars Rover

Mars Rover Photos exposed through nasa/mars-rover with parameters for rover, sol or earth_date, and camera filtering.

Near Earth Objects

NEO data exposed through nasa/neo with start_date and end_date to fetch objects within a date range.

GIBS Imagery

Global imagery through nasa/gibs with layer, date, and format parameters.

POWER Data

Power API for weather and energy resources data via nasa/power with location and date range parameters.