by Wayfinder-Foundry
Packages GDAL‑style geospatial workflows with Python‑native libraries (Rasterio, GeoPandas, PyProj, etc.) and adds AI‑agent‑driven catalog discovery, metadata intelligence, and raster/vector processing backed by epistemic reasoning.
Gdal Mcp provides a Model Context Protocol (MCP) server that lets AI agents execute geospatial operations while justifying methodological choices such as CRS selection and resampling methods. The server wraps rasterio, pyproj, pyogrio, shapely and related libraries, exposing tools for raster info, conversion, reprojection, statistics, and vector inspection, all governed by a reflection middleware that caches justifications for repeatable, scientifically‑rigorous workflows.
uvx (or Docker/local dev) and run the server with the stdio transport.
uvx --from gdal-mcp gdal --transport stdio
raster_info, raster_reproject) with the required parameters in JSON. The reflection layer automatically prompts for justification when needed, stores it, and proceeds with execution.uvx run.Q: Do I need to supply justification manually?
A: No. The reflection middleware automatically generates a structured justification the first time a methodological parameter (e.g., CRS, resampling) is used. You can view or store it via store_justification.
Q: Can I disable the reflection system? A: The server is designed around reflection; disabling it would require custom middleware modifications.
Q: Which resampling methods are supported?
A: nearest, bilinear, cubic, lanczos – each triggers a justification appropriate to the data type.
Q: How does caching work across sessions?
A: Justifications are written to .preflight/justifications/{domain}/sha256:{hash}.json. They persist on disk and are reused by any subsequent request on the same server instance.
Q: What Python version is required? A: Python 3.11 or newer.
Q: Is the server compatible with Claude Desktop?
A: Yes. Add a configuration entry pointing to the uvx command as shown in the README.
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
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
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:
2. Prevents Silent Failures
Geospatial operations can execute successfully while producing methodologically incorrect results:
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:
4. Creates Audit Trail
Every methodological decision is documented with:
This enables reproducible geospatial science.
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 datasets now aligned in UTM Zone 10N
Result: 2 operations, 2 reflections (not 3!)
Cache hit rate: 50% → Saves time, maintains methodology
The Key Innovation: The CRS justification from step 2 is reused in step 6 because the methodology (why UTM Zone 10N?) is domain-based, not tool-based. It doesn't matter if you're working with raster or vector data—the projection choice reasoning is the same.
See Tools Reference for detailed examples of all available tools.
# Run directly from PyPI
uvx --from gdal-mcp gdal --transport stdio
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"gdal-mcp": {
"command": "uvx",
"args": ["--from", "gdal-mcp", "gdal", "--transport", "stdio"],
"env": {
"GDAL_MCP_WORKSPACES": "/path/to/your/geospatial/data"
}
}
}
}
See QUICKSTART.md for:
GDAL MCP provides 12 production-ready tools across three categories:
raster_info - Inspect metadata (CRS, resolution, bands, nodata)raster_convert - Format conversion with compression & overviews (COG support)raster_reproject ⚡ - CRS transformation (with reflection)raster_stats - Statistical analysis with histogramsvector_info - Inspect metadata (CRS, geometry, attributes)vector_reproject ⚡ - CRS transformation (with reflection)vector_convert - Format migration (SHP ↔ GPKG ↔ GeoJSON)vector_clip - Spatial subsettingvector_buffer - Proximity analysisvector_simplify - Geometry simplificationstore_justification - Cache epistemic reasoning (used internally)⚡ = Reflection-enabled: These tools require methodological justification on first use, then cache for instant subsequent execution.
See TOOLS.md for complete documentation with examples and parameters.
# Run all tests
uv run pytest test/ -v
# With coverage
uv run pytest test/ --cov=src --cov-report=term-missing
Status: ✅ 72 passing tests including reflection system integration
Python-Native Stack (ADR-0017):
Key Design Decisions (26 ADRs guide development):
We welcome contributions! See CONTRIBUTING.md for:
MIT License - see LICENSE for details.
Current Status: v1.1.1 - Phase 2 Complete ✅
Next: Phase 3 - Workflow Intelligence (v2.0+)
See Vision for the complete long-term roadmap.
Built with ❤️ for the geospatial AI community
Geospatial operations that think, not just execute.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
{
"mcpServers": {
"gdal-mcp": {
"command": "uvx",
"args": [
"--from",
"gdal-mcp",
"gdal",
"--transport",
"stdio"
],
"env": {}
}
}
}claude mcp add gdal-mcp uvx --from gdal-mcp gdal --transport stdio