Swiss Geodata Mcp

io.github.malkreide由 GitHub 账号 malkreide 发布v0.1.1更新于 Oct 24, 2026

Swiss federal geodata (geo.admin.ch): layers, spatial identify, zoning, heights, LV95 conversion

已验证STDIO仅桌面位置与生活数据与分析

概览

AI 生成的概览

已弃用的 MCP 服务器,让助手以只读方式访问瑞士联邦地理数据(geo.admin.ch):图层检索、空间识别、建筑分区、高程与 LV95 坐标转换。

可以做什么
  • 按关键词检索约 700 个联邦图层目录,并查看图层的可查询字段与图例
  • 在任意图层的 LV95 坐标点上识别地物,或按属性值查找图层要素
  • 查询某点所属的市镇与州,以及该点的建筑分区
  • 获取某点的地形高程,以及沿线的海拔剖面
  • 通过官方 REFRAME 服务在 WGS84 与 LV95 之间转换坐标
适用场景
适合回答与瑞士地点相关的问题:某地块适用哪种分区、某坐标属于哪个市镇、某条路线的高程或坡度,或某主题是否存在联邦数据。注意 README 已将其标记为弃用,建议改用覆盖相同能力的后继服务器。
运行要求
以 Python 包形式在本地运行,通过 uvx 启动(需 Python 工具链)。无需 API 密钥或账号,但需联网访问公开的 geo.admin.ch 服务。可选环境变量 SWISS_GEODATA_TRANSPORT、HOST、PORT 可切换为 HTTP 传输。
安装前请注意
README 说明该项目已弃用、将被归档,且不再获得修复或依赖更新,建议迁移到后继服务器。所有工具均为只读,但结果来自实时上游服务,可能随调用而变化。协调后的分区图层为综合数据,不具法律约束力。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Swiss Geodata Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

⚠️ DEPRECATED — use swisstopo-mcp instead

This server has been consolidated into swisstopo-mcp and is no longer maintained. Every capability it offered now exists there, including the one it used to have exclusively — the official REFRAME coordinate conversion.

Why: both servers wrapped the same api3.geo.admin.ch endpoints and overlapped in five core tools (layer search, identify, find, height, elevation profile). Maintaining two servers for one data source meant double the audits, double the CVE bumps, and an unclear choice for users. The rationale and the migration steps are documented in docs/merge-plan-swiss-geodata-mcp.md.

This repository will be archived. The code below still works, but it receives no further fixes or dependency updates. See Migration below.

🇨🇭 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)

ToolDescriptionData source
geo_search_layersKeyword search over the ~700-layer federal cataloguegeo.admin.ch SearchServer
geo_identifyWhat is at this LV95 point? (any layer)geo.admin.ch MapServer identify
geo_findFind features on a layer by attribute valuegeo.admin.ch MapServer find
geo_municipality_atMunicipality + canton containing a pointswissBOUNDARIES3D
geo_zoning_atBuilding zone(s) at a pointch.are.bauzonen (ARE)
geo_heightTerrain height at a pointswissALTI3D height service
geo_elevation_profileElevation profile along a linegeo.admin.ch profile service
geo_layer_infoQueryable fields + legend (plain text) for a layergeo.admin.ch MapServer
geo_convert_coordinatesWGS84 ↔ LV95 conversiongeodesy.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)

EndpointHTTPStatusNote
SearchServer type=layers200✅ workscatalogue full-text searchable
MapServer identify (bauzonen, boundaries)200✅ workstolerance 0 works for polygon layers
height service200✅ worksvalue arrives as JSON string
profile.json (GET + geom)200✅ worksCOMB/DTM2/DTM25 altitudes
MapServer {layer}/legend200⚠️ HTMLstripped to plain text in geo_layer_info
reframe wgs84↔lv95200✅ workscoordinates arrive as JSON strings
Miss on identify/find200⚠️ softempty results array — not an HTTP error

Quick start

Claude Desktop

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

Cloud / Render.com (Streamable HTTP)

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

Configuration

VariableDefaultPurpose
SWISS_GEODATA_TRANSPORTstdiostdio | streamable-http | sse
HOST / PORT127.0.0.1 / 8000HTTP 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

bash
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


Migration to swisstopo-mcp

Replace this server in your MCP client config:

jsonc
// before{ "swiss-geodata": { "command": "uvx", "args": ["swiss-geodata-mcp"] } }// after{ "swisstopo":     { "command": "uvx", "args": ["swisstopo-mcp"] } }

Tool mapping

this serverswisstopo-mcpnote
geo_search_layersswisstopo_search_layers—
geo_identifyswisstopo_identify_features—
geo_findswisstopo_find_features—
geo_heightswisstopo_get_height—
geo_elevation_profileswisstopo_elevation_profiletakes a coordinate string; set coordinate_system="lv95" for LV95 support points
geo_zoning_atswisstopo_zoning_atthe non-binding ARE caveat now travels on every result record
geo_municipality_atswisstopo_municipality_atBFS number is named bfs_commune_number and normalised to int
geo_layer_infoswisstopo_layer_info—
geo_convert_coordinatesswisstopo_convert_coordinatessame direction values; same REFRAME service

Two differences worth knowing

Coordinates. This server was LV95-only and rejected WGS84. swisstopo-mcp accepts either lat/lon (WGS84) or easting/northing (LV95) on the point-based tools — pass one pair, not both. Existing LV95 call sites keep working; the argument names are the same.

Response shape. This server returned a JSON string (GeoEnvelope) with the payload under result. swisstopo-mcp returns a structured ToolResponse: records live in results (plural, always a list), with count, match_type, source, license and a Markdown summary alongside. Code that parsed result needs to read results.

来源:README.md,提交 aca8dbe

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分