Skip to main content
Glama
datalayer

Jupyter Earth MCP Server

by datalayer

数据层

成为赞助商

🌎 ✨ Jupyter Earth MCP 服务器

Github Actions 状态 PyPI - 版本

🌍 Jupyter Earth MCP Server 是一个模型上下文协议(MCP) 服务器实现,它提供了一组用于在 📓 Jupyter 笔记本中进行 🗺️ 地理空间分析的工具。

以下演示使用Earthdata MCP 服务器在 NASA Earthdata 上搜索数据集和数据颗粒,使用此 MCP 服务器在 Jupyter 中下载数据,并使用jupyter-mcp-server进行进一步分析。

启动 JupyterLab

确保已安装以下软件。协作包必不可少,因为借助Jupyter 实时协作功能,您可以看到笔记本上所做的修改。

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

然后,使用以下命令启动 JupyterLab。

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

您也可以运行make jupyterlab 。

[!笔记]

--ip设置为0.0.0.0以允许在 Docker 容器中运行的 MCP 服务器访问您的本地 JupyterLab。

Related MCP server: Earthdata MCP Server

与 Claude Desktop 一起使用

您可以从此页面下载适用于 macOS 和 Windows 的 Claude Desktop。

对于 Linux,我们成功使用了基于 nix 的非官方构建脚本

# ⚠️ UNOFFICIAL
# You can also run `make claude-linux`
NIXPKGS_ALLOW_UNFREE=1 nix run github:k3d3/claude-desktop-linux-flake \
  --impure \
  --extra-experimental-features flakes \
  --extra-experimental-features nix-command

要将其与 Claude Desktop 一起使用,请将以下内容添加到您的claude_desktop_config.json (在MCP 文档网站上阅读更多内容)。

[!重要的]

确保SERVER_URL和TOKEN的端口与jupyter lab命令中使用的端口相匹配。

NOTEBOOK_PATH应该相对于启动 JupyterLab 的目录。

macOS 和 Windows 上的 Claude 配置

{
  "mcpServers": {
    "jupyter-earth": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SERVER_URL",
        "-e",
        "TOKEN",
        "-e",
        "NOTEBOOK_PATH",
        "datalayer/jupyter-earth-mcp-server:latest"
      ],
      "env": {
        "SERVER_URL": "http://host.docker.internal:8888",
        "TOKEN": "MY_TOKEN",
        "NOTEBOOK_PATH": "notebook.ipynb"
      }
    }
  }
}

Linux 上的 Claude 配置

CLAUDE_CONFIG=${HOME}/.config/Claude/claude_desktop_config.json
cat <<EOF > $CLAUDE_CONFIG
{
  "mcpServers": {
    "jupyter-earth": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SERVER_URL",
        "-e",
        "TOKEN",
        "-e",
        "NOTEBOOK_PATH",
        "--network=host",
        "datalayer/jupyter-earth-mcp-server:latest"
      ],
      "env": {
        "SERVER_URL": "http://localhost:8888",
        "TOKEN": "MY_TOKEN",
        "NOTEBOOK_PATH": "notebook.ipynb"
      }
    }
  }
}
EOF
cat $CLAUDE_CONFIG

成分

工具

该服务器目前提供1个工具:

  1. download_earth_data_granules

  • 在 Jupyter 笔记本中添加一个代码单元,以从 NASA 地球数据下载地球数据颗粒。

  • 输入:

    • folder_name (字符串):保存数据的本地文件夹名称。

    • short_name (字符串):要下载的地球数据集的简称。

    • count (int):要下载的数据颗粒数量。

    • temporal (元组):(可选)格式为(date_from,date_to)的时间范围。

    • bounding_box (元组):(可选)格式为(lower_left_lon、lower_left_lat、upper_right_lon、upper_right_lat)的边界框。

  • 返回:单元格输出。

提示

  1. download_analyze_global_sea_level

    • 请求在 Jupyter 中下载和分析全球海平面数据。

    • 返回:提示格式正确。

建筑

您可以从源代码构建 Docker 镜像。

make build-docker

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    A
    maintenance
    A Model Context Protocol server that provides a standardized interface for AI models to interact with NASA's vast array of data sources including APOD, Mars Rover photos, satellite imagery, and space weather data.
    32
    513 npm
    93
    ISC
  • A
    license
    Not graded
    quality
    B
    maintenance
    A Model Context Protocol server that enables efficient discovery and retrieval of NASA Earth Data for geospatial analysis.
    26
    BSD 3-Clause
  • A
    license
    A
    quality
    B
    maintenance
    A Model Context Protocol server that connects Large Language Models to the GeoServer REST API, enabling AI assistants to query and manipulate geospatial data through natural language.
    9
    92
    MIT