NASA Earthdata MCP server

Provides a bridge to NASA's Earthdata platform for searching and retrieving Earth science datasets and data granules based on keywords, temporal ranges, and geographic boundaries.
Back to servers
Setup instructions
Provider
Datalayer
Release date
Feb 28, 2025
Language
Python
Package
Stats
21 stars

Earthdata MCP Server provides tools to interact with NASA Earth Data through the Model Context Protocol (MCP). It enables efficient dataset discovery, retrieval, and analysis for geospatial research by combining Earth data capabilities with Jupyter notebook manipulation tools.

Installation

Set Up Your Environment

First, install the required dependencies:

pip install jupyterlab==4.4.1 jupyter-collaboration==4.0.2 ipykernel
pip uninstall -y pycrdt datalayer_pycrdt
pip install datalayer_pycrdt==0.12.17

Start JupyterLab

Launch JupyterLab with the following command:

jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0

Configure Your MCP Client

For macOS and Windows

Create a configuration with the following JSON:

{
  "mcpServers": {
    "earthdata": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DOCUMENT_URL",
        "-e",
        "DOCUMENT_TOKEN",
        "-e",
        "DOCUMENT_ID",
        "-e",
        "RUNTIME_URL",
        "-e",
        "RUNTIME_TOKEN",
        "datalayer/earthdata-mcp-server:latest"
      ],
      "env": {
        "DOCUMENT_URL": "http://host.docker.internal:8888",
        "DOCUMENT_TOKEN": "MY_TOKEN",
        "DOCUMENT_ID": "notebook.ipynb",
        "RUNTIME_URL": "http://host.docker.internal:8888",
        "RUNTIME_TOKEN": "MY_TOKEN",
        "EARTHDATA_USERNAME": "your_username",
        "EARTHDATA_PASSWORD": "your_password"
      }
    }
  }
}

For Linux

Use this configuration instead:

{
  "mcpServers": {
    "earthdata": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DOCUMENT_URL",
        "-e",
        "DOCUMENT_TOKEN",
        "-e",
        "DOCUMENT_ID",
        "-e",
        "RUNTIME_URL",
        "-e",
        "RUNTIME_TOKEN",
        "--network=host",
        "datalayer/earthdata-mcp-server:latest"
      ],
      "env": {
        "DOCUMENT_URL": "http://localhost:8888",
        "DOCUMENT_TOKEN": "MY_TOKEN",
        "DOCUMENT_ID": "notebook.ipynb",
        "RUNTIME_URL": "http://localhost:8888",
        "RUNTIME_TOKEN": "MY_TOKEN",
        "EARTHDATA_USERNAME": "your_username",
        "EARTHDATA_PASSWORD": "your_password"
      }
    }
  }
}

Available Tools

Earthdata-Specific Tools

search_earth_datasets

Search for datasets on NASA Earthdata:

# Example usage:
search_earth_datasets(
    search_keywords="sea level rise", 
    count=5, 
    temporal=("2020-01-01", "2023-12-31"),
    bounding_box=(-180, -90, 180, 90)
)

Parameters:

  • search_keywords: Keywords to search for in dataset titles
  • count: Number of datasets to return
  • temporal: (Optional) Date range as (date_from, date_to)
  • bounding_box: (Optional) Geographic bounds as (lower_left_lon, lower_left_lat, upper_right_lon, upper_right_lat)

search_earth_datagranules

Search for data granules within a dataset:

# Example usage:
search_earth_datagranules(
    short_name="JASON3_GDR", 
    count=10,
    temporal=("2022-01-01", "2022-12-31"),
    bounding_box=(-120, 20, -60, 50)
)

Parameters:

  • short_name: Dataset short name
  • count: Number of granules to return
  • temporal: (Optional) Date range
  • bounding_box: (Optional) Geographic bounds

download_earth_data_granules

Download data granules and prepare them for analysis:

# Example usage:
download_earth_data_granules(
    folder_name="sea_level_data",
    short_name="JASON3_GDR",
    count=5,
    temporal=("2022-01-01", "2022-12-31"),
    bounding_box=(-120, 20, -60, 50)
)

Parameters:

  • folder_name: Local folder to save downloaded data
  • short_name: Dataset short name
  • count: Number of granules to download
  • temporal: (Optional) Date range
  • bounding_box: (Optional) Geographic bounds

Jupyter Notebook Tools

The server includes these Jupyter notebook manipulation tools:

  • append_markdown_cell: Add markdown content to notebook
  • insert_markdown_cell: Insert markdown at specific positions
  • overwrite_cell_source: Change content of existing cells
  • append_execute_code_cell: Add and run code cells
  • insert_execute_code_cell: Insert and run code at specific positions
  • execute_cell_with_progress: Run cells with progress monitoring
  • execute_cell_simple_timeout: Run cells with timeout limits
  • execute_cell_streaming: Run cells with streaming output
  • read_all_cells: Get content of all notebook cells
  • read_cell: Access specific cell content
  • get_notebook_info: Retrieve notebook metadata
  • delete_cell: Remove cells from notebook

Premade Prompts

The server includes ready-to-use prompts for common tasks:

download_analyze_global_sea_level

Generates a complete workflow for downloading and analyzing global sea level data using both Earthdata tools and Jupyter analysis capabilities.

sealevel_rise_dataset

Creates a search for sea level rise datasets within a specific time period:

# Example usage
sealevel_rise_dataset(start_year=2010, end_year=2023)

ask_datasets_format

Provides information about dataset formats available through the system.

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 "earthdata" '{"command":"docker","args":["run","-i","--rm","datalayer/earthdata-mcp-server:latest"]}'

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": {
        "earthdata": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "datalayer/earthdata-mcp-server:latest"
            ]
        }
    }
}

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": {
        "earthdata": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "datalayer/earthdata-mcp-server:latest"
            ]
        }
    }
}

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