NASA APIsのロゴ

NASA APIs

コミュニティ
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.

公開者ProgramComputer
リポジトリNASA-MCP-server
言語TypeScript
フォーク
17
スター
92
利用可能なツール
23
通信方式stdio
カテゴリ
ライセンスISC
リンク
  • ツールをAIワークフローに接続

    NASA APIsは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 23個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには92件のスターと17件のフォークがあります。

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

bash
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:

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

Manual Installation

bash
# 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

Replace YOUR_API_KEY with your NASA API key from https://api.nasa.gov/.

Environment Variables

The server can be configured with the following environment variables:

VariableDescription
NASA_API_KEYYour NASA API key (get at api.nasa.gov)
MCP_TRANSPORTTransport mode: stdio (default) or http for Streamable HTTP
MCP_HTTP_HOSTHost for Streamable HTTP mode (default: 127.0.0.1)
MCP_HTTP_PORTPort for Streamable HTTP mode (default: 3000)
MCP_HTTP_PATHMCP endpoint path for Streamable HTTP mode (default: /mcp)

Transport Modes

By default, the server runs over stdio for local MCP clients such as Cursor and Claude Desktop.

To run the optional Streamable HTTP transport:

bash
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 NASA_API_KEY=YOUR_API_KEY npm start

The Streamable HTTP endpoint will be available at:

text
http://127.0.0.1:3000/mcp

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)

json
{
  "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

json
{
  "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

json
{
  "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)

json
{
  "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)

json
{
  "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

bash
# 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:

bash
# 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:

bash
# 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. For local clients, use the default stdio configuration shown above. For Streamable HTTP mode, start the server with MCP_TRANSPORT=http, then connect with the MCP SDK:

typescript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { CallToolResultSchema } from "@modelcontextprotocol/sdk/types.js";

const transport = new StreamableHTTPClientTransport(
  new URL("http://127.0.0.1:3000/mcp")
);

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: "tools/call",
  params: {
    name: "nasa/apod",
    arguments: {}
  }
}, CallToolResultSchema);

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

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

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

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

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

インストール

TypingMind
前提条件:

Node.js 18+

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

利用可能なツール

  • nasa_apod

    Fetch NASA's Astronomy Picture of the Day

  • nasa_neo

    Near Earth Object Web Service - information about asteroids

  • nasa_epic

    Earth Polychromatic Imaging Camera - views of Earth

  • nasa_gibs

    Global Imagery Browse Services - satellite imagery

  • nasa_cmr

    NASA Common Metadata Repository - search for NASA data collections

  • nasa_firms

    NASA Fire Information for Resource Management System - fire data

  • nasa_images

    NASA Image and Video Library - search NASA's media archive

  • nasa_exoplanet

    NASA Exoplanet Archive - data about planets beyond our solar system

  • nasa_donki

    Space Weather Database Of Notifications, Knowledge, Information

  • nasa_mars_rover

    NASA Mars Rover Photos - images from Mars rovers

  • nasa_eonet

    Earth Observatory Natural Event Tracker - natural events data

  • nasa_power

    Prediction of Worldwide Energy Resources - meteorological data

  • jpl_sbdb

    Small-Body Database (SBDB) - asteroid and comet data

  • jpl_fireball

    Fireball data - atmospheric impact events

  • jpl_jd_cal

    Julian Day number to/from calendar date/time converter

  • jpl_nhats

    Human-accessible NEOs (Near-Earth Objects) data

  • jpl_cad

    Asteroid and comet close approaches to the planets in the past and future

  • jpl_sentry

    JPL Sentry - NEO Earth impact risk assessment data

  • jpl_horizons

    JPL Horizons - Solar system objects ephemeris data

  • jpl_horizons_file

    JPL Horizons - Solar system objects ephemeris data (File Input)

  • jpl_periodic_orbits

    JPL Three-Body Periodic Orbits Database

  • nasa_osdr_files

    NASA OSDR - Get data files for an OSD study

  • jpl_scout

    Scout - NEOCP orbits, ephemerides, and impact risk data

NASA APIsのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度NASA APIsに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

NASA APIsをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. NASA APIsのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "nasa-apis": {
      "command": "npx",
      "args": [
        "-y",
        "nasa-mcp-server"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてNASA APIsのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. NASA APIsのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
NASA APIsを使ってこのタスクを手伝ってもらえますか?
NASA APIs
はい、読みました。
NASA APIsで調べた結果をお伝えします。

よくある質問

NASA APIs MCPサーバーは何に使いますか?

NASA APIsは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでNASA APIs MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでNASA APIsを利用できます。

TypingMindでNASA APIs MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。NASA APIsを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

NASA APIs MCPをTypingMindに接続するにはどうすればよいですか?

NASA APIsはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでNASA APIs MCPのどのようなツールを利用できますか?

NASA APIsは23個のMCPツールを提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

NASA APIs MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。NASA APIsで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

Astronomy Picture of the Day (2023-01-01)
EPIC Earth View (2023-01-01)
Near Earth Objects (2023-01-01)
nasa-apod-image

NASA Astronomy Picture of the Day

nasa-epic-image

NASA EPIC Earth observation image

mars-rover-photo

NASA Mars Rover photograph

nasa-image

NASA Image and Video Library item

nasa-gibs-imagery

NASA Global Imagery Browse Services (GIBS) satellite image

jpl-asteroid-data

JPL Small-Body Database entry

nasa-earth-imagery

NASA Earth Landsat satellite imagery

nasa/get-astronomy-picture

Fetch NASA's Astronomy Picture of the Day with optional date selection

nasa/browse-near-earth-objects

Find near-Earth asteroids within a specific date range

nasa/view-epic-imagery

Browse Earth Polychromatic Imaging Camera views of Earth

jpl_query-small-body-database

Search the Small-Body Database for asteroids and comets matching specific criteria

jpl_find-close-approaches

Find close approaches of asteroids and comets to Earth or other planets

jpl_get-fireball-data

Retrieve data about fireballs detected by US Government sensors

apod-daily

Get NASA's Astronomy Picture of the Day with a natural language prompt

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇