GDAL MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add gdal-mcp -- uvx gdal-mcp
README.md

Geospatial AI with epistemic reasoning

GDAL MCP

Geospatial AI with epistemic reasoning

GDAL MCP is a Model Context Protocol (MCP) server that provides AI agents with geospatial analysis capabilities while requiring them to justify their methodological choices through a reflection middleware system.

🎉 v1.1.1 Released (2025-10-26) — Vector tool parity + cross-domain reflection validated
🧠 Reflection System — Domain-based epistemic reasoning that transcends data types
⚡ 75% Cache Hit Rate — Methodology reasoning carries across raster ↔ vector operations


📚 Documentation


🧠 The Reflection System

What Makes GDAL MCP Different?

Most AI tool systems execute operations immediately when requested. GDAL MCP requires the AI to justify methodological decisions before execution, creating a conversation about the "why" rather than just executing the "what."

Traditional AI tool approach:

User: "Reproject this DEM to Web Mercator"
AI: *silently executes operation*
Result: DEM reprojected (but with what resampling? why that CRS? what tradeoffs?)

GDAL MCP with reflection:

User: "Reproject this DEM to Web Mercator for my web map"
AI: *reflection middleware intercepts*
AI: "Before reprojecting to EPSG:3857, let me justify this CRS choice:
     
     Intent: Web Mercator preserves angles (conformal projection),
             essential for web tile rendering and navigation
     
     Alternatives considered:
     - EPSG:4326 (WGS84) → rejected: not conformal, distorts shapes
     - Local UTM → rejected: limited extent, not web-standard
     
     Tradeoffs: Area distortion increases at high latitudes
                (acceptable for web visualization)
     
     Confidence: High - this is the standard for web mapping"

*justification stored, operation proceeds*
Result: DEM reprojected with documented methodology

Why This Matters

1. Utilizes Full MCP Protocol Capabilities

The Model Context Protocol isn't just about tool execution—it's about agentic reasoning and interaction. The reflection system leverages MCP's design to enable:

  • Pre-execution prompting (tool dependencies)
  • Structured reasoning (schema-validated justifications)
  • Stateful workflows (justification caching)
  • Human-in-the-loop interaction (advisory prompts)

2. Prevents Silent Failures

Geospatial operations can execute successfully while producing methodologically incorrect results:

  • Nearest-neighbor resampling on continuous elevation data (creates artifacts)
  • Web Mercator for area calculations (40%+ distortion possible)
  • Bilinear interpolation on categorical data (creates invalid class values)

The reflection system surfaces these choices for validation.

3. Educational, Not Restrictive

The AI isn't blocked from executing operations—it's required to demonstrate understanding:

  • First use: Explains reasoning, teaches methodology
  • Cached: Instant execution (knowledge persists)
  • Result: 75%+ cache hit rates, minimal friction

4. Creates Audit Trail

Every methodological decision is documented with:

  • Intent (what property must be preserved?)
  • Alternatives (what else was considered?)
  • Rationale (why this choice?)
  • Tradeoffs (what are the limitations?)
  • Confidence (high/medium/low)

This enables reproducible geospatial science.

🎯 Example Workflow

Multi-Operation Geospatial Analysis

User: "I need to reproject this DEM to UTM for accurate slope analysis,
       then reproject this vector layer to the same CRS for overlay"

AI Workflow:
1. Inspects DEM metadata (raster_info)
2. REFLECTION: Justifies UTM Zone 10N choice (accurate distance/area)
3. REFLECTION: Justifies cubic resampling (smooth gradients for derivatives)
4. Reprojects DEM (raster_reproject)
5. Inspects vector metadata (vector_info)
6. CACHE HIT: Reuses UTM justification (cross-domain!)
7. Reprojects vector (vector_reproject) - instant, no re-prompting
8. Both

Tools (4)

raster_infoInspects metadata of a raster file.
raster_reprojectReprojects a raster file to a target coordinate system.
vector_infoInspects metadata of a vector file.
vector_reprojectReprojects a vector file to a target coordinate system.

Environment Variables

GDAL_DATAPath to GDAL data files for coordinate system definitions.

Configuration

claude_desktop_config.json
{"mcpServers": {"gdal-mcp": {"command": "uvx", "args": ["gdal-mcp"]}}}

Try it

Reproject this DEM to Web Mercator for my web map and explain your choice of CRS.
Analyze the metadata of this raster file and suggest the best resampling method for slope analysis.
Reproject this vector layer to match the coordinate system of my DEM for an accurate overlay.
Why should I use cubic resampling instead of nearest-neighbor for this elevation dataset?

Frequently Asked Questions

What are the key features of GDAL MCP?

Reflection middleware that requires AI to justify methodological choices. Geospatial analysis capabilities for both raster and vector data. Stateful workflows with justification caching for cross-domain operations. Prevents silent failures by surfacing methodological tradeoffs. Creates an audit trail of intent, alternatives, and rationale for every operation.

What can I use GDAL MCP for?

Ensuring accurate coordinate system transformations for web mapping applications. Performing reproducible geospatial science with documented methodological decisions. Automating complex multi-step geospatial analysis workflows with AI reasoning. Validating resampling methods for continuous vs categorical data.

How do I install GDAL MCP?

Install GDAL MCP by running: uvx gdal-mcp

What MCP clients work with GDAL MCP?

GDAL MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep GDAL MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare