MCP Connector

Analyze Geospatial Data with GDAL

An MCP server exposing GDAL/Rasterio raster and vector operations, with reflection middleware requiring structured justification before methodology-sensitive

Works with gdalrasteriopyprojpyogrio

96
Spark score
out of 100
Status Verified
Updated 2 months ago
Version 1.1.3
Models
universal

Add to Favorites

Why it matters

Empower AI agents with advanced geospatial analysis capabilities. This MCP server leverages GDAL and Rasterio to provide a suite of tools for raster and vector data manipulation, including format conversion, reprojection, and statistical analysis.

Outcomes

What it gets done

01

Perform metadata analysis on raster and vector datasets.

02

Convert geospatial data formats, including support for Cloud Optimized GeoTIFFs (COGs).

03

Reproject raster and vector data between different Coordinate Reference Systems (CRS).

04

Conduct spatial subsetting and proximity analysis on vector data.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-gdal | bash

Capabilities

Tools your agent gets

raster_info

Check raster metadata including CRS, resolution, bands, and nodata values

raster_convert

Convert raster formats with compression and overviews including COG support

raster_reproject

Transform raster CRS with reflection-based justification

raster_stats

Perform statistical analysis on raster data with histograms

vector_info

Check vector metadata including CRS, geometry types, and attributes

vector_reproject

Transform vector CRS with reflection-based justification

vector_convert

Migrate vector formats between SHP, GPKG, and GeoJSON

vector_clip

Perform spatial subsetting on vector data

+3 tools

Overview

GDAL MCP Server

Exposes GDAL/Rasterio raster and vector operations as MCP tools, gated by reflection middleware that requires a structured, cached justification before any methodology-sensitive call executes. Use when an AI agent needs raster or vector GDAL operations and the methodology behind a choice - CRS, resampling, extent - needs to be captured and auditable rather than silently picked.

What it does

Exposes GDAL and Rasterio geospatial operations to AI agents as raster and vector MCP tools - info, convert, reproject, stats, and query for rasters; info, convert, reproject, clip, buffer, simplify, and query for vectors - plus resources for browsing a workspace catalog, metadata, reference material, and cached query results. Its defining feature is a reflection middleware: tools whose methodology genuinely matters, like choosing a CRS, a resampling method, or a query extent, refuse to execute until the calling agent produces a structured justification first. When an agent calls a tool like a raster reprojection with a target CRS and resampling method, the middleware checks a preflight cache for a matching justification hash; on a miss, it raises a tool error pointing at the relevant justification prompt, the agent fills out a structured schema covering intent, alternatives considered, the actual choice, tradeoffs, and confidence, then re-invokes the tool with that justification attached. Justifications are cached by domain, so a CRS rationale already given for one target projection satisfies both raster and vector reprojection calls afterward, rather than being re-demanded every time.

When to use - and when NOT to

Use it when an AI agent needs to perform raster or vector GDAL/Rasterio operations and the methodology behind a choice - why this CRS, why this resampling method, why this extent - needs to be captured and auditable rather than silently picked by the agent. Installation is via uvx --from gdal-mcp gdal --transport stdio (recommended), a Docker build-and-run, or a local uv sync clone for development; the server is scoped to a colon-separated list of allowed workspace directories via an environment variable, and if that variable is unset, all paths are allowed with a warning logged, which is worth tightening before pointing the server at anything sensitive.

Capabilities

Raster operations (info, convert, reproject, stats, query) and vector operations (info, convert, reproject, clip, buffer, simplify, query), workspace, metadata, reference, and query-result resources, and the reflection prompts - justify_crs_selection, justify_resampling_method, justify_query_extent, and more - that gate methodology-sensitive tool calls.

How to install

Run uvx --from gdal-mcp gdal --transport stdio, or build and run the Docker image, then add the server to Claude Desktop's config with a GDAL_MCP_WORKSPACES environment variable scoping which directories it can touch, and optional RASTER=true/VECTOR=true flags to control which tool surface is exposed.

Who it's for

Geospatial engineers and AI agent builders who want raster and vector GDAL operations available to an agent while forcing an auditable justification for any choice - CRS, resampling, extent - that actually affects correctness, rather than letting the agent pick silently. The project is MIT-licensed.

Source README

gdal-mcp

MCP server exposing GDAL/Rasterio operations to AI agents, with a reflection
middleware that requires structured justification before executing operations
whose methodology matters (CRS choice, resampling method, query extent).

CI
License: MIT
Python 3.11+
FastMCP 2.0
PyPI Downloads

Install

Via uvx (recommended)

uvx --from gdal-mcp gdal --transport stdio

Via Docker

docker build -t gdal-mcp .
docker run -i gdal-mcp gdal --transport stdio

Local development

git clone https://github.com/Wayfinder-Foundry/gdal-mcp.git
cd gdal-mcp
uv sync
uv run gdal --transport stdio

Configure your MCP client

Claude Desktop

Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/,
Windows: %APPDATA%\Claude\, Linux: ~/.config/Claude/):

{
  "mcpServers": {
    "gdal-mcp": {
      "command": "uvx",
      "args": ["--from", "gdal-mcp", "gdal", "--transport", "stdio"],
      "env": {
        "GDAL_MCP_WORKSPACES": "/path/to/your/geospatial/data"
      }
    }
  }
}

Restart Claude Desktop. The MCP server indicator should appear, and the
raster_* and vector_* tools become available.

Workspace scoping

GDAL_MCP_WORKSPACES is a colon-separated list of directories the server
is allowed to touch. If unset, all paths are allowed and a warning is logged.

Optional tool-surface flags: RASTER=true, VECTOR=true. See
docs/ENVIRONMENT_VARIABLES.md for the full set.

Tools

  • Raster: raster_info, raster_convert, raster_reproject, raster_stats, raster_query
  • Vector: vector_info, vector_convert, vector_reproject, vector_clip, vector_buffer, vector_simplify, vector_query
  • Resources: catalog (workspace://...), metadata (metadata://...), reference (reference://...), query results (query://result/{id})
  • Prompts: justify_crs_selection, justify_resampling_method, justify_query_extent (and more under src/prompts/)

See TOOLS.md for parameters, return shapes, and worked examples.

The reflection middleware

Tools whose methodology matters refuse to execute until the calling agent
produces a structured justification. The flow is:

  1. Agent calls e.g. raster_reproject(dst_crs="EPSG:3857", resampling="cubic", ...).
  2. Middleware checks .preflight/justifications/{domain}/ for a matching hash.
  3. On miss, the call raises ToolError with a hint pointing at the
    relevant prompt (e.g. justify_crs_selection).
  4. Agent calls the prompt, fills out the Justification schema (intent,
    alternatives considered, choice, tradeoffs, confidence), and re-invokes
    the tool with a __reflection payload.
  5. The justification is cached domain-keyed, so a CRS rationale for
    EPSG:3857 satisfies both raster_reproject and vector_reproject
    on subsequent calls.

See docs/REFLECTION.md for the schema and cache layout,
and docs/PHILOSOPHY.md for why this exists.

Documentation

Troubleshooting

Access denied: path outside allowed workspaces - set GDAL_MCP_WORKSPACES
to include the directory in question (see "Workspace scoping").

MCP client doesn't see the server - verify uvx --from gdal-mcp gdal --help
runs on its own, then restart the client after editing its config file.

FAQ

Common questions

Trust

How it checks out

Official By maintainer
Downloads 1

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.