Swiss Register of Buildings and Dwellings (GWR/RegBL): EGID/EWID lookup, geocoding, housing stats
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Part of the Swiss Public Data MCP Portfolio β open-source MCP servers connecting AI agents to Swiss public data. Private project, independent of any employer or institutional affiliation.
MCP server for the Swiss Federal Register of Buildings and Dwellings (GWR/RegBL) β buildings, dwellings, and the construction pipeline
Β«How many dwellings were newly built in the City of Zurich since 2020, how many with 4+ rooms β and how many are currently under construction?Β»
Verified against the live dump on 2026-07-24: 16'164 new dwellings since 2020 (27.4% with 4+ rooms β the family-housing proxy), and 7'287 dwellings currently under construction. Dwellings under construction today are households in 1β3 years: the early indicator for school-space planning.
The GWR/RegBL is to buildings what Zefix is to companies: not one data source among many, but the federal register whose identifiers (EGID for buildings, EWID for dwellings) serve as join keys across Swiss administrative data. This server exposes the register's public extract through MCP tools β building lookups, address geocoding, per-municipality construction statistics, sub-municipal bounding-box analysis, and the planning/construction pipeline.
address_to_egid is the plug that makes other data sources EGID-capable: address in, federal identifier and LV95 coordinates out.
This server uses Architecture B (Hybrid: Dump-first, API-fallback).
Rationale (verified live on 2026-07-24):
public.madd.bfs.admin.ch/{canton}.zip) is refreshed daily (~05:30 CET) and ships a ready-made data.sqlite with tables building (399'830 rows for ZH), entrance, dwelling (894'631 rows for ZH), and code. No CSV parsing, no auth.api3.geo.admin.ch (find / identify / SearchServer) works reliably without authentication for single-entity lookups and geocoding, but does not scale to area-wide aggregations (result limits)./api/buildings/{egid} returned 404; it is excluded until path and auth status are clarified β no blocker, since all Phase-1 tools work without it.Consequences:
SWISS_HOUSING_DUMP_TTL_HOURS).source (attribution) and provenance (daily_dump | live_api | cached).| Endpoint | HTTP | Status | Note |
|---|---|---|---|
api3.geo.admin.ch β¦/find (EGID lookup) | 200 | β works | full attribute set, no auth |
api3.geo.admin.ch β¦/identify (coordinates) | 200 | β works | 77 attributes incl. EGID/EWID |
β¦/SearchServer (address β EGID) | 200 | β works | featureId = {EGID}_{EDID}; axis swap: y=east, x=north |
public.madd.bfs.admin.ch/zh.zip | 200 | β works | 121 MB, daily refresh, contains data.sqlite |
madd.bfs.admin.ch/api/buildings/{egid} | 404 | β excluded | path/auth unclear |
| Invalid EGID on find | 200 | β οΈ soft error | empty results array β not an HTTP error |
lookup_building(egid) β single building by federal identifier (live API)address_to_egid(address) β geocode any Swiss address to EGID/EDID + LV95lookup_dwellings(egid) β all dwellings of a building with rooms, area, floornew_construction(municipality_bfs, since_year) β yearly new construction incl. 4+ room family-housing shareconstruction_pipeline(municipality_bfs) β projected / approved / under constructionbuildings_in_bbox(e_min, n_min, e_max, n_max) β sub-municipal analysis (e.g. school districts)municipality_housing_stats(municipality_bfs) β housing stock and room-size mixexplain_code(attribute, code) β decode GWR codes via the official DE/FR/IT code tabledump_status() β cache freshness, graceful-degradation entry pointClaude Desktop (claude_desktop_config.json):
Cloud (Render/Railway):
| Variable | Default | Purpose |
|---|---|---|
SWISS_HOUSING_TRANSPORT | stdio | stdio | streamable-http | sse |
SWISS_HOUSING_CACHE | ~/.cache/swiss-housing-mcp | Dump cache directory |
SWISS_HOUSING_DUMP_TTL_HOURS | 24 | Dump freshness window |
This server speaks two protocol eras over the same endpoint. The client's first request on a connection decides which one applies; a later claim from the other era is refused.
| Era | Revision | Who reaches it |
|---|---|---|
initialize handshake | 2024-11-05 β¦ 2025-11-25 | What today's clients speak. The server answers with the revision asked for, or with the 2025-11-25 ceiling when the request asks for something newer. |
| Per-request envelope | 2026-07-28 | A request carrying the 2026-07-28 _meta envelope opens a modern connection. |
Both revisions are pinned in
tests/test_protocol_version.py and asserted
against the installed SDK, so a Dependabot bump of mcp cannot move either one
silently. This server builds no ASGI app to send an initialize through, so
the gate asserts the SDK constants rather than a measured response β the
weaker form, named rather than left unsaid.
Note that the SDK's LATEST_PROTOCOL_VERSION is an alias for the modern
era, not for the handshake era β pinning against it alone would leave the era
that current clients actually negotiate free to drift.
Update policy. When the gate fails, do not edit the constant blindly: read
the spec changelog between the two revisions, verify the server still behaves,
then move the constant, this section, README.de.md and
CHANGELOG.md together.
buildings_in_bbox covers the rectangular approximation.GBAUJ (construction year) is missing for a share of older buildings; period codes (GBAUP) exist as fallback but are not yet exposed.canton explicitly for others.swiss-statistics-mcp β this server is the register layer, not the statistics layer.See CHANGELOG.md
Contributions are welcome β see CONTRIBUTING.md (Deutsch).
Read-only, no PII, no authentication β a public federal register accessed through a fixed set of endpoints. See SECURITY.md (Deutsch) for the full posture and how to report a vulnerability.
MIT License β see LICENSE. Data: GWR/RegBL, Swiss Federal Statistical Office (BFS), open government data with attribution.
Hayal Oezkan Β· github.com/malkreide
swiss-statistics-mcp (indices, STAT-TAB), zurich-opendata-mcp (city-level data)No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/swiss-housing-mcp)<a href="https://allmcps.com/mcp/swiss-housing-mcp"><img src="https://allmcps.com/api/badge/swiss-housing-mcp?style=directory" alt="Swiss Housing MCP on AllMCPs" /></a>