NASA Astronomy Picture of the Day MCP server

Integrates with NASA's Astronomy Picture of the Day API to retrieve daily space images and descriptions directly within the Cursor IDE development environment.
Back to servers
Setup instructions
Provider
Simon Liu
Release date
Mar 19, 2025
Language
TypeScript
Stats
2 stars

This MCP server provides a feature-rich tool for querying NASA data, supporting various NASA API services and natural language queries for astronomical information, Mars rover photos, Earth satellite imagery, near-Earth objects data, and space weather information.

Installation

Install in Cursor IDE

Open Cursor IDE and type the following command in the command palette:

/mcp install @cursor/nasa-mcp

Configuration

  1. Visit the NASA API Portal to obtain your API key
  2. Set the NASA_API_KEY environment variable or pass it as a parameter when using the service

Usage

Using in Cursor

You can make natural language queries directly in Cursor:

# Get today's astronomy picture
今天的天文图

# Get Mars rover photos
火星 好奇号 2024年3月18日

# Get Earth satellite imagery
地球 39.9042,116.4074

# Get near-Earth object data
近地小行星 2024年3月18日

# Get space weather information
太空天气 今天

Using in Node.js

Integrate with your Node.js applications:

const client = require('@smithery/client');

async function main() {
  // Get Mars photos
  const marsPhotos = await client.call('@cursor/nasa-mcp', '火星 好奇号 今天');
  
  // Get near-Earth object data
  const neoData = await client.call('@cursor/nasa-mcp', '近地小行星 今天');
  
  console.log(marsPhotos);
  console.log(neoData);
}

main();

Using via Command Line

Use environment variables or direct parameters:

# Using API key from environment variable
echo "火星 好奇号 今天" | NASA_API_KEY=your_api_key node nasa-mcp.js

# Using custom API key
echo "地球 39.9042,116.4074" | node nasa-mcp.js --api_key=your-api-key

Response Data Formats

Astronomy Picture of the Day (APOD)

{
  "标题": "图片标题",
  "日期": "2024-03-19",
  "说明": "详细解释",
  "图片链接": "图片URL",
  "媒体类型": "image",
  "版权": "版权信息"
}

Mars Rover Photos

{
  "火星车": "curiosity",
  "日期": "2024-03-19",
  "照片数量": 5,
  "照片列表": [
    {
      "id": 1234567,
      "拍摄时间": "2024-03-19",
      "相机": "NAVCAM",
      "图片链接": "https://..."
    }
  ]
}

Near-Earth Objects Data

{
  "日期": "2024-03-19",
  "小行星数量": 5,
  "小行星列表": [
    {
      "名称": "小行星名称",
      "直径": {
        "最小": 100,
        "最大": 200
      },
      "是否危险": "否",
      "最近距离": "1000000 公里",
      "相对速度": "50000 公里/小时"
    }
  ]
}

Space Weather Data

{
  "日期": "2024-03-19",
  "太阳耀斑": [
    {
      "开始时间": "2024-03-19T10:00:00Z",
      "结束时间": "2024-03-19T11:00:00Z",
      "等级": "M2.5",
      "位置": "N30W60"
    }
  ],
  "日冕物质抛射": [
    {
      "时间": "2024-03-19T12:00:00Z",
      "速度": "800 km/s",
      "类型": "CME"
    }
  ]
}

Supported NASA Services

Astronomy Picture of the Day (APOD)

  • Get NASA's daily astronomy picture
  • Query historical dates
  • Receive image title, description, URL, and more

Mars Rover Photos

  • Support for multiple Mars rovers: Curiosity, Opportunity, Spirit, Perseverance
  • Query Mars photos by date
  • Get images taken by different cameras

Earth Satellite Imagery

  • Get satellite images by longitude and latitude
  • Support for historical image queries
  • Provides high-resolution satellite photos

Near-Earth Objects (NEO) Data

  • Get information about near-Earth asteroids for specific dates
  • Includes asteroid size, distance, velocity, and other data
  • Hazard assessment information

Space Weather Data

  • Solar flare event information
  • Coronal mass ejection data
  • Real-time space weather conditions

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "nasa-mcp" '{"command":"npx","args":["-y","@cursor/nasa-mcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "nasa-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@cursor/nasa-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "nasa-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@cursor/nasa-mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later