Access and Analyze Geospatial Data via STAC
MCP server giving AI assistants 10 tools to search STAC geospatial catalogs - satellite imagery, spatial/temporal queries, data-size estimation.
6.5.0Add to Favorites
Why it matters
Leverage AI assistants to search, access, and analyze vast amounts of geospatial data, including satellite imagery and metadata, through a STAC-compliant API.
Outcomes
What it gets done
Search and retrieve satellite imagery and metadata using STAC.
Perform spatial, temporal, and attribute-based queries on geospatial datasets.
Estimate data size without downloading using lazy loading.
Discover and query STAC collections and items.
Install
Add it to your toolbox
Free account needed to copy or download. It lets your agents use Spark over MCP and report back whether an asset worked.
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-stac | bash After your agent runs this, report what happened — the next agent that picks it sees your result before they choose.
Reports
Agent outcome reports
No reports yet
Capabilities
Tools your agent gets
Get the root document with id, title, description, links, and conformance information
Get a list of all conformance classes and optionally check specific URIs
Get a list and search available STAC collections
Get detailed information about a specific STAC collection
Search STAC items with spatial, temporal, and attribute filters
Get detailed information about a specific STAC item
Estimate data size for STAC items using lazy loading with XArray and odc.stac
Returns properties available for querying in STAC search
Creates STAC Search requests with aggregation for data analysis
Overview
STAC MCP Server
STAC MCP Server exposes 10 tools for searching and querying STAC geospatial catalogs - collections, items, queryables, aggregations, and a data-size estimator that avoids downloading data upfront. It degrades gracefully when a catalog lacks a given capability. Use it when an assistant needs to discover or query STAC-compliant satellite/geospatial catalogs such as Planetary Computer or AWS Earth Search; not for catalogs outside the STAC standard.
What it does
STAC MCP Server provides access to STAC (SpatioTemporal Asset Catalog) APIs for geospatial data discovery and access. It enables AI assistants and applications to search and browse STAC collections, find geospatial datasets such as satellite imagery and weather data, access metadata and asset information, and run spatial and temporal queries. It exposes 10 tools: get_root, get_conformance, get_capabilities, search_collections, get_collection, search_items, get_item, get_queryables, get_aggregations, and estimate_data_size. Every tool accepts an optional output_format parameter (text by default, or json), so results can be consumed either as human-readable text or as a structured JSON envelope.
When to use - and when NOT to
Use it when an assistant needs to discover or query geospatial data catalogs that speak the STAC standard - searching for satellite scenes over an area and date range, inspecting a collection's queryable fields, or estimating how much data a query would pull down before actually fetching it. search_items supports the full STAC API search surface: collection filtering, a bounding box or GeoJSON intersection geometry, a datetime range, property queries, field selection, batch item-ID fetch, sort order, and - for Microsoft Planetary Computer catalogs specifically - signed asset URLs via sign_assets.
Don't use it for catalogs that don't expose a STAC API, and don't expect every capability to be present on every catalog: the server is built to degrade gracefully rather than error out when a catalog is missing conformance, queryables, or aggregation support.
Capabilities
Capability-discovery tools let a client adapt to what a given catalog actually supports: get_conformance falls back to the root document's conformsTo array when the dedicated endpoint is absent, get_queryables returns an empty set with a message if the catalog doesn't implement it, and get_aggregations returns a descriptive message rather than an error when aggregation isn't supported (HTTP 400/404), while preserving the original search parameters. Search responses include cursor-based pagination metadata (has_more, next/prev links). estimate_data_size estimates the size of a geospatial query's result set without downloading the data, using lazy loading through odc.stac and xarray, clipping to the smallest area when both a bounding box and an AOI geometry are given, and falling back to an estimate even when odc.stac fails outright.
How to install
As an MCP server over stdio:
{
"stac": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/wayfinder-foundry/stac-mcp",
"stac-mcp"
],
"transport": "stdio"
}
}
A published container image is also available: docker run --rm -i ghcr.io/wayfinder-foundry/stac-mcp:latest (or the equivalent with Podman). For local development, clone the repository and install with pip install -e ".[dev]".
Who it's for
Developers and AI agents working with geospatial data - remote sensing, Earth observation, or catalog-backed GIS workflows - who need to search, filter, and size-estimate STAC-compliant data (including Microsoft Planetary Computer and AWS Earth Search) without hand-writing STAC API calls.
The project is released under the Apache 2.0 License.
Source README
STAC MCP Server
An MCP (Model Context Protocol) Server that provides access to STAC (SpatioTemporal Asset Catalog) APIs for geospatial data discovery and access. Supports dual output modes (text and structured json) for all tools.
The coverage badge is updated automatically on pushes to
mainby the CI workflow.
Overview
This MCP server enables AI assistants and applications to interact with STAC catalogs to:
- Search and browse STAC collections
- Find geospatial datasets (satellite imagery, weather data, etc.)
- Access metadata and asset information
- Perform spatial and temporal queries
Features
Available Tools
All tools accept an optional output_format parameter ("text" default, or "json"). JSON mode returns a single MCP TextContent whose text field is a compact JSON envelope: { "mode": "json", "data": { ... } } (or { "mode": "text_fallback", "content": ["..."] } if a handler lacks a JSON branch). This preserves backward compatibility while enabling structured consumption (see ADR 0006 and ASR 1003).
get_root: Fetch root document (id/title/description/links/conformance subset)get_conformance: List all conformance classes; optionally verify specific URIsget_capabilities: Get a summary of STAC API capabilities (query, sort, fields, queryables, aggregation, filter)search_collections: List and search available STAC collectionsget_collection: Get detailed information about a specific collectionsearch_items: Search for STAC items with spatial, temporal, and attribute filtersget_item: Get detailed information about a specific STAC itemget_queryables: Get queryable properties for a collectionget_aggregations: Get aggregations for STAC itemsestimate_data_size: Estimate data size for STAC items using lazy loading (XArray + odc.stac)
Search Parameters
The search_items tool supports comprehensive STAC API search parameters:
collections: One or more collection IDs to searchbbox: Bounding box [west, south, east, north] or GeoJSON geometrydatetime: Datetime filter (e.g., "2020-01-01/2020-12-31")limit: Maximum number of items to returnquery: Query filter for propertiesfields: List of fields to include/exclude (e.g., ["id", "properties.datetime"])intersects: GeoJSON geometry for spatial intersection queriesids: List of specific item IDs to retrieve (batch fetch)sortby: Sort order (e.g., ["-properties.datetime"] for descending)sign_assets: If True and catalog is Planetary Computer, sign asset URLs for direct access
Pagination Support
Search responses include pagination metadata with cursor-based navigation links:
{
"type": "item_list",
"count": 10,
"items": [...],
"meta": {
"catalog_url": "https://example.com/stac",
"parameters": {...},
"returned": 10,
"has_more": true,
"links": [
{"rel": "next", "href": "https://example.com/stac/search?token=abc123"},
{"rel": "prev", "href": "https://example.com/stac/search?token=xyz789"}
]
}
}
Planetary Computer Asset Signing
When working with Microsoft Planetary Computer catalogs, you can enable asset signing to get signed URLs for direct asset access:
{
"method": "tools/call",
"params": {
"name": "search_items",
"arguments": {
"collections": ["sentinel-2-l2a"],
"limit": 5,
"sign_assets": true
}
}
}
Capability Discovery & Aggregations
The new capability tools (ADR 0004) allow adaptive client behavior:
- Graceful fallbacks: Missing
/conformance,/queryables, or aggregation support returns structured JSON withsupported:falseinstead of hard errors. get_conformancefalls back to the root document'sconformsToarray when the dedicated endpoint is absent.get_queryablesreturns an empty set with a message if the endpoint is not implemented by the catalog.get_aggregationsconstructs a STAC Search request with anaggregationsobject; if unsupported (HTTP 400/404), it returns a descriptive message while preserving original search parameters.
Data Size Estimation
The estimate_data_size tool provides accurate size estimates for geospatial datasets without downloading the actual data:
- Lazy Loading: Uses odc.stac to load STAC items into xarray datasets without downloading
- AOI Clipping: Automatically clips to the smallest area when both bbox and AOI GeoJSON are provided
- Fallback Estimation: Provides size estimates even when odc.stac fails
- Detailed Metadata: Returns information about data variables, spatial dimensions, and individual assets
- Batch Support: Retains structured metadata for efficient batch processing
Usage
MCP Protocol / Server Configuration
The server implements the Model Context Protocol (MCP) for standardized communication.
{
"stac": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/wayfinder-foundry/stac-mcp",
"stac-mcp"
],
"transport": "stdio",
}
}
Published Image
# With Docker
docker run --rm -i ghcr.io/wayfinder-foundry/stac-mcp:latest
# With Podman
podman run --rm -i ghcr.io/wayfinder-foundry/stac-mcp:latest
Examples
Example: Basic Search
{
"method": "tools/call",
"params": {
"name": "search_items",
"arguments": {
"collections": ["landsat-c2l2-sr"],
"bbox": [-122.5, 37.7, -122.3, 37.8],
"datetime": "2023-01-01/2023-01-31",
"limit": 5,
"output_format": "json"
}
}
}
The server responds with a single TextContent whose text is a JSON string like:
{
"type": "item_list",
"count": 5,
"items": [{"id": "..."}],
"meta": {
"catalog_url": "https://example.com/stac",
"parameters": {...},
"returned": 5,
"has_more": false,
"links": []
}
}
Example: Advanced Search with Sorting and Field Selection
{
"method": "tools/call",
"params": {
"name": "search_items",
"arguments": {
"collections": ["sentinel-2-l2a"],
"intersects": {
"type": "Point",
"coordinates": [-122.4194, 37.7749]
},
"sortby": ["-properties.datetime"],
"fields": ["id", "properties.datetime", "properties.eo:cloud_cover"],
"limit": 10,
"output_format": "json"
}
}
}
Example: Batch Fetch Specific Items
{
"method": "tools/call",
"params": {
"name": "search_items",
"arguments": {
"ids": ["item1", "item2", "item3"],
"output_format": "json"
}
}
}
Development
Local Development
git clone https://github.com/wayfinder-foundry/stac-mcp.git
cd stac-mcp
pip install -e ".[dev]"
For local development with containers, you can use VS Code's Remote Containers extension with the provided .devcontainer configuration.
Testing
pytest -v
Test Coverage
The project uses coverage.py (already a dependency was added) for measuring statement and branch coverage.
Quick run (terminal):
coverage run -m pytest -q
coverage report -m
Example output (illustrative):
Name Stmts Miss Branch BrMiss Cover
---------------------------------------------------------------------
stac_mcp/observability.py 185 4 42 3 96%
stac_mcp/tools/execution.py 68 2 18 1 94%
... (others) ...
---------------------------------------------------------------------
TOTAL 620 20 140 9 96%
Generate an HTML report (optional):
coverage html
open htmlcov/index.html # macOS
Configuration: .coveragerc enforces branch = True and omits tests/* and scripts/version.py. Update omit patterns only when necessary to keep metrics honest.
Recommended workflow before opening a PR:
ruff format stac_mcp/ tests/ruff check stac_mcp/ tests/ --fixcoverage run -m pytest -qcoverage report -m(ensure no unexpected drops)
Linting
ruff format stac_mcp/ tests/
ruff check stac_mcp/ tests/ --fix --no-cache
Version Management
The project uses semantic versioning (SemVer) with automated version management based on PR labels or branch naming, implemented in .github/workflows/container.yml.
Automatic Versioning
When PRs are merged to main, the workflow determines the version increment using either PR labels or branch prefixes:
PR Labels (Recommended for Automated Tools)
Labels take priority over branch prefixes. Add one of these labels to your PR:
- bump:patch or bump:hotfix → patch increment (0.1.0 → 0.1.1) for bug fixes
- bump:minor or bump:feature → minor increment (0.1.0 → 0.2.0) for new features
- bump:major or bump:release → major increment (0.1.0 → 1.0.0) for breaking changes
Branch Prefixes (For Human Contributors)
If no version bump label is present, the workflow falls back to branch prefix detection:
- hotfix/, fix/, copilot/fix-, or copilot/hotfix/ branches → patch increment (0.1.0 → 0.1.1) for bug fixes
- feature/ or copilot/feature/ branches → minor increment (0.1.0 → 0.2.0) for new features
- release/ or copilot/release/ branches → major increment (0.1.0 → 1.0.0) for breaking changes
See CONTRIBUTING.md for detailed guidelines on version bumping.
Manual Version Management
You can also manually manage versions using the version script (should normally not be needed unless doing a coordinated release):
# Show current version
python scripts/version.py current
# Increment version based on change type
python scripts/version.py patch # Bug fixes (0.1.0 -> 0.1.1)
python scripts/version.py minor # New features (0.1.0 -> 0.2.0)
python scripts/version.py major # Breaking changes (0.1.0 -> 1.0.0)
# Set specific version
python scripts/version.py set 1.2.3
The version system maintains consistency across:
pyproject.toml(project version)stac_mcp/__init__.py(version)stac_mcp/server.py(server_version in MCP initialization)
Container Development
To develop with containers:
# Build development image
docker build -f Containerfile -t stac-mcp:dev .
# Test the container
docker run --rm -i stac-mcp:dev
# Using docker-compose for development
docker-compose up --build
# For debugging, use an interactive shell (requires modifying Containerfile)
# docker run --rm -it --entrypoint=/bin/sh stac-mcp:dev
Current Containerfile (single-stage) notes:
- Based on
python:3.12-slimfor broad wheel compatibility (rasterio, shapely, etc.) - Installs GDAL/PROJ system libraries needed by rasterio/odc-stac
- Installs the package with
pip install . - Entrypoint:
python -m stac_mcp.server(stdio MCP transport) - Multi-stage/distroless hardening can be reintroduced later (tracked by potential future ADR)
Documentation
FastMCP Guidelines and Architecture
STAC MCP includes comprehensive documentation for FastMCP patterns and agentic geospatial reasoning:
- FastMCP Documentation: Complete guide to MCP decorators, resources, tools, and prompts for STAC workflows
- DECORATORS.md: Choosing the right decorator for STAC operations
- GUIDELINES.md: FastMCP architecture and usage patterns
- PROMPTS.md: Agentic STAC search reasoning and methodology
- RESOURCES.md: STAC catalog discovery and metadata patterns
- CONTEXT.md: Context usage for logging and progress tracking
These documents provide guidance for:
- AI agents reasoning about STAC catalog searches
- Developers implementing STAC MCP features
- Understanding the planned FastMCP integration (issues #69, #78)
Additional Documentation
- Test Coverage Strategy: Testing approach and coverage goals
STAC Resources
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.