Skip to main content
Glama
GeoCroissant MCP Server

GeoCroissant MCP Server

by HarshShinde0

GeoCroissant MCP Server

Model Context Protocol (MCP) サーバーです。GeoCroissant とその地理空間拡張のためのサーバー。

機能

  • EO データセットの検出 - ライブの Element84 Earth Search API (https://earth-search.aws.element84.com/v1、AWS Open Data) に対する STAC コレクションのキーワード / トピック検索と、シーンの空間検索 (bbox + datetime + 雲量) を行います。センサーのモダリティ分類 (optical / radar / elevation) とテーマのショートカット (flood、wildfire、ndvi、dem、...) を備えています。

  • STAC -> GeoCroissant 生成 - ライブ検索結果を検証済みの GeoCroissant ドキュメントに変換します。schema.org のカバレッジ、CRS、バンド構成、eo:bands から導出されたスペクトルメタデータ (マイクロメートルからナノメートルに変換)、アセット URL を直接参照する distribution の FileObject、シーンごとに 1 行を埋め込む RecordSet などを生成します。

  • 公式バリデータをツールとして提供 - mlcroissant (mlcroissant validate と同じエンジン) によるエラーと警告を含む、構造化された pass/fail レポートを返します。

  • 深い検査 - コアメタデータとすべての 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、アセットキーを返します。

create_geocroissant_from_stac

エンドツーエンドのパイプライン: ライブ STAC 検索 -> 検証済み GeoCroissant JSON-LD (カバレッジ、CRS、バンドとスペクトルメタデータ、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

@id、キー、インラインレコード / サンプル数、ネストされたフィールドのサマリーを持つ RecordSet を一覧表示します。

get_records_preview

RecordSet の先頭 N 件のレコードをマテリアライズします (フィルタリング可)。Python API と同様にダウンロード / 変換を実行します。

extract_distribution_urls

distribution からダウンロード可能な URL を抽出します: contentUrl、フォーマット、md5/sha256、FileSet の include。

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" }

ローダーは、トピック参照がどこかのカタログのコレクションリストに存在するかを検証するため、タイプミスは起動時にすぐに失敗します。

推奨されるエージェントワークフロー

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 が geocr-mcp と mlcroissant 依存機能の両方を GitHub から直接取得します。クローンが必要なのは開発時のみです。

pip

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

唯一の依存である mlcroissant は、GeoCr FROM`フォークから自動的に取得されます:

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-Click 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、またはエージェントの設定 (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

代替のカタログレジストリファイルのパス - コードを変更せずにカタログ / トピックを追加できます。

GEOCR_HOST / GEOCR_PORT

127.0.0.1 / 8000

SSE / streamable-http トランスポートのバインドアドレス (CLI フラグでも設定可能)。

セキュリティに関する考慮事項

  • サーバーは、ツール入力が URL を参照する場合、またはリモートの distribution からレコードをマテリア時の (get_records_preview) 場合のみネットワークリクエストを行います。信頼できないコンテキストでは limit を小さく保ってください。

  • 生成されたファイルは常に GEOCR_OUTPUT_DIR 内に書き込まれます。パストラバーサルは、ファイル名をベスト名に短縮することで防がれます。

  • コンテナは non-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
      -