Summary
mcp-data-server added lazy re-fetch of the STAC catalog when get_dataset gets a cache miss in ae55ab6. This fixes stale registries when new datasets are added to STAC after pod startup.
Changes needed
In stac.py, _stac_get (or get_dataset) should:
- Try exact match in
STAC_DATASETS
- Try fuzzy match
- On miss: re-fetch the full catalog once and retry
- Return "not found" only after the retry also fails
# ae55ab6 pattern from mcp-data-server stac.py
def get_dataset(dataset_id, ...):
result = _lookup(dataset_id, STAC_DATASETS)
if result:
return result
# Cache miss — re-fetch catalog and retry once
fresh = fetch_stac_catalog(...)
STAC_DATASETS.update(fresh)
return _lookup(dataset_id, STAC_DATASETS) or f"Dataset '{dataset_id}' not found."
This avoids background threads or periodic refresh while still handling the common case of a newly added dataset.
Reference
mcp-data-server stac.py ae55ab6
Summary
mcp-data-server added lazy re-fetch of the STAC catalog when
get_datasetgets a cache miss in ae55ab6. This fixes stale registries when new datasets are added to STAC after pod startup.Changes needed
In
stac.py,_stac_get(orget_dataset) should:STAC_DATASETSThis avoids background threads or periodic refresh while still handling the common case of a newly added dataset.
Reference
mcp-data-server stac.py ae55ab6