Skip to main content
Glama
GeoCroissant MCP Server

GeoCroissant MCP Server

by HarshShinde0

GeoCroissant MCP Server

为 GeoCroissant 及其地理空间扩展提供的 Model Context Protocol (MCP) 服务器。

功能

  • EO 数据集发现 - 对 STAC 集合进行关键字/主题搜索,并针对实时 Element84 Earth Search API(https://earth-search.aws.element84.com/v1,AWS Open Data)执行空间场景搜索(bbox + datetime + 云量),支持传感器模态分类(光学 / 雷达 / 高程)和主题快捷方式(flood、wildfire、ndvi、dem 等)。

  • STAC -> GeoCroissant 生成 - 将实时搜索结果转换为经过验证的 GeoCroissant 文档:包含 schema.org coverage、CRS、波段配置及由 eo:bands 推导出的光谱元数据(从微米转换为纳米)、直接资源 URL 的 distribution FileObjects,以及每个场景一行的 RecordSet。

  • 官方验证器作为工具 - 使用 mlcroissant(与 mlcroissant validate 相同的引擎)生成结构化的通过/失败报告,包含错误和警告。

  • 深度检查 - 核心元数据以及每个 GeoCroissant 属性:CRS、空间/时间分辨率、波段配置、光谱波段元数据、记录端点、空间索引/偏置/采样策略。

  • 结构图提取 - 暴露库内部构建的有向多重图(Metadata / FileObject / FileSet / RecordSet / Field 节点;source、join 和 containment 边)。

  • 记录物化 - 执行真实操作图(下载、提取、转换)以预览实际记录,与 Python 中的 Dataset.records(...) 完全一致。

  • 经验证的骨架生成 - 从结构化参数生成符合规范的 GeoCroissant JSON-LD,并通过真实验证器进行验证。

  • 内置规范参考 - 命名空间、所有 geocr: 属性及其域/基数、规范 @context、示例文档和 Python API。

Related MCP server: Copernicus Earth Observation MCP Server

工具

工具

描述

list_eo_catalogs

已注册的 EO STAC 目录(Earth Search),包含模态、精选集合和主题关键字。

search_eo_datasets

对 Earth Search 集合进行主题/关键字搜索 - 'flood' -> Sentinel-1 + Sentinel-2,'dem' -> Copernicus DEM 等。

search_eo_scenes

在 bbox 内进行空间/时间/云端场景搜索;返回每个场景的 id、日期、云计算、 原生 EPSG 和 asset key。

create_geocroissant_from_stac

端到端流水线:实时 STAC 搜索 -> 经验证的 GeoGrid JSON-LD(coverage、CRS、bands 及光谱元数据、distribution URL、内嵌场景记录)。可选择写入磁盘。

validate_croissant

验证 Croissant/GeoCroissant 文档(文件路径、URL 或内嵌 JSON)。返回 valid、errors、warnings、conformance targets。

inspect_geocroissant

文档的结构化摘要:元数据、geocr: 属性、distribution 条目及每个 RecordSet/Field 的类型、形状和来源链。

get_structure_graph

库内部结构图的节点和有向边 - 用于血统和依赖分析。

list_record_sets

列出 RecordSet,包含 @id、键、内嵌记录/示例数量和嵌套字段摘要。

get_records_preview

物化一个 RecordSet 的前 N 条记录,可选过滤。执行与 Python API 相同的下载/转换。

extract_distribution_urls

从 distribution 中提取可下载 URL:contentUrl、文件格式、md5/sha256、FileSet 包含内容。

create_geocroissant_scaffold

根据参数生成经过验证的 GeoCroissant 文档(无需网络)。可选择写入磁盘。

get_geocroissant_spec_reference

规范参考:overview、context、properties、example、python-api 或 all。

添加目录

注册表是数据驱动的实现 (src/geocr_mcp_server/config/catalogs.yaml):每个目录是一个条目,包含其 STAC URL、按模态组织的精选集合以及共享的 topics 和模态关键字提示。要注册另一个目录而无需修改代码:

  1. 复制 YAML 到某处,并在 catalogs 下追加您的目录(同时将主题映射添加到 topics 下)。

  2. 将环境变量指向该文件:

"env": { "GEOCR_CATALOGS_CONFIG": "/path/to/catalogs.yaml" }

加载器会验证引用的主题是否存在于某个目录的集合列表中,因此在启动时就能快速包含偏离错误。

推荐的 agent 工作流

discovery:  list_eo_catalogs -> search_eo_datasets("burn scar", modality=optical)
            -> search_eo_scenes(bbox=[...], datetime_range=...)
metadata:   create_geocroissant_from_stac(...)  # validated output + optional file
consuming:  inspect_geocroissant -> get_records_preview -> extract_distribution_urls
authoring:  create_geocroissant_scaffold -> edit -> validate_croissant

安装

不需要克隆 - pip/uvx 直接从 GitHub 获取 geocr-mcp 及其依赖 mlcroissant。克隆仅用于开发。

pip

pip install git+https://github.com/HarshShinde0/geocr_mcp.git@main

唯一的依赖 mlcroissant 会从 GeoCroiss 分支自动拉取:

pip install git+https://github.com/HarshShinde0/croissant.git@main#subdirectory=python/mlcroissant

uv / uvx (推荐客户端)

uvx --from "geocr-mcp @ git+https://github.com/HarshShinde0/geocr_mcp.git@main" geocr-mcp-server

Docker

docker build -t geocr-mcp-server .
# stdio (local clients):
docker run -i --rm geocr-mcp-server
# hosted (HTTP transports):
docker run -p 8000:8000 geocr-mcp-server --transport streamable-http --host 0.0.0.0 --port 8000

客户端配置

无需克隆 - 客户端通过 uvx 直接从 GitHub 安装(并缓存)两个包。

{
  "mcpServers": {
    "geocr": {
      "command": "uvx",
      "args": [
        "--from", "geocr-mcp @ git+https://github.com/HarshShinde0/geocr_mcp.git@main",
        "geocr-mcp-server"
      ],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}
{
  "mcp": {
    "servers": {
      "geocr": {
        "command": "uvx",
        "args": [
          "--from", "geocr-mcp @ git+https://github.com/HarshShinde0/geocr_mcp.git@main",
          "geocr-mcp-server"
        ],
        "env": {
          "FASTMCP_LOG_LEVEL": "ERROR"
        }
      }
    }
  }
}

仅在迭代服务器代码本身时需要这样做:

git clone https://github.com/HarshShinde0/geocr_mcp.git   # or this monorepo
{
  "mcpServers": {
    "geocr": {
      "command": "uv",
      "args": [
        "--directory", "/path/to/geocr_mcp",
        "run", "geocr-mcp-server"
      ],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

以 HTTP 传输方式运行同一服务器,用于共享/远程的云计算:

geocr-mcp-server --transport streamable-http --host 0.0.0.0 --port $PORT

在 Render 上部署(1-点击 Blueprint)

此仓库包含一个 render.yaml blueprint:

  1. 登录 Render Dashboard。

  2. 单击 New + -> Blueprint 并连接仓库 HarshShinde0/geocr_mcp。

  3. 单击 Apply。Render 将自动构建容器并部署服务器。

实时端点:https://geocr-mcp-server.onrender.com/mcp

将客户端连接到托管 MCP

在 AI 客户端、IDE 或 agent 配置(mcpServers)中:

{
  "mcpServers": {
    "geocr-remote": {
      "url": "https://geocr-mcp-server.onrender.com/mcp"
    }
  }
}

在自定义反向代理后,TLS 在代理处终止,并设置 GEOCR_HOST=0.0.0.0 和 GEOCR_TRANSPORT=streamable-http。

环境变量

变量

默认值

描述

FASTMCP_LOG_LEVEL

WARNING

stderr 日志级别(DEBUG、INFO、WARNING、ERROR)。

GEOCR_OUTPUT_DIR

系统临时目录

生成文件的写入目录(文件名被缩减为基本名称)。

GEOCR_CATALOGS_CONFIG

附带的 YAML

替代目录注册文件的路径 - 无需修改代码即可添加 catalogs/topics。

GEOCR_HOST / GEOCR_PORT

127传递给0.0.1 / 8000

SSE/streamable-http 传输的绑定地址(也可通过命令行标志设置)。

安全注意事项

  • 服务器仅在工具输入引用 URL 或从远程 distribution 物化记录(get_records_preview)时发出健康检查。在不信任的环境中请保持 limit 较小。

  • 生成的文件始终写入 GEOCR_OUTPUT_DIR 内;通过将文件名缩减为 basename 来阻止路径遍历。

  • 以非 root 身份运行容器(提供的 Dockerfile 已这样做)。

开发

cd geocr_mcp
uv venv && uv sync --all-groups     # or: python -m pip install -e ".[dev]"
uv run pytest --cov --cov-branch    # unit tests (no network required)
uv run ruff check src tests         # lint (same rules as awslabs/mcp)
npx @modelcontextprotocol/inspector geocr-mcp-server   # interactive debugging

Available Tools

12 tools
create_geocroissant_from_stacA

Searches live EO data and generates VALIDATED GeoCroissant metadata from it.

    This is the flagship end-to-end pipeline of this server:

    1. Runs a real STAC search (bbox + collections + datetime + cloud cover).
    2. Derives GeoCroissant properties from the results: schema.org spatial/
       temporal coverage, CRS (EPSG:4326), record endpoint, band
       configuration and spectral band metadata from `eo:bands`
       (micrometers converted to nanometers), distribution FileObjects for
       direct asset URLs, and a RecordSet with one inline row per scene.
    3. Validates the document through the official `mlcroissant` library
       before returning it.

    Usage: THE tool for turning discovered EO data into GeoCroissant.
    After generation use `inspect_geocroissant`, `get_records_preview`
    and `extract_distribution_urls` on the output.

    Returns:
    --------
    Dictionary containing:
        - valid/errors/warnings: mlcroissant validation outcome.
        - json_ld: The generated GeoCroissant document.
        - path: Output file path when output_filename was given.
        - search_summary: What was searched and how many scenes matched.
    

Inputs: bbox (required), name (required), limit, license, +7 more. Returns: object

create_geocroissant_scaffoldA

Generates a validated GeoCroissant JSON-LD scaffold from parameters.

    Produces a standards-conformant starting point modeled on the official
    GeoCroissant example: correct @context (including the `geocr` prefix),
    dual conformance (`croissant/1.1` + `geocr`), schema.org spatial/temporal
    coverage, GeoCroissant properties (CRS, resolutions, band configuration,
    spectral bands), distribution entries and a RecordSet wired to them via
    proper cr:source/cr:extract declarations.

    The generated document is then parsed and checked by the real
    ``mlcroissant`` validator, so `valid=True` means the scaffold already
    passes the official library checks.

    Usage: Call FIRST when creating new dataset metadata, then edit the
    returned JSON-LD for domain specifics and re-check with
    `validate_croissant`. Use `inspect_geocroissant` afterwards to review it.

    Returns:
    --------
    ScaffoldResult containing:
        - valid: Whether the scaffold passed mlcroissant validation.
        - json_ld: The generated document.
        - errors/warnings: Library messages when not fully clean.
        - path: Output file path when output_filename was given.
    

Inputs: name (required), bbox, license, version, +21 more. Returns: Result of generating a GeoCroissant JSON-LD scaffold.

extract_distribution_urlsA

Extracts downloadable URLs from a Croissant document's distribution.

    Collects the `contentUrl` of every FileObject together with its encoding
    formats, sizes and checksums, plus FileSet include patterns and archive
    containers. These are the direct access points for the dataset bytes.

    Usage: Use this tool to obtain concrete download links (e.g. GeoTIFF /
    COG / ZIP assets) for ingestion code without parsing the JSON manually.

    Returns:
    --------
    DistributionUrls containing:
        - urls: One entry per distribution item (name, type, contentUrl,
          encodingFormat, md5/sha256, includes/containedIn when present).
        - count: Number of distribution items with at least one URL.
    

Inputs: jsonld_url, jsonld_path, jsonld_content. Returns: Downloadable URLs extracted from a dataset distribution.

get_geocroissant_spec_referenceA

Returns the GeoCroissant specification reference documentation.

    Provides the vocabulary cheat sheet distilled from the official GeoCroissant
    specification: namespace IRIs and prefixes, conformance declarations, every
    `geocr:` property with expected types/domains/cardinality, the canonical
    JSON-LD @context, a full sample document, and Python snippets for the
    ``mlcroissant`` API (load, validate, iterate records).

    Usage: Read this ONCE before authoring or editing GeoCroissant documents so
    property names, types and cardinalities match the specification exactly.
    Then use `create_geocroissant_scaffold` and `validate_croissant`.

    Returns:
    --------
    Markdown-formatted reference documentation for the requested topic.
    

Inputs: topic. Returns: result

get_records_previewA

Materializes the first records of a RecordSet by executing the data pipeline.

    This tool runs the real ``mlcroissant`` operation graph: it downloads (or
    resolves locally) the declared FileObjects/FileSets, applies extracts and
    transforms, and yields actual records - exactly what
    ``Dataset.records(record_set)`` yields in Python.

    Usage: Use it to preview/sample a dataset's actual data before writing
    training code, or to sanity-check that a generated Croissant description
    produces the expected columns and values.

    IMPORTANT: For remote distributions this may download data; keep `limit`
    small on large datasets. Datasets with inline `cr:data` return those rows
    directly without downloads.

    Returns:
    --------
    RecordsPreview containing:
        - record_set: The RecordSet @id that was read.
        - columns: Column names found across returned records.
        - rows: List of records keyed by fully-qualified field ids.
        - truncated: True if more records exist beyond `limit`.
    

Inputs: record_set (required), limit, filters, jsonld_url, +2 more. Returns: First records materialized from a RecordSet.

get_structure_graphA

Extracts the internal structure graph of a Croissant document.

    Builds the directed multigraph that ``mlcroissant`` uses internally for
    static analysis: nodes are Metadata / FileObject / FileSet / RecordSet /
    Field objects and edges connect fields to their data sources, record sets
    to their fields, files to archives they are contained in, and referenced
    (foreign-key) fields.

    Usage: Use this tool to reason about dataset lineage and dependencies,
    e.g. "which files feed this field?", "what does this join look like?",
    or to explain a dataset's architecture before writing loading code.

    Returns:
    --------
    StructureGraph containing:
        - nodes: Every node with @id, type, name and parent @id.
        - edges: Directed edges as {source, target} @id pairs.
    

Inputs: jsonld_url, jsonld_path, jsonld_content. Returns: Nodes and edges of the Croissant structure graph.

inspect_geocroissantA

Inspects a Croissant/GeoCroissant document and returns a structured summary.

    Parses the document through the ``mlcroissant`` library (which also acts as
    a strict syntax/schema check - invalid documents are rejected) and returns
    a structured digest: core metadata, GeoCroissant extension properties
    (CRS, resolutions, band configuration, spectral bands, record endpoint...),
    distribution entries (FileObjects/FileSets with URLs, formats, hashes),
    and every RecordSet with its Fields (data types, array shapes,
    source/extract/transform chains).

    Usage: Use this tool to READ and UNDERSTAND a dataset description before
    consuming it, comparing datasets, or planning how to load records.

    Returns:
    --------
    Dictionary containing:
        - name/description/license/version/conformsTo and other core metadata.
        - geospatial: All declared `geocr:` extension properties.
        - distribution: FileObject/FileSet entries.
        - record_sets: RecordSets with nested fields and geo properties.
    

Inputs: jsonld_url, jsonld_path, jsonld_content. Returns: object

list_eo_catalogsA

Lists the Earth observation STAC catalogs registered on this server.

    The registry is data-driven (config/catalogs.yaml): today it contains
    Element84 Earth Search over AWS Open Data
    (https://earth-search.aws.element84.com/v1) with its searchable
    modalities, curated collections and topic keywords.

    Usage: Call once to see where EO data can be discovered from before
    using `search_eo_datasets` / `search_eo_scenes`.

    Returns:
    --------
    Dictionary containing:
        - catalogs: Registered catalogs with id, name, URL, description,
          modalities, common collections and supported topics.
    

Inputs: no named parameters. Returns: object

list_record_setsA

Lists the RecordSets of a Croissant/GeoCroissant document.

    A RecordSet is a collection of records (rows/examples) produced by
    applying the declared extraction pipeline to the distribution. This tool
    returns each RecordSet's @id, name, description, key fields, enumeration
    flag, number of inline records/examples and its Fields with their data
    types and source chains.

    Usage: Call this tool to discover what data a dataset exposes and which
    RecordSet names to pass to `get_records_preview`.

    Returns:
    --------
    List of dictionaries, one per RecordSet, each including:
        - @id: The RecordSet identifier used by other tools.
        - fields: Nested field summaries (dataType, isArray/arrayShape,
          source extract/transform chain, geo band properties).
    

Inputs: jsonld_url, jsonld_path, jsonld_content. Returns: result

search_eo_datasetsA

Searches Earth observation DATASETS (STAC collections) by keyword.

    Performs collection-level search on the Earth Search STAC API
    (AWS Open Data). Queries hit the topics map first ('flood' -> Sentinel-1
    + Sentinel-2, 'dem' -> Copernicus DEM...), then fall back to keyword
    matching against live collection metadata; every hit is classified by
    sensor modality (optical / radar / elevation).

    Usage: Start here for dataset-level discovery ("find me flood/burn
    scar/terrain datasets"). Then use the returned collection ids with
    `search_eo_scenes`, or jump straight to `create_geocroissant_from_stac`
    to get GeoCroissant metadata.

    Returns:
    --------
    Dictionary containing:
        - matched_topics: Topic-map hits for the query.
        - count: Number of matching collections found.
        - collections: Matches with catalog, collection id, title,
          description snippet, modality, license and temporal extent.
    

Inputs: query, modality. Returns: object

search_eo_scenesA

Searches satellite SCENES inside a bounding box on Earth Search.

    Executes a real STAC item search (pystac-client) against
    https://earth-search.aws.element84.com/v1 filtered by spatial extent,
    time range and cloud cover. Scenes are the individual acquisitions
    (tiles/granules) that become records of a GeoCroissant dataset.

    Usage: Use after `search_eo_datasets` (or directly with known
    collections) to check actual data availability for an area of interest.
    Feed promising results into `create_geocroissant_from_stac`.

    Returns:
    --------
    Dictionary containing:
        - scene_count and scenes: Per-scene id, collection, acquisition
          datetime, platform, cloud cover, native EPSG and asset keys.
    

Inputs: bbox (required), limit, modality, collections, +2 more. Returns: object

validate_croissantA

Validates a Croissant or GeoCroissant JSON-LD document.

    Runs the official MLCommons ``mlcroissant`` validator: JSON syntax check,
    JSON-LD expansion, structure-graph construction (FileObjects/FileSets,
    RecordSets, Fields, sources & joins) and full schema conformance checks.

    Usage: Call this tool whenever a dataset description is created or edited,
    BEFORE publishing it, and after any modification of an existing file.
    Works for both plain Croissant documents and documents using the
    GeoCroissant extension (`geocr:` properties).

    Returns:
    --------
    Dictionary containing:
        - valid: True when the document passes validation.
        - errors: Blocking errors reported by the library (empty when valid).
        - warnings: Non-blocking recommendations (e.g. missing license).
        - is_geospatial: Whether GeoCroissant conformance is declared.
        - conforms_to / dataset_name: Extracted metadata when loadable.
    

Inputs: jsonld_url, jsonld_path, jsonld_content. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 12 tools

    Disambiguation4/5

    The main workflow stages are clearly separated: discovery tools distinguish catalogs, datasets, and scenes, while generation tools differ by their input source. There is some overlap among the inspection tools—inspect_geocroissant already reports RecordSets and distribution entries, making list_record_sets and extract_distribution_urls partially redundant—but the descriptions are detailed enough to guide selection.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern: list, search, create, validate, inspect, get, and extract are used predictably. The naming also preserves resource hierarchy clearly, from catalogs to datasets to scenes, which helps agents infer relationships between tools.

    Tool Count5/5

    Twelve tools is an appropriate size for this domain: a few discovery tools, two generation paths, one validator, and several inspection/preview/extraction utilities. The count supports the full workflow without bloating the surface or feeling thin.

    Completeness5/5

    The toolset covers the full lifecycle: EO catalog/dataset/scene discovery, GeoCroissant creation from live STAC data or manual parameters, validation, structured inspection, record-set preview, and distribution URL extraction. There are no obvious dead ends because outputs from generation flow naturally into the validation and inspection tools.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to search and access geospatial datasets through STAC (SpatioTemporal Asset Catalog) APIs. Supports querying satellite imagery, weather data, and other geospatial assets with spatial, temporal, and attribute filters.
      11
      20
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Provides tools to search, download, and manage satellite imagery from all Copernicus Sentinel missions via the Copernicus Data Space ecosystem. It enables advanced geospatial queries, temporal coverage analysis, and automated data management for Earth observation tasks.
      13
      11
      LGPL 3.0
    • F
      license
      A
      quality
      D
      maintenance
      Provides access to the OpenLandMap STAC catalog, offering over 100 global environmental datasets including soil, climate, and vegetation data. It enables AI agents to discover, search, and retrieve Cloud-Optimized GeoTIFFs for global geospatial analysis.
      27
      -