by ProgramComputer
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.
NASA-MCP-server is a Model Context Protocol (MCP) server designed to provide a standardized interface for AI models to interact with NASA's extensive data sources. It acts as a unified gateway to various NASA APIs, including APOD, NEO, EPIC, and GIBS, making it easier for AI applications to access and utilize space-related data.
There are several ways to use NASA-MCP-server:
env NASA_API_KEY=YOUR_API_KEY npx -y @programcomputer/nasa-mcp-server@latestnpm install), and run with your API key (NASA_API_KEY=YOUR_API_KEY npm start).mcp.json in your Cursor configuration directory with the server command and your NASA API key.@modelcontextprotocol/sdk to make requests to the server, as demonstrated in the provided TypeScript examples for various NASA APIs.Q: Is this project officially affiliated with NASA?
A: No, this project is an independent implementation and is not affiliated with, endorsed by, or related to NASA (National Aeronautics and Space Administration) or any of its subsidiaries or affiliates.
Q: What NASA APIs are included?
A: The server integrates with NASA Open API (APOD, EPIC, DONKI, Insight, Mars Rover Photos, NEO, EONET, TLE, NASA Image and Video Library, Exoplanet Archive, NASA Sounds API, POWER), JPL Solar System Dynamics API (SBDB, SBDB Close-Approach Data, Fireball Data, Scout API), and Earth Data APIs (GIBS, CMR, FIRMS).
Q: How do I get a NASA API key?
A: You can obtain a NASA API key from https://api.nasa.gov/.
Q: Does it support Server-Sent Events (SSE)?
A: While the developers do not endorse it, you can use SuperGateway for Server-Sent Events (SSE) at your own discretion.
Q: How can I test the APIs?
A: The project includes a script ./scripts/test-with-inspector.sh to help you test the APIs using the MCP Inspector, along with example test requests in docs/inspector-test-examples.md.
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!
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.
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
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.
# 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
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.
The server can be configured with the following environment variables:
| Variable | Description |
|---|---|
NASA_API_KEY |
Your NASA API key (get at api.nasa.gov) |
This MCP server integrates the following NASA APIs:
NASA Open API (api.nasa.gov):
JPL Solar System Dynamics API (ssd-api.jpl.nasa.gov):
Earth Data APIs:
Each NASA API is exposed through standardized MCP methods:
{
"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
}
}
{
"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
}
}
{
"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)
}
}
{
"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"
}
}
{
"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.
The server includes comprehensive logging:
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
This MCP server implements security best practices following the Model Context Protocol specifications:
# 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
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:
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.
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"
}
});
npm testISC License - see LICENSE file for details
Please log in to share your review and rating for this MCP.
Discover more MCP servers with similar functionality and use cases
by danny-avila
Provides a customizable ChatGPT‑like web UI that integrates dozens of AI models, agents, code execution, image generation, web search, speech capabilities, and secure multi‑user authentication, all open‑source and ready for self‑hosting.
by ahujasid
BlenderMCP integrates Blender with Claude AI via the Model Context Protocol (MCP), enabling AI-driven 3D scene creation, modeling, and manipulation. This project allows users to control Blender directly through natural language prompts, streamlining the 3D design workflow.
by pydantic
Enables building production‑grade generative AI applications using Pydantic validation, offering a FastAPI‑like developer experience.
by GLips
Figma-Context-MCP is a Model Context Protocol (MCP) server that provides Figma layout information to AI coding agents. It bridges design and development by enabling AI tools to directly access and interpret Figma design data for more accurate and efficient code generation.
by mcp-use
Easily create and interact with MCP servers using custom agents, supporting any LLM with tool calling and offering multi‑server, sandboxed, and streaming capabilities.
by sonnylazuardi
This project implements a Model Context Protocol (MCP) integration between Cursor AI and Figma, allowing Cursor to communicate with Figma for reading designs and modifying them programmatically.
by lharries
WhatsApp MCP Server is a Model Context Protocol (MCP) server for WhatsApp that allows users to search, read, and send WhatsApp messages (including media) through AI models like Claude. It connects directly to your personal WhatsApp account via the WhatsApp web multi-device API and stores messages locally in a SQLite database.
by idosal
GitMCP is a free, open-source remote Model Context Protocol (MCP) server that transforms any GitHub project into a documentation hub, enabling AI tools to access up-to-date documentation and code directly from the source to eliminate "code hallucinations."
by Klavis-AI
Klavis AI provides open-source Multi-platform Control Protocol (MCP) integrations and a hosted API for AI applications. It simplifies connecting AI to various third-party services by managing secure MCP servers and authentication.