3DCityDB MCP Server
An MCP server that gives AI assistants natural-language, read-only access to semantic 3D city models stored in a 3DCityDB v5 PostGIS database, dynamically resolving CityGML classes and properties so no manual prompt engineering is needed.
3DCityDB MCP Server exposes a 3DCityDB v5 geodatabase of semantic 3D city models, built to the OGC CityGML standard, to any MCP-compatible AI assistant such as Claude Code or Claude Desktop. It walks the CityGML class hierarchy at query time to discover which object classes, properties and codelists actually exist in the connected database, including country-aware codelist resolution keyed off the database's EPSG code, so the model can answer spatial and semantic questions and write correct SQL without hand-written schema documentation.
Query execution is read-only at two levels: the run_query tool enforces SELECT-only statements, and every pooled database connection also runs inside a read-only transaction, so even a write hidden in a crafted common table expression is rejected by PostgreSQL itself. An included Chat Assistant, built with LangChain's ReAct pattern, adds a GUI for interactive queries against OpenAI, Anthropic or local Ollama models, including multi-step SQL workflows with rendered diagrams and PDF export.
The server was evaluated against 100 queries across four complexity levels for an accompanying research paper.