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.
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
Launch JupyterLab with the following command:
jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0
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"
}
}
}
}
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"
}
}
}
}
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 titlescount
: Number of datasets to returntemporal
: (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 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 namecount
: Number of granules to returntemporal
: (Optional) Date rangebounding_box
: (Optional) Geographic boundsDownload 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 datashort_name
: Dataset short namecount
: Number of granules to downloadtemporal
: (Optional) Date rangebounding_box
: (Optional) Geographic boundsThe server includes these Jupyter notebook manipulation tools:
append_markdown_cell
: Add markdown content to notebookinsert_markdown_cell
: Insert markdown at specific positionsoverwrite_cell_source
: Change content of existing cellsappend_execute_code_cell
: Add and run code cellsinsert_execute_code_cell
: Insert and run code at specific positionsexecute_cell_with_progress
: Run cells with progress monitoringexecute_cell_simple_timeout
: Run cells with timeout limitsexecute_cell_streaming
: Run cells with streaming outputread_all_cells
: Get content of all notebook cellsread_cell
: Access specific cell contentget_notebook_info
: Retrieve notebook metadatadelete_cell
: Remove cells from notebookThe server includes ready-to-use prompts for common tasks:
Generates a complete workflow for downloading and analyzing global sea level data using both Earthdata tools and Jupyter analysis capabilities.
Creates a search for sea level rise datasets within a specific time period:
# Example usage
sealevel_rise_dataset(start_year=2010, end_year=2023)
Provides information about dataset formats available through the system.
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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