
Swiss Grounding
io.github.soheil1lotfi由 GitHub 账号 soheil1lotfi 发布v0.1.1更新于 Oct 24, 2026
Cited answers about Switzerland from official federal, cantonal and municipal sources.
概览
一个只读的 MCP 服务器,依据瑞士联邦、州和市镇官方来源回答问题,并注明负责机构。
- 可以做什么
- 检索并阅读瑞士官方页面,涵盖手续、规定、费用和期限,返回原文摘录并注明负责机构,支持德语、法语、意大利语、罗曼什语和英语。查询服务器声明的覆盖范围与已知限制。读取官方页面实时文本。查询联邦法律条文、各市镇强制医保最低保费、学校与公共假期、垃圾收运日期、公共交通时刻、联邦公投、房贷参考利率与汇率、企业登记信息、市镇概况和当前天气。
- 适用场景
- 当助手需要回答关于瑞士的实际问题——居留许可、登记、税务、保险、假期、垃圾收运、交通、投票、企业登记或地点信息——且答案应来自负责机构而非通用网页搜索或模型记忆时适用。
- 运行要求
- 可使用托管的远程端点(Streamable HTTP,无需注册或 API 密钥),或在本地运行:需要 uv 与 Python 3.13,或使用已发布的 Docker 镜像。可选的语义检索扩展会在首次启动时下载约 240 MB 的嵌入模型。所有数据源均无需凭据。
安装
在 SourceWeft 中
- 打开 控制台中的 Swiss Grounding,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.soheil1lotfi%2Fswiss-grounding-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。
{
"mcpServers": {
"swiss-grounding": {
"type": "http",
"url": "https://swiss-grounding-mcp-542630986415.europe-west6.run.app/mcp"
}
}
}README
Swiss Grounding MCP
Answers about Switzerland, with the source.
An MCP server that grounds AI assistants in official federal, cantonal and municipal information,
in German, French, Italian, Romansh and English, and cites the responsible authority in every answer.
[Live on Google Cloud Run] [Hosted endpoint check] [CI] [MCP Registry] [Docker image]
Try it live
Add it to an assistant in one line, e.g. Claude Code (other clients):
It scales to zero when idle, so the first request after a pause starts an instance (about 2 s; hybrid search follows about 10 s later, keyword search answers meanwhile). It is rate-limited per client, refuses browser origins and is checked every 6 hours. The hosted instance runs the code in this repository, which also runs locally.
How it works
The example is sample question 3 of the challenge brief, answered by the live server.
Ask a general-purpose assistant about Switzerland and it may answer for the wrong canton, from an outdated page or from a neighbouring country. Swiss Grounding MCP gives it the responsible authority's own data instead:
- One tool call. The assistant picks one of 13 read-only tools. Places work as people write them: Genf, Ginevra, Genève, Schuls → Scuol, 8003, Bahnhofstrasse 1, Zürich.
- The right authority. Answers come from the level that is responsible (federal office, canton or municipality), through a prebuilt index of 10,630 official pages (keyword + multilingual semantic search), live federal APIs and municipal open data.
- Polite and resilient. robots.txt and terms of use are respected by default, requests are paced and cached, and when a source is down a dated copy is served or the source is named.
- One cited answer. Every tool returns the same contract, with verbatim excerpts and one of five statuses that tell the assistant what to do:
Coverage
The declared scope: what the server answers, for which area, from which authority. Assistants can read
it too, with the swiss_coverage tool.
Not covered, and known limits
- Anything outside Switzerland, e.g. the German Rundfunkbeitrag in Konstanz: the server says so.
- Cantons GR, BL and SH block or do not serve text to automated clients, so their cantonal pages
are not in the index (ch.ch and federal pages still apply;
read_official_pagereports the block honestly). VS (7 pages), TI (45) and TG (52) are only partly indexed. - Municipal web pages are indexed for the nine cities above (120–250 pages each; Lausanne 66, Thun 32). Zürich has only a few pages, Bellinzona and Fribourg none yet (the next refresh crawls Fribourg's own domain, ville-fribourg.ch). For other municipalities the server returns the official website and can read a given page live.
- Waste calendars exist only where municipalities publish open data; elsewhere the server says so and links the municipality. Holidays, premiums and place facts cover every municipality.
- Cantonal law texts, individual tax calculations and weather forecasts are not provided.
- School holidays come from OpenHolidays, which aggregates official lists. Where the index holds the responsible authority's own calendar (e.g. ge.ch, bern.ch, the school of Scuol), that page is cited first, with the EDK list and the municipality site alongside. Periods are labelled by school type where a canton publishes several (canton Bern: German- and French-speaking schools).
- Registering on arrival in Lausanne is weak: the city's residents' office page is not in the index.
- Cross-language questions: a question in another language than the place's pages first returns a language hint, not the page, and the assistant has to search again. In end-to-end runs of such a question (French, about Bern), Sonnet followed the hint and answered from Bern's page; Haiku did so in 1 of 4 runs.
- Search is keyword-based by default. With the optional
semanticextra it is hybrid and also finds pages worded differently or written in another language, but still misses some (measured); Romansh is not covered by the embedding model.
Results
With and without this server. The same 28 questions (the 5 published samples, 12 of our own and the organisers' 11 practice cases), asked to Claude Code with Sonnet three ways that differ only in their tools:
With the server, answers also take half the calls and half the time of web search (1.2 vs 2.4 calls, 14 vs 28 s per question). Web search often reaches the right figure, but mixes in comparison sites, news and tourism pages and rounds official figures; without any tools the model mostly declines or answers from dated knowledge.
Across the evaluation setup: 2 MCP clients × 2 LLMs, on the 5 published sample questions plus 11 of our own (de/fr/it/rm/en, including ask-back, out-of-scope and not-covered cases), run of 2026-09-25:
On the organisers' practice pack: Sonnet 11/11, Haiku 10/11. Hybrid search finds an official page on the topic for 25 of 38 labelled questions (keyword only: 19), and passes off no wrong page for the 5 questions that have none. Every miss is listed in docs/evaluation.md.
Run it yourself
Requires uv (it installs Python 3.13). No API keys or credentials are needed for any source.
The prebuilt data (municipality register, health premiums, search index, passage vectors) ships in the
repository, built by the scripts in scripts/ and refreshed weekly
(how). The first start unpacks the index (~1 s) and downloads
the small embedding model once (~240 MB, in the background: searches use keywords until it is ready).
For a lighter install without hybrid search, drop --extra semantic from the commands and client configurations
(what changes).
Docker: the published image (~1.4 GB, hybrid search and its model included) runs as an unprivileged user and never downloads anything at runtime.
Or build it with docker build -t swiss-grounding-mcp .. When the port is reachable from outside a
trusted network, add -e SGM_AUTH_TOKEN=<secret> (HTTP security).
Without cloning (keyword search): uvx --from git+https://github.com/Gastaan/swiss-grounding-mcp swiss-grounding-mcp.
Connect an MCP client
Any client that speaks MCP over stdio or Streamable HTTP works. Tested with Claude Code, OpenCode, the
MCP Inspector CLI and the FastMCP client, including the legacy initialize handshake (protocol
2025-06-18) and the stateless 2026-07-28 protocol. For the hosted server, add its /mcp URL as a
remote (HTTP) server. For a clone, use absolute paths and replace /path/to/swiss-grounding-mcp.
The server sends usage instructions to the client.
Claude Code
OpenCode · opencode.json
Claude Desktop · claude_desktop_config.json
Give the full path to uv (e.g. from which uv):
VS Code · .vscode/mcp.json
Cursor · .cursor/mcp.json
[!TIP] Give the client a request timeout of 30 s or more. OpenCode waits only 5 s by default, while a slow official source can take longer; the server ends every tool call within
SGM_TOOL_TIMEOUT(30 s) with a cleansource_error, so a client timeout of 30 s lets that answer arrive.
Configuration
Nothing needs configuring. Respecting robots.txt and terms of use is on by default and can be switched off:
Cache, timeouts, offline mode, bearer token, rate limit, allowed origins and logging are described in docs/configuration.md.
Documentation
- Response contract and tools: the JSON every tool returns, the five statuses, place handling, all 13 tools
- Configuration and operations: every setting, HTTP security, caching and source etiquette, monitoring, the hosted instance
- Search: keyword and semantic ranking, and its measured quality
- Evaluation: the challenge self-check, end-to-end runs and every known miss
- Development: architecture, data and its weekly refresh, adding a source, tests
Built for the Swisscom myAI challenge Swiss Grounding MCP at Swiss AI Weeks, Zurich 2026.
来源:README.md,提交 703576b
工具
0版本历史
1- v0.1.1最新Sep 25, 2026
评分
已满足适用检查项的 75%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具必需15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。