swisstopo-mcp
This MCP server gives AI assistants read-only, unauthenticated access to Swiss official geodata and related public datasets through 20 tools.
Geocode Swiss addresses/place names/postal codes to coordinates, and reverse-geocode coordinates to addresses.
Query the national swisstopo map catalogue: search layers, inspect layer fields/legends, find features at a point or by attribute, and retrieve individual features.
Get elevation at a point and compute elevation profiles along a line.
Convert coordinates officially between WGS84 and LV95.
Search STAC geodata collections and retrieve download links for datasets such as orthophotos, elevation models, and 3D buildings.
Generate shareable map.geo.admin.ch URLs.
Resolve building zone and municipality/BFS number at a coordinate.
Look up cadastral parcel IDs (EGRID) and retrieve public-law land-use restrictions (OEREB) for parcels/cantons.
Discover and query consolidated geodata layers, including street directories, ΓREB availability, and intercantonal geodienste.ch data.
Find OpenStreetMap POIs such as schools, playgrounds, pharmacies, and stations around a point or address.
Resolve Swiss postal codes to locality, commune, district, canton, and BFS commune number.
Look up communes by name, BFS number, canton, or district, and search Swiss streets/localities by free text.
Provides access to OpenStreetMap points of interest (schools, playgrounds, pharmacies, etc.) via the Overpass API, allowing queries for features around a given location.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@swisstopo-mcp What's the elevation at Uetliberg summit?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π¨π Part of the Swiss Public Data MCP Portfolio
swisstopo-mcp
MCP server for Swiss federal geodata -- maps, elevation, geocoding, cadastral extracts, and downloadable datasets via Swisstopo APIs
Overview
swisstopo-mcp gives AI assistants access to Switzerland's official geodata infrastructure through 20 tools, all without authentication:
Source | Data | API |
Swisstopo REST API | 500+ geodata layers (buildings, boundaries, land use) | REST/JSON |
Geocoding | Official addresses, place names, postal codes | REST/JSON |
Height Service | Elevation above sea level, elevation profiles | REST/JSON |
STAC Catalog | Orthophotos, elevation models, 3D buildings | STAC 0.9 |
WMTS | National maps, aerial images, zoning maps | URL builder |
OEREB Cadastre | Public-law restrictions, parcels | REST/JSON (cantonal) |
geodienste.ch | Interkantonale Basisgeodaten (cadastral survey, contaminated sites, hazard maps, β¦) | OGC API Features / WMS / WFS |
OpenStreetMap | Points of interest (schools, playgrounds, pharmacies, β¦) | Overpass API (ODbL) |
OpenPLZ API | Administrative address level: postal codes β commune (BFS number) β district β canton | REST/JSON (BFS + swisstopo OGD) |
Anchor demo query: "Which communes are in the Uster district, and what are their BFS numbers for joining with BFS statistics data?"
(The BFS commune number is the official join key to swiss-statistics-mcp and zurich-opendata-mcp β this is what turns a geodata wrapper into a semantic connector at the commune level.)
β More use cases by audience β
Demo
Related MCP server: Schwaizer BFS MCP Server
Features
πΊοΈ 20 tools (REST, Geocoding, Height, STAC, WMTS, OEREB, geodienste.ch, OpenStreetMap/Overpass, OpenPLZ)
ποΈ Resolve the administrative address level (PLZ β commune/BFS number β district β canton) via OpenPLZ
π Geocode Swiss addresses and reverse-geocode coordinates
ποΈ Query elevation and compute elevation profiles
π¦ Discover and download geodatasets (orthophotos, 3D buildings, historical maps)
ποΈ Identify map features at coordinates across 500+ Swisstopo layers
π Generate shareable map.geo.admin.ch links
π Look up cadastral property IDs (EGRID) and retrieve OEREB extracts
π No API key required for all tools (OEREB extract needs a supported canton)
βοΈ Dual transport -- stdio (Claude Desktop) + Streamable HTTP (cloud)
Prerequisites
Python 3.11+
uv (recommended) or pip
Installation
# Clone the repository
git clone https://github.com/malkreide/swisstopo-mcp.git
cd swisstopo-mcp
# Install
pip install -e .
# or with uv:
uv pip install -e .Or with uvx (no permanent installation):
uvx swisstopo-mcpQuickstart
# stdio (for Claude Desktop)
python -m swisstopo_mcp.server
# Streamable HTTP (port 8000)
python -m swisstopo_mcp.server --http --port 8000Try it immediately in Claude Desktop:
"Where is Bahnhofstrasse 1, Zurich? Give me the coordinates." "What is the elevation at the Uetliberg summit?" "What buildings are at coordinates 2683500, 1247500 (LV95)?"
Configuration
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"swisstopo": {
"command": "python",
"args": ["-m", "swisstopo_mcp.server"]
}
}
}Or with uvx:
{
"mcpServers": {
"swisstopo": {
"command": "uvx",
"args": ["swisstopo-mcp"]
}
}
}Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Cloud Deployment (SSE for browser access)
For use via claude.ai in the browser (e.g. on managed workstations without local software):
Render.com (recommended):
Push/fork the repository to GitHub
On render.com: New Web Service -> connect GitHub repo
Set start command:
python -m swisstopo_mcp.server --http --port 8000In claude.ai under Settings -> MCP Servers, add:
https://your-app.onrender.com/sse
Available Tools
REST API (Layer & Feature Queries)
Tool | Description |
| The national map catalogue (api3.geo.admin.ch). One |
| Harmonised building zone at a coordinate β one call, no layer lookup (not legally binding) |
| Municipality, canton and official BFS number at a coordinate |
swisstopo_map_query operations
| Answers | Required arguments |
| Which layers exist for a keyword? (500+ catalogue) |
|
| What fields can I query on this layer, and what is its legend? |
|
| What is at this coordinate? |
|
| Which features carry this value? (e.g. buildings by EGID) |
|
| Give me this one feature in full, with geometry |
|
Arguments belonging to a different operation are rejected, not ignored β the
error names the ones the chosen operation accepts. Silently dropping a
misplaced search_field would return a plausible answer to a question nobody
asked, which is the failure mode the whole envelope design is against.
Geocoding
Tool | Description |
| Convert Swiss addresses, place names, or postal codes to coordinates |
| Find the nearest address for given coordinates |
Height Service
Tool | Description |
| Get elevation above sea level (m a.s.l.) at a coordinate |
| Compute an elevation profile along a line |
| Official WGS84 β LV95 conversion via the swisstopo REFRAME service |
STAC Catalog (Geodata Downloads)
Tool | Description |
| Search the STAC catalog for downloadable geodatasets |
| Get details and download links for a STAC collection |
WMTS (Map URLs)
Tool | Description |
| Generate a map.geo.admin.ch URL for browser display |
OEREB Cadastre
Tool | Description |
| Resolve a cadastral property ID (EGRID) from coordinates |
| Retrieve public-law land-use restrictions (OEREB) for a parcel |
Consolidated Geodata FaΓ§ade
One faΓ§ade over several map/layer sources, kept under the 25-tool budget (see
docs/geodaten-erweiterung-phase1.md):
Tool | Description |
| Discover layer keys for |
| Query a chosen layer by |
| OpenStreetMap POIs (schools, playgrounds, pharmacies, β¦) around a point via Overpass β separate source, ODbL (Β© OpenStreetMap contributors) |
Administrative Address Level (OpenPLZ)
The amtliche address hierarchy PLZ β commune β district β canton, served by
the OpenPLZ API (data: BFS municipal directory +
swisstopo street directory, Swiss OGD β a separate source and licence from
the swisstopo geodata above). Every commune-bearing response exposes
bfs_commune_number as a named top-level field: the official join key to
BFS statistics (swiss-statistics-mcp) and zurich-opendata-mcp.
Tool | Description |
| Resolve a Swiss postal code β locality, commune (+BFS number), district, canton |
| Resolve a commune both directions ( |
| Full-text search over Swiss streets and localities, returning commune + BFS number per hit |
Example Use Cases
Query | Tool |
"Where is Bahnhofstrasse 1, Zurich?" |
|
"What is the elevation at the Uetliberg summit?" |
|
"What buildings are at coordinates 2683500, 1247500?" |
|
"Find orthophoto datasets for download" |
|
"Show me a map of Bern at zoom level 10" |
|
"What restrictions apply to parcel at Musterstrasse 5?" |
|
"Which schools are within 500 m of Bederstrasse 109, 8002 ZΓΌrich, and which streets lead there?" |
|
"Which contaminated-sites data is free for canton ZH?" |
|
"Which communes are in the Uster district and what are their BFS numbers?" |
|
"Which commune and canton does postal code 8001 belong to?" |
|
"What is the BFS number of Winterthur (to join with BFS statistics)?" |
|
Architecture
βββββββββββββββββββ ββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β Claude / AI ββββββΆβ swisstopo-mcp ββββββΆβ Swisstopo REST API β
β (MCP Host) βββββββ (MCP Server) βββββββ api3.geo.admin.ch β
βββββββββββββββββββ β β ββββββββββββββββββββββββββββ€
β 20 Tools ββββββΆβ Geocoding β
β Stdio | Streamable HTTP βββββββ api3.geo.admin.ch β
β β ββββββββββββββββββββββββββββ€
β No authentication required ββββββΆβ STAC Catalog β
β (all tools; OEREB canton opt) βββββββ data.geo.admin.ch β
β β ββββββββββββββββββββββββββββ€
β ββββββΆβ OEREB Cadastre β
β βββββββ (cantonal endpoints) β
β β ββββββββββββββββββββββββββββ€
β ββββββΆβ geodienste.ch (OGC API) β
β βββββββ overpass.osm.ch (ODbL) β
β β ββββββββββββββββββββββββββββ€
β BFS-Nr = join key to ββββββΆβ OpenPLZ API β
β swiss-statistics-mcp βββββββ openplzapi.org (BFS/OGD)β
ββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββProject Structure
swisstopo-mcp/
βββ src/swisstopo_mcp/
β βββ __init__.py # Package version
β βββ server.py # MCP server wiring (tool registrations)
β βββ api_client.py # Shared HTTP client (httpx + error handling)
β βββ geocoding.py # swisstopo_geocode, swisstopo_reverse_geocode
β βββ rest_api.py # swisstopo_map_query (5 operations), zoning_at, municipality_at
β βββ height.py # swisstopo_get_height, swisstopo_elevation_profile
β βββ stac.py # swisstopo_search_geodata, swisstopo_get_collection
β βββ wmts.py # swisstopo_map_url
β βββ oereb.py # swisstopo_get_egrid, swisstopo_get_oereb_extract
β βββ geodata.py # swisstopo_query_geodata + swisstopo_list_available_layers (faΓ§ade)
β βββ overpass.py # swisstopo_query_osm_features (OpenStreetMap / Overpass)
β βββ openplz.py # swisstopo_lookup_postal_code, swisstopo_find_commune, swisstopo_search_address (OpenPLZ)
βββ tests/
β βββ test_api_client.py
β βββ test_geocoding.py
β βββ test_height.py
β βββ test_oereb.py
β βββ test_rest_api.py
β βββ test_stac.py
β βββ test_wmts.py
β βββ test_geodata.py
β βββ test_overpass.py
β βββ test_openplz.py
β βββ test_retry.py
βββ .github/workflows/ci.yml # GitHub Actions (Python 3.11/3.12/3.13)
βββ pyproject.toml
βββ CHANGELOG.md
βββ CONTRIBUTING.md # Contribution guide (English)
βββ CONTRIBUTING.de.md # Contribution guide (German)
βββ SECURITY.md # Security policy (English)
βββ SECURITY.de.md # Security policy (German)
βββ LICENSE
βββ README.md # This file (English)
βββ README.de.md # German versionSecurity & Limits
The full security policy and posture is documented in SECURITY.md.
Phase
This server is in Phase 2.5 β Consolidation of swiss-geodata-mcp
(see docs/roadmap.md, the single authority for phase state).
Property | Status |
Read tools | 24, all |
Write tools | none β Phase 3, not planned |
Transport | stdio (default) and Streamable-HTTP |
ISDS classification |
|
DSG processing record | not maintained, with reasons β |
Last audit |
|
A phase advance requires: the phase's roadmap items checked off, a re-run audit
with no open critical findings, and a CHANGELOG entry naming the new phase.
Phase 3 (write tools) additionally requires re-running the Lethal-Trifecta
assessment and a security review before any implementation starts.
Tool budget and aggregation
20 tools against a self-imposed budget of 25. The check's ideal is β€12, so the count still needs an argument, not just a number. Per cluster:
The five api3 tools are merged (0.4.1, breaking). search_layers,
layer_info, identify_features, find_features and get_feature are now
operation values on swisstopo_map_query. They were the textbook
one-tool-per-REST-endpoint mapping the check names, and they are gone as such.
Earlier releases argued the opposite here, and the argument is worth keeping visible because it was not wrong so much as outweighed: merging relocates the decision from tool selection into schema navigation, where a model has less help, because tool descriptions are what it actually reads. Three things address that directly rather than hoping it does not matter:
The operations are named for questions, not endpoints.
identifyandfindare ESRI vocabulary β they say which MapServer route is called, not what is being asked, and nobody without ArcGIS experience can tell them apart.features_at_pointandfeatures_by_attributecan be picked correctly from the operation list alone.A misplaced argument is an error, not a silent drop. With five tools the schema made a wrong pairing impossible. With one tool it does not, so validation does: each operation declares the fields it accepts, and anything else is refused with a message naming the alternatives.
The
notehints from ARCH-003 still name the next step, now as operations rather than tool names β an empty attribute search points atoperation='layer_info'for the valid field names, and so on.
Observability was the other cost, and it is not paid: each operation keeps its
own log and trace label (swisstopo_map_query:features_at_point), so per-operation
timing and error rates survive the merge.
The two pairs that stay separate, both named by the audit:
geocode+reverse_geocodedo hit the same SearchServer endpoint, so on the API axis this is a 1:1 mapping twice over. They stay separate on the axis that matters for tool selection: "address β coordinates" and "coordinates β address" are different questions with different input types, and collapsing them into one tool with a mode would make the model choose a variant instead of a tool. Sharing an endpoint is an implementation detail of the upstream.search_geodataβget_collectionis a genuine search β detail pair over STAC; see below.
The naming ambiguity is resolved, which the audit did not raise but the
previous version of this section recorded for "the next breaking release" β this
is it. swisstopo_search_layers and swisstopo_list_available_layers both said
"layers" while fronting different catalogues. The first is now
swisstopo_map_query with operation='search_layers', which puts the national
catalogue in the tool name and leaves list_available_layers unambiguously the
consolidated faΓ§ade.
Search β detail pairs. search_geodata β get_collection is a genuine
pair: STAC collection metadata is large and callers usually want one of many
search hits. get_egrid β get_oereb_extract was the same shape and has been
collapsed: swisstopo_oereb_at answers the actual question in one call and
resolves the EGRID internally, because the EGRID is an upstream identifier
rather than something a caller asked for. get_egrid remains for callers who
want the parcel ID itself.
Genuine aggregation already in place. query_geodata fronts three sources
behind one tool; zoning_at and municipality_at each collapse a discovery
chain that previously took two calls.
When the next source is added, the choice is a raise or a consolidation.
With the api3 five merged there is no obvious consolidation left holding
headroom, so the next surface growth is a real conversation about the ceiling
rather than a deferred cleanup. tests/test_tool_namespace.py::TestToolBudget
is where that conversation is forced: raising the budget means editing the
number there and in both READMEs.
Data sources and licences
Every response carries source and license. ARE is a different federal
office from swisstopo, so its licence is asserted rather than inherited.
Source | Served by | Licence |
swisstopo / geo.admin.ch | most tools | Swiss OGD (opendata.swiss) |
swisstopo REFRAME (geodesy.geo.admin.ch) |
| Swiss OGD (opendata.swiss) |
swissBOUNDARIES3D (swisstopo) |
| Swiss OGD (opendata.swiss) |
|
| Swiss OGD β Bundesamt fΓΌr Raumentwicklung ARE |
Cantonal ΓREB cadastre |
| Cantonal ΓREB terms |
geodienste.ch (cantons) |
| Free use β attribution required |
OpenStreetMap (Overpass) |
| ODbL β Β© OpenStreetMap contributors |
OpenPLZ (BFS + swisstopo) |
| Free use β attribution required |
ch.are.bauzonen is a federal synthesis for cross-cantonal comparability and
is not legally binding β only the cantonal or communal Nutzungsplanung is.
That caveat is carried on every swisstopo_zoning_at result record.
Project structure
The tool modules sit flat under src/swisstopo_mcp/ rather than in a tools/
sub-package. Each module maps to exactly one upstream API family β
rest_api.py β api3 MapServer, stac.py β STAC, oereb.py β cantonal ΓREB,
openplz.py β OpenPLZ, overpass.py β OSM, coords.py β REFRAME β which is
the axis along which this server's code actually varies. A tools/ level would
add a directory without adding a distinction.
server.py contains tool registrations only; every tool body lives in its
domain module. Splitting it further is a readability question, not a structural
one.
Lethal Trifecta assessment
Capability | Status | Rationale |
Access to private data | β No | Public Open Data only (federal/cantonal geodata) |
Exposure to untrusted content | β οΈ Limited | Reads only from a fixed allow-list of trusted geo.admin / OEREB hosts |
External communication (write/send) | β No | Read-only; no mail/webhook/write tools |
Trifecta score: at most 1 of 3 β safe by design.
Egress
Outbound requests are restricted to an explicit code-layer allow-list and redirects are disabled β see docs/network-egress.md.
Container deployment
For containerised HTTP deployments, a hardened Dockerfile and Kubernetes
manifests (non-root, read-only root filesystem, dropped capabilities, egress
NetworkPolicy) are provided β see docs/deployment.md.
MCP Protocol Version
The server speaks 2026-07-28 natively and keeps every older revision reachable. Which one you get is decided by how you connect, not by configuration β one process serves both eras at once.
Modern era | Handshake era | |
Revisions |
|
|
Opening exchange | none β every request stands alone |
|
Protocol version travels in |
| the |
Session | none |
|
Directory |
| the |
Server identity | the |
|
Gone in this revision |
| β |
A 2026-07-28 request is a self-contained POST to /mcp:
POST /mcp
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: swisstopo_map_url
Content-Type: application/json
Accept: application/json, text/event-stream
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{
"name":"swisstopo_map_url",
"arguments":{"params":{"lat":46.9481,"lon":7.4474}},
"_meta":{
"io.modelcontextprotocol/protocolVersion":"2026-07-28",
"io.modelcontextprotocol/clientCapabilities":{}
}}}The MCP-Protocol-Version header is what routes the request to the modern
path; without it the same body lands on the handshake transport. Mcp-Method
and Mcp-Name must agree with the body, or the request is rejected with
-32020. All three are in the CORS allow-list so a browser client's preflight
passes.
What this means in practice:
Existing clients are unaffected. A client asking for
2025-06-18still gets2025-06-18; one asking overinitializefor2026-07-28gets the handshake ceiling2025-11-25back. Measured, not assumed βtests/test_protocol_version.py.Both eras expose the same 20 tools. Nothing is gated on the revision (
tests/test_modern_protocol.py).Sticky sessions matter only for the handshake era. A modern request carries no session, so it can be served by any replica β see docs/deployment.md.
Neither revision is author-settable: the SDK negotiates the handshake era and
routes the modern one, and pyproject.toml pins mcp to the 2.x major so an
update cannot move either silently. tests/test_protocol_version.py pins both
ceilings and fails if a Dependabot bump changes one.
Update policy
SDK updates are tested on a feature branch before merge.
A change to either protocol ceiling is recorded in CHANGELOG.md under
### Changed, naming the old and the new version.A protocol change that breaks existing clients triggers a major release.
Sessions & Authentication
The server is unauthenticated by design β it serves only public open data.
Sessions exist in the handshake era only. There, session IDs are managed
entirely by the MCP SDK; there is no per-user state, so there is nothing
user-specific to bind a session to. Idle sessions are reaped after
SWISSTOPO_SESSION_IDLE_TIMEOUT seconds (default 1800) so a client that
disconnects without sending DELETE /mcp does not leak one for the lifetime of
the process. A 2026-07-28 request opens no session at all, so neither the
timeout nor the reaper applies to it.
If an authenticated deployment is ever introduced, session IDs must be bound to the validated user identity (audit finding SEC-009).
Error handling
Execution errors (upstream failure, invalid value) are returned as a
ToolResponsewithis_error: trueand a user-friendlysummary; unexpected exception text is masked and logged to stderr instead. No upstream body or internal configuration is forwarded: Overpass error pages are classified against a fixed signature table, and an egress refusal returns a fixed message rather than the allow-list (OBS-002).Protocol errors (unknown tool, malformed/invalid arguments) come back from the SDK as tool results with the protocol
isErrorflag set β not as JSON-RPC error objects. Verified against mcp 1.28.1 by runtime probe; an earlier version of this section claimed-32602and was wrong. Input validation happens at the Pydantic boundary (SEC-018).Both flags agree. A handled execution error sets the protocol
isErrorflag and the payload fieldis_error, so a client can branch on either. The envelope β includingsourceandlicenseβ survives on the error path (OBS-001).
MCP Primitives
Tools are the surface, and almost all of it: every result is a live, parameterised API query rather than a static addressable document.
One Resource β swisstopo://catalogue/layers β serves the faΓ§ade layer
catalogue. It is the one thing here that behaves like a document: deterministic,
idempotent, and already served with provenance: "cached". swisstopo_list_available_layers
remains for filtered queries; the resource is for a client that wants the
catalogue itself, addressably.
Two Prompts encode the workflows below, including the precedence rule for point questions. That rule lives in the tool descriptions and in the server instructions too, but a prompt is the one place a model reads it as guidance rather than as one of 24 descriptions (audit ARCH-007/ARCH-008):
Prompt | Arguments |
|
|
|
|
Tool workflows
Most tools return a thought-complete result in a single call. Two domains use a short, documented discovery chain (each tool's description states the next step):
Feature query: all four steps are
swisstopo_map_querywith a differentoperation:search_layers(find layer IDs) βlayer_info(see the queryable fields) βfeatures_at_point/features_by_attributeβfeature_by_id(full detail).Cadastre:
swisstopo_geocodeβswisstopo_oereb_at(one call: coordinates β EGRID β extract). Useswisstopo_get_egridβswisstopo_get_oereb_extractonly when the parcel ID itself is wanted.Downloads:
swisstopo_search_geodataβswisstopo_get_collection.
Response Format
Every tool returns a structured ToolResponse (FastMCP emits it as structured
content with an output schema, plus a JSON text block):
Field | Meaning |
| Human-readable Markdown summary |
| Machine-readable structured records |
| Number of |
|
|
| Data attribution (OGD-CH, CC/OGD terms) |
| How and when the data was obtained |
|
|
Known Limitations
OEREB tools require a canton parameter; not all cantons expose the same API format
STAC catalog uses Swisstopo's v0.9 endpoint; some collections may lack complete metadata
Geocoding covers Swiss addresses only (no Liechtenstein)
Rate limits are enforced by Swisstopo; high-frequency usage may be throttled
Known findings β OpenPLZ live probe (2026-07-20)
The OpenPLZ endpoints were probed live before implementation. Findings baked into the tools:
Endpoint / behaviour | Result | Handling |
| 200, 26 records, | canton abbreviation resolved from this list |
| 200 | path param is the numeric key |
| 200 + |
|
| 200, |
|
| 200 + | reported as a note β empty β absent |
list endpoints pagination | default | tools iterate pages via |
raw umlaut in query ( | HTTP 400 | httpx URL-encodes params automatically |
| β | not used; the join key is the current |
bulk dump | none from OpenPLZ (only | Architecture A (live-API-only) β adequate for a lookup connector |
The abbreviation-vs-key trap in one line: an empty OpenPLZ list is almost never proof that something does not exist β it usually means a wrong path parameter (an abbreviation where a numeric key was expected). The tools resolve abbreviations server-side and annotate every empty result.
Testing
# Unit tests (no network required)
pytest tests/ -m "not live"
# Integration tests (live API calls)
pytest tests/ -m "live"Changelog
See CHANGELOG.md
Contributing
See CONTRIBUTING.md
Security
Read-only, no authentication, public geodata only. See SECURITY.md (Deutsch) for the security posture and how to report a vulnerability.
License
MIT License -- see LICENSE
Data provided by swisstopo under Open Government Data terms.
Author
Hayal Oezkan Β· malkreide
Credits & Related Projects
Swisstopo: www.swisstopo.admin.ch -- Swiss Federal Office of Topography
Swisstopo APIs: api3.geo.admin.ch / data.geo.admin.ch
Protocol: Model Context Protocol -- Anthropic / Linux Foundation
Related: zurich-opendata-mcp -- Zurich city open data
Related: swiss-transport-mcp -- Swiss public transport
Related: swiss-cultural-heritage-mcp -- Swiss cultural heritage
Portfolio: Swiss Public Data MCP Portfolio
Installation
Run via uv's uvx β no clone or manual install needed. Add to your MCP client config (mcpServers for Claude Desktop, Cursor and Windsurf; use a top-level servers key for VS Code in .vscode/mcp.json):
{
"mcpServers": {
"swisstopo-mcp": {
"command": "uvx",
"args": [
"swisstopo-mcp"
]
}
}
}Available Tools
20 toolsswisstopo_convert_coordinatesARead-onlyIdempotent
Rechnet Koordinaten amtlich zwischen WGS84 und LV95 um (swisstopo REFRAME).
<use_case>Wenn Koordinaten in LV95 (EPSG:2056) vorliegen und fΓΌr die ΓΌbrigen Tools nach WGS84 gebracht werden mΓΌssen β oder umgekehrt fΓΌr den Katasterbezug, wo Zentimeter zΓ€hlen.</use_case> <important_notes>Achsenreihenfolge beachten: REFRAME benennt beide Eingaben easting/northing. Bei wgs84_to_lv95 ist easting der LΓNGENgrad und northing der BREITENgrad β umgekehrt zur lat/lon-Reihenfolge der ΓΌbrigen Tools. Vertauschte Achsen werden abgewiesen, nicht stillschweigend umgerechnet.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_elevation_profileARead-onlyIdempotent
Berechnet ein HΓΆhenprofil entlang einer Linie aus mehreren Koordinatenpaaren.
<use_case>HΓΆhenverlauf z.B. fΓΌr Wander-/Schulweg-Analysen.</use_case> <important_notes>BenΓΆtigt β₯2 Koordinatenpaare. Standard ist WGS84 ('lat1,lon1;lat2,lon2;β¦'); fΓΌr LV95 coordinate_system='lv95' setzen und die Paare als 'easting,northing' ΓΌbergeben.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_find_communeARead-onlyIdempotent
LΓΆst Gemeinden auf: NameβBFS-Nummer, BFS-NummerβName, oder alle Gemeinden eines Kantons/Bezirks.
<use_case>Vier Modi (genau einen Parameter angeben): name (Name β
BFS-Nummer), bfs_number (BFS-Nummer β Gemeinde), canton (alle Gemeinden
eines Kantons) oder district (alle Gemeinden eines Bezirks). Beantwortet
z.B. Β«Welche Gemeinden liegen im Bezirk Uster und wie lauten ihre
BFS-Nummern?Β».</use_case>
<important_notes>bfs_commune_number ist der amtliche Join-SchlΓΌssel zu
BFS-Statistikdaten (swiss-statistics-mcp). canton akzeptiert KΓΌrzel ('ZH')
oder BFS-Nummer ('1') β die KΓΌrzelβSchlΓΌssel-AuflΓΆsung erfolgt serverseitig,
weil der Pfad sonst still eine leere Liste liefert. Gemeindelisten sind
vollstΓ€ndig (interne Pagination), nicht auf 10 EintrΓ€ge gekΓΌrzt.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_geocodeARead-onlyIdempotent
Wandelt eine Adresse, einen Ortsnamen oder eine PLZ in Koordinaten um (Geocoding).
<use_case>Startpunkt fΓΌr ortsbezogene Abfragen: Adresse β Koordinaten, die danach an swisstopo_get_height, swisstopo_map_query (operation='features_at_point') oder swisstopo_get_egrid ΓΌbergeben werden.</use_case>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_get_collectionARead-onlyIdempotent
Ruft Detailinformationen und Download-Links einer STAC-Collection ab.
<use_case>Zweiter Schritt nach swisstopo_search_geodata, um Assets/Download-URLs einer Collection zu erhalten.</use_case>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_get_egridARead-onlyIdempotent
Ermittelt die EGRID (GrundstΓΌck-ID) aus Koordinaten fΓΌr einen bestimmten Kanton.
<use_case>GrundstΓΌck-ID (EGRID) zu einer Koordinate, wenn die ID selbst gebraucht wird. FΓΌr die BeschrΓ€nkungen direkt swisstopo_oereb_at nutzen β das lΓΆst den EGRID intern auf.</use_case> <important_notes>Erfordert einen unterstΓΌtzten Kanton (z.B. ZH, BE).</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_get_heightARead-onlyIdempotent
Gibt die HΓΆhe ΓΌber Meer (m ΓΌ. M.) an einer Koordinate zurΓΌck.
<use_case>PunkthΓΆhe fΓΌr eine Adresse/Koordinate; fΓΌr Linien siehe swisstopo_elevation_profile.</use_case> <important_notes>Koordinaten entweder als lat/lon (WGS84) ODER als easting/northing (LV95) angeben β nicht beides.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_get_oereb_extractARead-onlyIdempotent
Ruft ΓΆffentlich-rechtliche EigentumsbeschrΓ€nkungen (ΓREB) fΓΌr ein GrundstΓΌck (EGRID) ab.
<use_case>ΓREB-Auszug zu einem bereits bekannten EGRID. Wer von einer Koordinate ausgeht, nimmt swisstopo_oereb_at β das erledigt beide Schritte in einem Aufruf.</use_case> <important_notes>Erfordert einen unterstΓΌtzten Kanton.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_list_available_layersARead-onlyIdempotent
Discovery-Tool: listet die Layer-Kennungen, die swisstopo_query_geodata akzeptiert.
<use_case>Erster Schritt vor swisstopo_query_geodata: herausfinden, welche DatensΓ€tze (Strassenverzeichnis, ΓREB-VerfΓΌgbarkeit, interkantonale geodienste.ch-Topics) verfΓΌgbar und ohne Vertrag frei nutzbar sind. FΓΌr konkrete geodienste-Kennungen einen Kanton angeben (z.B. canton='ZH').</use_case>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_lookup_postal_codeARead-onlyIdempotent
LΓΆst eine Schweizer PLZ in Ort, Gemeinde, Bezirk und Kanton auf (OpenPLZ, amtlich).
<use_case>Beantwortet Β«Zu welcher Gemeinde/welchem Kanton gehΓΆrt PLZ 8001?Β» und
liefert die BFS-Gemeindenummer (bfs_commune_number).</use_case>
<important_notes>bfs_commune_number ist der amtliche Join-SchlΓΌssel zu
BFS-Statistikdaten (swiss-statistics-mcp) und zu zurich-opendata-mcp. Quelle
OpenPLZ (BFS/swisstopo OGD), nicht die swisstopo-Geodaten. Eine unbekannte PLZ
liefert eine leere Trefferliste mit erklΓ€rendem Hinweis.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_map_queryARead-onlyIdempotent
Fragt den nationalen Swisstopo-Kartenkatalog ab (500+ Layer): Layer finden, Felder ansehen, Features abfragen.
<use_case>Der ΓΌbliche Ablauf ist eine Kette: operation='search_layers' liefert Layer-IDs, operation='layer_info' zeigt deren abfragbare Felder, danach operation='features_at_point' (rΓ€umlich) oder 'features_by_attribute' (nach Attributwert), und operation='feature_by_id' holt ein einzelnes Feature vollstΓ€ndig.</use_case> <important_notes>Genau eine operation pro Aufruf. Felder, die zu einer anderen operation gehΓΆren, werden abgelehnt statt ignoriert β die Fehlermeldung nennt die zulΓ€ssigen.</important_notes> <important_notes>FΓΌr Bauzone bzw. Gemeinde gibt es direkte Tools (swisstopo_zoning_at, swisstopo_municipality_at). 'features_at_point' nur nutzen, wenn zusΓ€tzliche Rohattribute gebraucht werden oder ein anderer Layer gefragt ist.</important_notes> <important_notes>Das ist der nationale Katalog von api3.geo.admin.ch. FΓΌr interkantonale und kantonale Quellen ist swisstopo_list_available_layers β swisstopo_query_geodata zustΓ€ndig, fΓΌr herunterladbare DatensΓ€tze swisstopo_search_geodata.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_map_urlARead-onlyIdempotent
Generiert eine teilbare map.geo.admin.ch-URL zum Γffnen im Browser.
<use_case>Einen Kartenausschnitt mit optionalen Layern als Link bereitstellen (kein Datenabruf).</use_case>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_municipality_atARead-onlyIdempotent
Gibt Gemeinde, BFS-Nummer und Kanton an einer Koordinate zurΓΌck (swissBOUNDARIES3D).
<use_case>Koordinate β amtliche BFS-Gemeindenummer, der Join-Key zu swiss-statistics-mcp und zurich-opendata-mcp.</use_case> <important_notes>Der Layer fΓΌhrt eine FlΓ€che pro historischem Jahrgang; es wird der aktuelle Stand zurΓΌckgegeben. Auf einer Gemeindegrenze oder ausserhalb der Schweiz bleibt das Resultat leer.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_oereb_atARead-onlyIdempotent
Gibt die ΓREB-EigentumsbeschrΓ€nkungen an einer Koordinate zurΓΌck (ein Aufruf).
<use_case>Β«Welche BeschrΓ€nkungen gelten auf diesem GrundstΓΌck?Β» β lΓΆst den EGRID intern auf. Das ist der normale Weg; swisstopo_get_egrid braucht es nur, wer die Parzellen-ID selbst benΓΆtigt.</use_case> <important_notes>Nur fΓΌr Kantone mit angebundenem ΓREB-Dienst (siehe SWISSTOPO_OEREB_CANTONS). Koordinaten als lat/lon (WGS84) oder easting/northing (LV95).</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_query_geodataARead-onlyIdempotent
Einheitliche Fassade ΓΌber mehrere Geodaten-Quellen anhand einer Layer-Kennung.
<use_case>Ein Tool fΓΌr drei Quellen: 'strassenverzeichnis' (Strassen um einen Punkt), 'oereb-verfuegbarkeit' (ΓREB-Status/ZustΓ€ndigkeit an einem Punkt) und 'geodienste:<topic>:<KANTON>' (interkantonale Basisgeodaten via OGC API Features). Genau eine Ortsangabe (point | bbox | commune) ΓΌbergeben.</use_case> <important_notes>GΓΌltige Layer-Kennungen via swisstopo_list_available_layers. geodienste-Layer erfordern bbox oder point (mit radius_m).</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_query_osm_featuresARead-onlyIdempotent
Findet OpenStreetMap-POIs (Schulen, SpielplΓ€tze, Apotheken β¦) im Umkreis.
<use_case>Beantwortet Β«Welche SchulhΓ€user/SpielplΓ€tze liegen im Umkreis von R Metern um diesen Punkt/diese Adresse?Β». ErgΓ€nzt die amtlichen swisstopo-Daten um Points-of-Interest aus OpenStreetMap.</use_case> <important_notes>Quelle OpenStreetMap (ODbL, Β© OpenStreetMap contributors), nicht swisstopo. Overpass hat Rate-Limits/Timeouts β kleiner Radius bevorzugt; bei Γberlastung kommt eine sprechende Fehlermeldung statt Daten.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_reverse_geocodeARead-onlyIdempotent
Findet die nΓ€chstgelegene Adresse zu gegebenen WGS84-Koordinaten (Reverse Geocoding).
<use_case>Koordinaten aus Karte oder GPS in eine lesbare Adresse auflΓΆsen.</use_case>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_search_addressARead-onlyIdempotent
Volltextsuche ΓΌber Schweizer Strassen und Ortschaften (OpenPLZ FullTextSearch).
<use_case>Findet Strassen und Orte zu einem freien Suchbegriff und liefert je Treffer Gemeinde und BFS-Nummer, wenn vorhanden.</use_case> <important_notes>Quelle OpenPLZ (BFS/swisstopo OGD). Ergebnisse sind paginiert (max. 50/Abfrage); die Gesamttrefferzahl wird ausgewiesen. FΓΌr die exakte PLZβGemeinde-AuflΓΆsung ist swisstopo_lookup_postal_code prΓ€ziser.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_search_geodataARead-onlyIdempotent
Durchsucht den STAC-Katalog nach herunterladbaren Geodaten.
<use_case>Findet Orthophotos, HΓΆhenmodelle (swissALTI3D), 3D-GebΓ€ude und historische Karten zum Download.</use_case> <important_notes>Liefert Collections/Metadaten; Download-Links via swisstopo_get_collection.</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
swisstopo_zoning_atARead-onlyIdempotent
Gibt die harmonisierte Bauzone an einer Koordinate zurΓΌck (ch.are.bauzonen, ARE).
<use_case>Β«Welche Bauzone gilt hier?Β» in einem Aufruf β ohne vorher die Layer-ID via swisstopo_map_query erst suchen zu mΓΌssen.</use_case> <important_notes>Der harmonisierte ARE-Layer ist eine Synthese fΓΌr die schweizweite Vergleichbarkeit und NICHT rechtsverbindlich β verbindlich ist allein die kantonale/kommunale Nutzungsplanung. Der Hinweis steht in jedem Resultat. Koordinaten als lat/lon (WGS84) oder easting/northing (LV95).</important_notes>
Inputs: params (required). Returns: Consistent envelope for all swisstopo-mcp tool results.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 20 tools
The tools are largely well-differentiated, and descriptions include explicit cross-references between overlapping workflows (e.g., swisstopo_oereb_at vs swisstopo_get_oereb_extract, swisstopo_map_query vs swisstopo_query_geodata). However, a few pairs could still be confused at the name level, such as swisstopo_map_query and swisstopo_query_geodata, or swisstopo_geocode and swisstopo_search_address, so it is not perfectly ambiguity-free.
Almost all tools use snake_case with the swisstopo_ prefix, and the '_at' suffix forms a clear pattern for coordinate-based lookups (municipality_at, zoning_at, oereb_at). Still, there are minor deviations like swisstopo_map_url, swisstopo_map_query, and swisstopo_elevation_profile, which lack the verb-object structure used elsewhere; the mixed get_/query_/search_ verbs also prevent a perfect score.
With 20 tools, the server is near the upper boundary of what is easy for an agent to navigate. The count is understandable for a national geodata platform covering geocoding, elevation, maps, OEREB, STAC downloads, and address lookups, but several tools could have been consolidated or layered more tightly.
The tool surface covers the main Swiss geodata workflows: geocoding and reverse geocoding, height and elevation profiles, coordinate conversion, map/feature queries, zoning, municipality and postal-code lookups, OEREB/EGRID, and downloadable STAC collections. Minor gaps exist, such as no direct tile/WMS URL generation or administrative boundary geometry retrieval except through swisstopo_map_query, but these are workable gaps rather than dead ends.
Maintenance
Related MCP Connectors
opendata.swiss MCP β Switzerland's federal open-data portal (CKAN catalogue).
Swiss weather and federal geodata from MeteoSwiss and swisstopo on data.geo.admin.ch β findβ¦
MCP server for Japan geodata: cadastral lot numbers (chiban) and reverse geocoding, for AI agents.
Swiss Transport MCP β wraps Transport Open Data API (free, no auth)
Related MCP Servers
- AlicenseBqualityBmaintenanceSwiss open data MCP server β transport, weather, geodata, companies, etc,. Zero API keys.5424 npm28MIT
- AlicenseAqualityDmaintenanceAn unofficial MCP server for accessing Swiss Federal Statistical Office (BFS) data.81MIT
- AlicenseBqualityDmaintenanceMCP server exposing all major Swiss official public APIs as native tools for any MCP-compatible AI agent.3412 npmMIT
- AlicenseAqualityBmaintenanceMCP server for Switzerland's national metadata catalogue, enabling AI agents to discover datasets, APIs, public services, and publishers through free-text search and structured queries.1327 PyPIMIT