Swiss Grounding MCP
A read-only MCP server that grounds AI assistants in official Swiss sources, returning one cited answer per query with a status the assistant can act on.
Search & read official pages – full-text search over 10,630 official federal/cantonal/municipal pages (procedures, permits, taxes, schools, etc.) and live reading of any official Swiss page.
Federal law – quote current consolidated federal law (Fedlex) by act/article.
Health insurance premiums – cheapest basic insurance premiums per municipality, age, deductible, model.
Holidays – school and public holidays by canton/municipality for 2025–2027.
Waste collection – next collection dates in cities with open data (Zürich, Basel, St. Gallen, Winterthur, …).
Public transport – official timetable connections and departure boards.
Federal votes – upcoming subjects and official results (national + cantonal).
Rates – mortgage reference interest rate (BWO) and SNB exchange rates.
Company register – UID, legal seat, commercial register and VAT status.
Place info – resolve places to municipality, BFS number, population, website.
Weather – current measured values from nearest MeteoSwiss station.
Coverage tool – tells the assistant what is and isn’t in scope.
Polite and resilient: respects robots.txt/terms, paces requests, caches, serves dated copies when sources are down; works in de/fr/it/rm/en with multilingual place handling.
Provides Swiss place facts such as municipality, canton, BFS number, postcodes, population, and official website, using Wikidata as one of the sources for place metadata.
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., "@Swiss Grounding MCP What are the 2026 health insurance premiums in Geneva?"
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.
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.
Try it live
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):
claude mcp add --transport http swiss https://swiss-grounding-mcp-542630986415.europe-west6.run.app/mcpIt 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.
Related MCP server: mcp-i14y
How it works
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:
|
|
|
|
|
answers, with the source | asks one precise question back | says it is outside Switzerland or the scope | says nothing was found, never guesses | names 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 tool | Geography | Source (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… | 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 Thun | Full-text index of 10,630 official pages / 46,952 passages, plus live reading of any official page | Index built 2026-09-25, refreshed weekly; |
Federal law — any act and article, current consolidated version | Federal | Fedlex (Federal Chancellery) | Live; version in force today |
Mandatory health insurance premiums — cheapest offers per municipality, age, deductible, model | 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 | All 26 cantons; municipality level where published (e.g. Scuol, Zürich) | OpenHolidays (aggregated official lists), EDK list, municipality website | 2025–2027 |
Waste collection dates | 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 more | Municipal open data (ERZ Zürich via OpenERZ, data.bs.ch, daten.stadt.sg.ch) | Live, next 120 days |
Public transport — connections and departure boards | All of Switzerland | Official timetable (opentransportdata.swiss via transport.opendata.ch) | Live |
Federal popular votes — upcoming subjects, results (national + canton) | Federal | FSO vote-day open data, Federal Chancellery | Live |
Mortgage reference interest rate (rents) and SNB exchange rates | Federal | BWO; Swiss National Bank | Live (cached 6 h) |
Company registration — UID, legal seat, commercial register and VAT status | All of Switzerland | Federal UID register (FSO) | Live |
Place facts — municipality, canton, BFS number, postcodes, population, official website | All 2,110 municipalities, 26 cantons | BFS register & STATPOP, swisstopo, Wikidata (websites) | Population 2025; register 2026-09-25 |
Current weather measurements | Nearest MeteoSwiss automatic station | MeteoSwiss open data | Live (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_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:
Mode | 17 questions | Practice cases | Links to official Swiss authorities |
With this server | 16/17 | 11/11 | 94% of 34 links |
Web search, no server | 11/17 | 7/11 | 72% of 67 links |
Model knowledge only | 6/17 | 3/11 | 1 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 + LLM | Published samples | All 16 questions | Avg tool calls |
Claude Code + Sonnet | 5/5 | 15/16 | 1.0 |
Claude Code + Haiku | 5/5 | 13/16 | 0.9 |
OpenCode + gpt-5.4-mini | 5/5 | 15/16 | 1.4 |
OpenCode + gpt-4.1-mini | 5/5 | 14/16 | 1.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.
git clone https://github.com/Gastaan/swiss-grounding-mcp && cd swiss-grounding-mcp
uv sync --extra semantic # dependencies, with hybrid search
uv 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/mcp
curl 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.
docker run -p 8000:8000 ghcr.io/gastaan/swiss-grounding-mcp # HTTP: http://localhost:8000/mcp
docker run -i --rm ghcr.io/gastaan/swiss-grounding-mcp --transport stdio # for a client that starts the serverOr 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 mcp add swiss -- uv run --extra semantic --directory /path/to/swiss-grounding-mcp swiss-grounding-mcp
claude mcp add --transport http swiss-http http://localhost:8000/mcp{
"$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}
}
}Give the full path to uv (e.g. from which uv):
{"mcpServers": {"swiss": {"command": "/full/path/to/uv", "args": ["run", "--extra", "semantic", "--directory", "/path/to/swiss-grounding-mcp", "swiss-grounding-mcp"]}}}{"servers": {"swiss": {"type": "stdio", "command": "uv", "args": ["run", "--extra", "semantic", "--directory", "/path/to/swiss-grounding-mcp", "swiss-grounding-mcp"]}}}{"mcpServers": {"swiss": {"command": "uv", "args": ["run", "--extra", "semantic", "--directory", "/path/to/swiss-grounding-mcp", "swiss-grounding-mcp"]}}}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 withinSGM_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:
Variable | Default | Meaning |
|
| Respect robots.txt of every website fetched (RFC 9309), on every redirect hop. Set |
|
| Respect the terms of use recorded in |
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
Available Tools
13 toolscompany_registerCompany register (UID)ARead-onlyIdempotentInspect
Check whether a company is registered: UID, legal seat, commercial register and VAT status, from the federal UID register.
Inputs: name_or_uid (required). Returns: data, status, summary, guidance, +2 more
current_weatherCurrent weather (MeteoSwiss)ARead-onlyIdempotentInspect
Latest measured weather (temperature, humidity, precipitation, wind) at the MeteoSwiss station nearest to a Swiss municipality. Measurements only, no forecasts.
Inputs: place, language. Returns: data, status, summary, guidance, +2 more
federal_votesFederal votesARead-onlyIdempotentInspect
Subjects of the next federal popular vote, or official results of a past vote.
Inputs: place, language, vote_date. Returns: data, status, summary, guidance, +2 more
public_transportPublic transport timetableARead-onlyIdempotentInspect
Swiss public transport connections or next departures (official timetable data).
Inputs: when, limit, origin, arrival, +1 more. Returns: data, status, summary, guidance, +2 more
read_official_pageRead an official pageARead-onlyIdempotentInspect
Fetch the current text of an official Swiss page (live, respecting robots.txt) and return the
passages around focus. Only official Swiss domains are allowed.
Inputs: url (required), focus, max_chars. Returns: data, status, summary, guidance, +2 more
search_official_infoSearch official Swiss informationARead-onlyIdempotentInspect
Full-text search over official Swiss web pages: ch.ch (all languages), federal offices, the 26
cantons and large cities. Use for procedures, rules, deadlines, fees and "how do I…" questions
(permits, moving, taxes, social insurance, driving licences, customs, schools, housing, voting).
Give place to restrict results to federal + that canton/municipality. Returns verbatim excerpts
with URLs.
Inputs: query (required), limit, place, language. Returns: data, status, summary, guidance, +2 more
swiss_coverageWhat this server coversARead-onlyIdempotentInspect
List the topics, geography, sources and freshness this server covers, and what it does not. Call this only when unsure whether a question is in scope.
Inputs: no named parameters. Returns: data, status, summary, guidance, +2 more
swiss_federal_lawSwiss federal law (Fedlex)ARead-onlyIdempotentInspect
Quote federal law from the official consolidated text on Fedlex (version currently in force), with article links. Federal law only; cantonal law is not included.
Inputs: query, article, language, sr_number. Returns: data, status, summary, guidance, +2 more
swiss_holidaysSchool and public holidaysBRead-onlyIdempotentInspect
School holidays by canton or municipality, or public holidays, for a year.
Inputs: kind, year, place, language. Returns: data, status, summary, guidance, +2 more
swiss_place_infoSwiss place factsARead-onlyIdempotentInspect
Resolve a Swiss place to its official municipality: BFS number, canton, district, postcodes, permanent resident population (latest BFS figure) and official website. Use for "how many people live in X", "which canton is X in", or to find a municipality's website.
Inputs: place. Returns: data, status, summary, guidance, +2 more
swiss_ratesReference interest rate and exchange ratesARead-onlyIdempotentInspect
Current mortgage reference interest rate for rents (BWO) or SNB CHF exchange rates.
Inputs: kind (required), currency, language. Returns: data, status, summary, guidance, +2 more
waste_collectionWaste collection datesARead-onlyIdempotentInspect
Next waste collection dates (cardboard, paper, household waste, green waste…) from municipal open data. Needs the municipality; some cities also need postcode or street (the tool will say).
Inputs: place, street, from_date, waste_type. Returns: data, status, summary, guidance, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool addresses a clearly distinct domain (e.g., transport, legal texts, health premiums, weather, company registry). The only related pair is search_official_info and read_official_page, but one is for finding pages and the other for reading specific content, so no ambiguity.
All tools use lowercase with underscores, but they mix prefixes ('swiss_' vs none) and verb/alNoun patterns (e.g., 'public_transport' vs 'search_official_info'). Still, the naming is readable and follows a consistent snake_case convention, so minor deviations do not cause confusion.
With 13 tools, the server covers a broad range of Swiss official information without being excessive. Each tool serves a distinct purpose and fits the stated goal of Swiss grounding, making the count appropriate.
The server covers major Swiss information domains: transport, official search, laws, health insurance, holidays, waste, votes, rates, companies, and weather. It also includes a coverage tool to handle out-of-scope queries, mitigating potential gaps. The lifecycle is appropriate for a read-only grounding server.
Maintenance
Related MCP Connectors
Swiss federal law (Fedlex) and political data (LINDAS) for agents, every answer with sources
Demo of a Swiss tax service for AI agents: AI-drafted answers, sample quotes, nothing validated yet.
Swiss company profiles for AI agents: search firms, read profiles, list a firm for free.
Swiss weather data for AI assistants — forecasts, measurements, stations, pollen.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceVerified knowledge base for AI agents. Stop hallucinations with certified, source-backed facts. Covers Swiss law, health, finance, climate, AI/ML, and more. 8 tools, no API key needed, public and free.MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to the Swiss I14Y Interoperability Platform, enabling natural language exploration of government datasets, APIs, codelists, and public services.MIT
- FlicenseNot gradedqualityDmaintenanceA production-minded Agentic RAG backend for informational guidance about Swiss immigration and administrative procedures, using only official Swiss government sources with evidence metadata.1-
- AlicenseNot gradedqualityCmaintenanceProvides AI assistants with citable access to Bernese laws (BSG) and administrative court rulings (Verwaltungsgericht Bern) via search, retrieval by number, and article extraction.MIT