Get the FREE Ultimate OpenClaw Setup Guide →

NASA

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio programcomputer-nasa-mcp-server npx -y @programcomputer/nasa-mcp-server@latest \
  --env NASA_API_KEY="your-api-key"

How to use

The NASA MCP Server exposes a unified MCP interface for accessing a broad collection of NASA APIs. It standardizes responses and parameter validation so AI models can query diverse NASA data sources—such as imagery, Mars weather, asteroid tracking, and space weather—through a consistent set of MCP methods (for example nasa/apod, nasa/mars-rover, nasa/neo, nasa/gibs, nasa/power, and more). This makes it easier to integrate NASA data into AI workflows, agents, or chat assistants without needing to manage multiple API clients. You can run the server with an API key and then issue MCP requests to retrieve imagery, astronomy data, near-Earth object information, and earth observation layers in a uniform format. The server also includes API method examples and detailed parameter schemas to help you construct valid requests.

To use it, supply your NASA API key via the NASA_API_KEY environment variable and call the exposed MCP endpoints (e.g., nasa/apod for Astronomy Picture of the Day, nasa/mars-rover for rover imagery, nasa/neo for near-Earth objects). The MCP layer handles request validation, rate limiting, and data formatting, so you can focus on building your AI-assisted workflows rather than dealing with API quirks. Developer tooling and examples are included to test and demonstrate each method, such as Mars Rover queries, GIBS imagery retrievals, and POWER resource calculations.

How to install

Prerequisites:

  • Node.js (recommended LTS) and npm installed on your system
  • Access to the internet to fetch packages

Option A: Run via npx (recommended for quick usage)

  1. Ensure you have Node.js and npm installed.
  2. Run the MCP server directly with npx (no local installation required):
env NASA_API_KEY=YOUR_API_KEY npx -y @programcomputer/nasa-mcp-server@latest
  1. Optionally pass the API key as a CLI argument instead:
npx -y @programcomputer/nasa-mcp-server@latest --nasa-api-key=YOUR_API_KEY

Option B: Local installation (for development)

  1. Clone the repository or install via npm if you prefer publishing locally:
git clone https://github.com/ProgramComputer/NASA-MCP-server.git
cd NASA-MCP-server
npm install
  1. Copy the example environment file and update with your API keys (if provided by the project):
cp .env.example .env
  1. Build and run the development server:
npm run build
npm run dev
  1. If you prefer to run the server directly with npm start:
NASA_API_KEY=YOUR_API_KEY npm start

Prerequisites recap:

  • Node.js and npm installed
  • NASA API key (NASA_API_KEY)
  • Optional: environment management for .env file or providing keys via CLI

Additional notes

Tips and common considerations:

  • Set NASA_API_KEY (or pass via CLI) to authenticate with NASA APIs.
  • The MCP server validates parameters automatically; refer to the API method examples in the docs for valid shapes (e.g., nasa/apod, nasa/mars-rover, nasa/neo, nasa/gibs, nasa/power).
  • Rate limit handling is included; monitor for rate limit warnings and throttle requests as needed.
  • If using Cursor or another orchestrator, you can configure an mcp.json entry similar to the example in the README to register the NASA MCP server.
  • The server supports multiple NASA APIs under a single MCP endpoint, enabling centralized access for AI agents.
  • For SSE workflows, external tools like SuperGateway can be integrated, but this is optional and not officially endorsed by NASA-MCP-server maintainers.
  • Ensure you keep your API key secure and do not commit it to source control.

Related MCP Servers

Sponsor this space

Reach thousands of developers