swiss-geodata-mcp

swiss-geodata-mcp

MCP server that connects AI models to Swiss federal geodata, offering tools for spatial queries like layer discovery, coordinate identification, building zones, and terrain heights.

Category
Visit Server

README

<!-- mcp-name: io.github.malkreide/swiss-geodata-mcp -->

πŸ‡¨πŸ‡­ Part of the Swiss Public Data MCP Portfolio

πŸ—ΊοΈ swiss-geodata-mcp

CI PyPI Python License: MIT swiss-public-data-mcp

MCP server for Swiss federal geodata (geo.admin.ch).

Connects AI models to the federal geodata infrastructure: ~700 layers discoverable by keyword, spatial identify at any point, building zones (ARE), municipality lookup (swissBOUNDARIES3D), terrain heights and elevation profiles (swissALTI3D), and WGS84↔LV95 coordinate conversion. Part of the swiss-public-data-mcp portfolio. Private project, independent of any employer or institutional affiliation.

πŸ‡©πŸ‡ͺ Deutsche Version


Demo query (anchor example)

In which building zone is the school building at Seilergraben 76 in Zurich,
and how high above sea level is it?

β†’ geo_zoning_at(2683531, 1247914) + geo_height(2683531, 1247914) returns the harmonised ARE zone and 411 m a.s.l. β€” verified live 2026-07-24.

Combined with swiss-housing-mcp:

What applies at this address?

β†’ address_to_egid("Seilergraben 76 ZΓΌrich") (housing) delivers the LV95 coordinates β†’ geo_zoning_at + geo_municipality_at (geodata) deliver zone and municipality. If the GWR is the address book, geo.admin.ch is the atlas.


Tools (9)

Tool Description Data source
geo_search_layers Keyword search over the ~700-layer federal catalogue geo.admin.ch SearchServer
geo_identify What is at this LV95 point? (any layer) geo.admin.ch MapServer identify
geo_find Find features on a layer by attribute value geo.admin.ch MapServer find
geo_municipality_at Municipality + canton containing a point swissBOUNDARIES3D
geo_zoning_at Building zone(s) at a point ch.are.bauzonen (ARE)
geo_height Terrain height at a point swissALTI3D height service
geo_elevation_profile Elevation profile along a line geo.admin.ch profile service
geo_layer_info Queryable fields + legend (plain text) for a layer geo.admin.ch MapServer
geo_convert_coordinates WGS84 ↔ LV95 conversion geodesy.geo.admin.ch reframe

geo_search_layers is the discovery entry point that scales the whole catalogue without one tool per layer; geo_layer_info then reveals a layer's queryable fields for geo_find.

Tool annotations (MCP hints)

All tools are read-only (readOnlyHint: βœ…, destructiveHint: βœ—) and query live upstream services (openWorldHint: βœ…). None are idempotent in the strict caching sense, as upstream data may change between calls.

Architecture decision

This server uses Architecture A (Live-API-only) β€” a deliberate deviation from the portfolio's dump-first default, documented per portfolio convention:

  • The federal geodata infrastructure spans ~700 layers and terabytes; dump-caching is neither feasible nor useful.
  • api3.geo.admin.ch is built exactly for point/feature queries and answered every probe reliably without authentication (live probe 2026-07-24: SearchServer, identify, find, height, profile, legend, layer metadata, reframe β€” all HTTP 200, No-Auth).
  • Consequence: no local cache, no TTL logic; every response carries provenance: live_api.

Live probe findings (2026-07-24)

Endpoint HTTP Status Note
SearchServer type=layers 200 βœ… works catalogue full-text searchable
MapServer identify (bauzonen, boundaries) 200 βœ… works tolerance 0 works for polygon layers
height service 200 βœ… works value arrives as JSON string
profile.json (GET + geom) 200 βœ… works COMB/DTM2/DTM25 altitudes
MapServer {layer}/legend 200 ⚠️ HTML stripped to plain text in geo_layer_info
reframe wgs84↔lv95 200 βœ… works coordinates arrive as JSON strings
Miss on identify/find 200 ⚠️ soft empty results array β€” not an HTTP error

Quick start

Claude Desktop

{
  "mcpServers": {
    "swiss-geodata": {
      "command": "uvx",
      "args": ["swiss-geodata-mcp"]
    }
  }
}

Cloud / Render.com (Streamable HTTP)

SWISS_GEODATA_TRANSPORT=streamable-http PORT=8000 swiss-geodata-mcp

Configuration

Variable Default Purpose
SWISS_GEODATA_TRANSPORT stdio stdio | streamable-http | sse
HOST / PORT 127.0.0.1 / 8000 HTTP binding (cloud transports only). Defaults to loopback; set HOST=0.0.0.0 explicitly to expose all interfaces in a cloud deployment.

No API keys β€” Phase 1 is authentication-free.

Example queries

School planning

  • Β«Which building zone applies at our planned school extension site?Β» β†’ geo_zoning_at
  • Β«Which municipality and canton is this coordinate in?Β» β†’ geo_municipality_at (bridges to BFS numbers used by swiss-statistics-mcp and swiss-housing-mcp)
  • Β«How steep is the school route between these two points?Β» β†’ geo_elevation_profile

Layer discovery

  • Β«Is there federal data on noise exposure?Β» β†’ geo_search_layers("lΓ€rm") β†’ geo_layer_info β†’ geo_identify

See EXAMPLES.md for use cases grouped by audience (schools, parents, general public, developers) and a tool-selection reference table.

Testing

PYTHONPATH=src pytest tests/ -m "not live"   # CI-safe (respx-mocked)
PYTHONPATH=src pytest tests/ -m live         # against real upstream

Project structure

swiss-geodata-mcp/
β”œβ”€β”€ src/swiss_geodata_mcp/
β”‚   β”œβ”€β”€ server.py      # FastMCP tools (9, prefix geo_*)
β”‚   β”œβ”€β”€ geoadmin.py    # geo.admin.ch client + retry + normalisation
β”‚   β”œβ”€β”€ models.py      # Pydantic v2 envelopes (source + provenance)
β”‚   └── __main__.py    # Dual-transport entry point
β”œβ”€β”€ tests/             # respx-mocked + @pytest.mark.live
└── .github/workflows/ # CI + OIDC PyPI publish

Known limitations

  • Registers live elsewhere: building/dwelling entities (EGID/EWID) belong to swiss-housing-mcp; this server is the spatial layer (zones, boundaries, heights). Deliberate separation to avoid twin servers.
  • The harmonised zoning layer (ch.are.bauzonen) is an ARE synthesis; legally binding is only the cantonal/communal Nutzungsplanung (noted in every geo_zoning_at response).
  • School-district polygons are municipal data (β†’ zurich-opendata-mcp), not federal; this server provides municipality boundaries, not Schulkreise.
  • geo_identify result counts are capped upstream; area-wide aggregations are out of scope here (see buildings_in_bbox in swiss-housing-mcp for the register case).
  • Coordinates must be LV95; WGS84 input fails fast with a pointer to geo_convert_coordinates.

Changelog

See CHANGELOG.md

Contributing

Contributions are welcome β€” see CONTRIBUTING.md for how to report bugs, suggest a new layer, or submit code.

Security

This is a read-only, no-PII, public-open-data server. See SECURITY.md for the security posture and how to report a vulnerability.

License

MIT License β€” see LICENSE. Data: Swiss federal geodata infrastructure (geo.admin.ch / swisstopo and publishing federal offices), open government data with attribution.

Credits & related projects

Author

malkreide Β· GitHub

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured