Skip to main content

A Python MCP Server for interacting with the Planetary Computer STAC Catalog.

Project description

Planetary Computer MCP Server

A Python implementation of the Planetary Computer MCP server, providing unified access to satellite and geospatial data through natural language queries.

Sample Outputs


Sentinel-2
Alps

Sentinel-2
Miami

NAIP
Seattle

NAIP
Los Angeles

HLS L30
Los Angeles

MODIS
Bay Area

Sentinel-1 SAR
Miami

Copernicus DEM
Miami

ESA WorldCover
Alps

IO LULC
Iowa

MS Buildings
Vector Data

TerraClimate PET
Zarr Preview

GridMET Climate Data
Heatmap Animation

TerraClimate Data
Heatmap Animation

Features

  • Unified Interface: Single download_data tool that automatically detects datasets from natural language queries
  • Natural Language Geocoding: Automatically converts place names (e.g., "San Francisco", "the Alps", "Amazon rainforest") to geospatial bounding box coordinates using the Nominatim geocoding service—no need to manually specify coordinates
  • Multi-format Support: Raster (GeoTIFF), Vector (GeoParquet), and Zarr data
  • Automatic Visualization: Generate RGB/JPEG previews for LLM analysis
  • Fast Downloads: Uses odc-stac for efficient COG access

Installation

uv sync

Usage

As MCP Server

python -m planetary_computer_mcp.server

Direct API Usage

from planetary_computer_mcp.tools.download_data import download_data

# Download Sentinel-2 data for San Francisco
result = download_data(
    query="sentinel-2 imagery",
    aoi="San Francisco",
    time_range="2024-01-01/2024-01-31"
)

print(f"Raw data: {result['raw']}")
print(f"Visualization: {result['visualization']}")

Tools

download_data

Unified tool for raster, DEM, land cover, and climate data.

Parameters:

  • query: Natural language query (e.g., "sentinel-2", "elevation data")
  • aoi: Bounding box [W,S,E,N] or place name
  • time_range: ISO8601 datetime range
  • max_cloud_cover: Maximum cloud cover (optical data)

Returns:

  • Raw GeoTIFF/Zarr/Parquet file
  • RGB/JPEG visualization
  • Metadata

download_geometries

Tool for vector/building data.

Parameters:

  • collection: Collection ID (e.g., "ms-buildings")
  • aoi: Bounding box or place name
  • limit: Maximum features

Returns:

  • GeoParquet file
  • Map visualization
  • Feature count

Supported Datasets

See collections.md for the complete list of supported datasets.

Development

Setup

uv sync --dev

Testing

uv run pytest

Linting/Formatting

uv run pre-commit run --all-files

Architecture

src/
├── core/           # Core utilities   ├── stac_client.py    # STAC search wrapper   ├── geocoding.py      # Place name → bbox   ├── collections.py    # Dataset metadata   ├── raster_utils.py   # odc-stac helpers   ├── vector_utils.py   # DuckDB helpers   ├── visualization.py  # Matplotlib viz   └── zarr_utils.py     # Xarray Zarr helpers
├── tools/          # MCP tools   ├── download_data.py
│   └── download_geometries.py
└── server.py       # MCP server entry point

License

Apache 2.0 License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

planetary_computer_mcp-1.3.1.tar.gz (37.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

planetary_computer_mcp-1.3.1-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file planetary_computer_mcp-1.3.1.tar.gz.

File metadata

  • Download URL: planetary_computer_mcp-1.3.1.tar.gz
  • Upload date:
  • Size: 37.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for planetary_computer_mcp-1.3.1.tar.gz
Algorithm Hash digest
SHA256 161e0fc6970b4d98a6b5c4125568a098866ebff31fa3962f48b2872c7dac6f70
MD5 ed36b4850334eaeaa7bee800149a6b5d
BLAKE2b-256 54c11cc8fe930ed7f9e60c417f32057d582a9248394f3851e4e177b7ba74e680

See more details on using hashes here.

File details

Details for the file planetary_computer_mcp-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: planetary_computer_mcp-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 43.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for planetary_computer_mcp-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ecb1131840fad943ea775d877fbd6a4e39d974b92a1924809d7d0f1983dcc1be
MD5 6802bb10623781d3849aeea7874cda57
BLAKE2b-256 1becf81bd859effca7a283599496bfe1798ad7b743a6b9092e1de4def26ed61e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page