Swiss Grounding

io.github.soheil1lotfi由 GitHub 帳號 soheil1lotfi 發布v0.1.1更新於 Oct 24, 2026

Cited answers about Switzerland from official federal, cantonal and municipal sources.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取知識與記憶

概覽

AI 產生的概覽

一個唯讀的 MCP 伺服器,依據瑞士聯邦、邦與市鎮官方來源回答問題,並標明負責機關。

可以做什麼
檢索並閱讀瑞士官方頁面,涵蓋手續、規定、費用與期限,回傳原文摘錄並標明負責機關,支援德語、法語、義大利語、羅曼什語與英語。查詢伺服器宣告的涵蓋範圍與已知限制。讀取官方頁面的即時文字。查詢聯邦法律條文、各市鎮強制健保最低保費、學校與國定假日、垃圾收運日期、大眾運輸時刻、聯邦公投、房貸參考利率與匯率、公司登記資訊、市鎮概況與目前天氣。
適用情境
當助理需要回答關於瑞士的實務問題——居留許可、登記、稅務、保險、假期、垃圾收運、交通、投票、公司登記或地點資訊——且答案應來自負責機關而非一般網頁搜尋或模型記憶時適用。
執行需求
可使用託管的遠端端點(Streamable HTTP,無需註冊或 API 金鑰),或在本機執行:需要 uv 與 Python 3.13,或使用已發佈的 Docker 映像。選用的語意檢索擴充會在首次啟動時下載約 240 MB 的嵌入模型。所有資料來源皆無需憑證。
安裝前請注意
唯讀且公開,但會即時抓取官方網站頁面;robots.txt 與使用條款檢查預設開啟,可透過 SGM_RESPECT_ROBOTS 與 SGM_RESPECT_TERMS 關閉。若將 HTTP 實例暴露在可信網路之外,應設定 SGM_AUTH_TOKEN。部分邦與市鎮未被收錄或僅部分收錄,邦級法律文本、個人稅務計算與天氣預報不在範圍內。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Swiss Grounding,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

[QR code that opens the live server]
Scan to open it on your phone

Running on Google Cloud Run in Zürich (europe-west6), deployed from main.
Public and read-only: no sign-up, no API key.

Live server: swiss-grounding-mcp-542630986415.europe-west6.run.app
MCP endpoint (Streamable HTTP):
https://swiss-grounding-mcp-542630986415.europe-west6.run.app/mcp
Health: /health

Add it to an assistant in one line, e.g. Claude Code (other clients):

sh
claude mcp add --transport http swiss https://swiss-grounding-mcp-542630986415.europe-west6.run.app/mcp

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

[Architecture: an AI assistant sends one tool call to Swiss Grounding MCP, which picks one of 13 read-only tools, resolves the place, fetches official federal, cantonal and municipal data politely and returns one cited answer]

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:

  1. 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.
  2. 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.
  3. 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.
  4. One cited answer. Every tool returns the same contract, with verbatim excerpts and one of five statuses that tell the assistant what to do:
okneeds_contextnot_coverednot_foundsource_error
answers, with the sourceasks one precise question backsays it is outside Switzerland or the scopesays nothing was found, never guessesnames the source that is down

Coverage

The declared scope: what the server answers, for which area, from which authority. Assistants can read it too, with the swiss_coverage tool.

Topic and toolGeographySource (authority)Freshness
Procedures, rules, fees, deadlines — permits & migration, moving & registration, taxes, social insurance (AHV/IV), unemployment, driving licences & vehicles, customs & parcels, schools, housing, voting, civil status…
search_official_info read_official_page
Federal (ch.ch in de/fr/it/rm/en, federal offices, AHV/IV, arbeit.swiss), cantonal portals of 23 cantons (see limits below), city pages of Lucerne, Lugano, Winterthur, Biel/Bienne, St. Gallen, Bern, Geneva, Lausanne and ThunFull-text index of 10,630 official pages / 46,952 passages, plus live reading of any official pageIndex built 2026-09-25, refreshed weekly; read_official_page fetches live text
Federal law — any act and article, current consolidated version
swiss_federal_law
FederalFedlex (Federal Chancellery)Live; version in force today
Mandatory health insurance premiums — cheapest offers per municipality, age, deductible, model
health_insurance_premiums
All 2,110 municipalities (premium regions)FOPH premium open data (same data as priminfo.admin.ch)2026 premiums; 2027 added when FOPH publishes them (end of September)
School and public holidays
swiss_holidays
All 26 cantons; municipality level where published (e.g. Scuol, Zürich)OpenHolidays (aggregated official lists), EDK list, municipality website2025–2027
Waste collection dates
waste_collection
City of Zürich (by postcode), Basel/Riehen/Bettingen (by address), St. Gallen (by street); by collection zone: Winterthur, Uster, Wetzikon, Dübendorf, Horgen, Wädenswil, Adliswil, Thalwil and 12 moreMunicipal open data (ERZ Zürich via OpenERZ, data.bs.ch, daten.stadt.sg.ch)Live, next 120 days
Public transport — connections and departure boards
public_transport
All of SwitzerlandOfficial timetable (opentransportdata.swiss via transport.opendata.ch)Live
Federal popular votes — upcoming subjects, results (national + canton)
federal_votes
FederalFSO vote-day open data, Federal ChancelleryLive
Mortgage reference interest rate (rents) and SNB exchange rates
swiss_rates
FederalBWO; Swiss National BankLive (cached 6 h)
Company registration — UID, legal seat, commercial register and VAT status
company_register
All of SwitzerlandFederal UID register (FSO)Live
Place facts — municipality, canton, BFS number, postcodes, population, official website
swiss_place_info
All 2,110 municipalities, 26 cantonsBFS register & STATPOP, swisstopo, Wikidata (websites)Population 2025; register 2026-09-25
Current weather measurements
current_weather
Nearest MeteoSwiss automatic stationMeteoSwiss open dataLive (10-minute values)

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_page reports 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 semantic extra 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:

Mode17 questionsPractice casesLinks to official Swiss authorities
With this server16/1711/1194% of 34 links
Web search, no server11/177/1172% of 67 links
Model knowledge only6/173/111 link in 28 answers

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:

Client + LLMPublished samplesAll 16 questionsAvg tool calls
Claude Code + Sonnet5/515/161.0
Claude Code + Haiku5/513/160.9
OpenCode + gpt-5.4-mini5/515/161.4
OpenCode + gpt-4.1-mini5/514/161.0

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.

sh
git clone https://github.com/Gastaan/swiss-grounding-mcp && cd swiss-grounding-mcpuv sync --extra semantic                                                  # dependencies, with hybrid searchuv run --extra semantic swiss-grounding-mcp                               # stdio (for local MCP clients)uv run --extra semantic swiss-grounding-mcp --transport http --port 8000  # HTTP: http://localhost:8000/mcpcurl localhost:8000/health                                                # "search": "hybrid (…)"

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.

sh
docker run -p 8000:8000 ghcr.io/gastaan/swiss-grounding-mcp                # HTTP: http://localhost:8000/mcpdocker run -i --rm ghcr.io/gastaan/swiss-grounding-mcp --transport stdio   # for a client that starts the server

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
sh
claude mcp add swiss -- uv run --extra semantic --directory /path/to/swiss-grounding-mcp swiss-grounding-mcpclaude mcp add --transport http swiss-http http://localhost:8000/mcp
OpenCode · opencode.json
json
{  "$schema": "https://opencode.ai/config.json",  "mcp": {    "swiss": {"type": "local", "command": ["uv", "run", "--extra", "semantic", "--directory", "/path/to/swiss-grounding-mcp", "swiss-grounding-mcp"], "enabled": true, "timeout": 30000},    "swiss-http": {"type": "remote", "url": "http://localhost:8000/mcp", "enabled": false, "timeout": 30000}  }}
Claude Desktop · claude_desktop_config.json

Give the full path to uv (e.g. from which uv):

json
{"mcpServers": {"swiss": {"command": "/full/path/to/uv", "args": ["run", "--extra", "semantic", "--directory", "/path/to/swiss-grounding-mcp", "swiss-grounding-mcp"]}}}
VS Code · .vscode/mcp.json
json
{"servers": {"swiss": {"type": "stdio", "command": "uv", "args": ["run", "--extra", "semantic", "--directory", "/path/to/swiss-grounding-mcp", "swiss-grounding-mcp"]}}}
Cursor · .cursor/mcp.json
json
{"mcpServers": {"swiss": {"command": "uv", "args": ["run", "--extra", "semantic", "--directory", "/path/to/swiss-grounding-mcp", "swiss-grounding-mcp"]}}}

[!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 clean source_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:

VariableDefaultMeaning
SGM_RESPECT_ROBOTStrueRespect robots.txt of every website fetched (RFC 9309), on every redirect hop. Set false to disable.
SGM_RESPECT_TERMStrueRespect the terms of use recorded in data/source_terms.json: hosts whose terms do not allow automated access are never fetched. Set false to disable.

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
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

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

評分

已滿足適用檢查項的 75%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。