swiss-apis-mcp
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-apis-mcp What are the next trains from Geneva to Zurich?"
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 APIs MCP Server
MCP (Model Context Protocol) server exposing all major Swiss official public APIs as native tools for any MCP-compatible AI agent.
29 tools — 9 domains — 100% free APIs — zero configuration required for most tools.
What you can ask your AI
"What are the next trains from Geneva-Cornavin to Zurich?"
"What is the altitude of GPS coordinates 45.9763, 7.6586 (Matterhorn)?"
"Find all active companies named 'Nestlé' in the Swiss commercial register."
"Which canton and municipality contain coordinates 46.52, 6.63?"
"Search opendata.swiss for air quality datasets."
"What parliamentary motions on climate change were filed in 2024?"
"Convert LV95 coordinates 2600000, 1200000 to WGS84."
"Which API keys are configured? Set up my ZEFIX credentials."Related MCP server: srgssr-mcp
Tools Reference
Setup (2 tools)
Tool | Description | Auth |
| Check which optional API keys are configured and which are missing | None |
| Store an API key persistently — takes effect immediately, no restart needed | None |
The agent calls
swiss_check_setupfirst, then asks you for any missing keys and stores them viaswiss_set_api_key. Keys are saved in~/.swiss-apis-mcp/keysand survive server restarts.
Transport (4 tools)
Tool | Description | Auth |
| Next departures from any Swiss station | None |
| Train/bus connections between two locations | None |
| Search stations by name or GPS coordinates | None |
| GTFS-RT real-time feeds (delays, positions, alerts) |
|
API: transport.opendata.ch · opentransportdata.swiss
Geography (7 tools)
Tool | Description | Auth |
| Search addresses, communes, POIs, postal codes | None |
| Terrain altitude in meters for any Swiss WGS84 coordinate | None |
| Which canton contains a coordinate | None |
| Which commune contains a coordinate | None |
| Convert WGS84 ↔ LV95 ↔ LV03 | None |
| Official swisstopo map tile URL | None |
| Search features in a GeoAdmin map layer | None |
API: GeoAdmin REST · swisstopo REFRAME · GeoAdmin Height
Health (3 tools)
Tool | Description | Auth |
| Search BAG/OFSP datasets (diseases, mortality, vaccination) | None |
| Metadata and download URLs for a specific health dataset | None |
| Swiss Health Atlas — 100+ cantonal health indicators | None |
API: opendata.swiss/BAG · versorgungsatlas.ch
Politics (3 tools)
Tool | Description | Auth |
| Search motions, postulates, votes across 74+ parliaments | None |
| Parliament members and their activity | None |
| Search Swiss federal legislation via Fedlex SPARQL | None |
API: OpenParlData · Fedlex
Business (4 tools)
Tool | Description | Auth |
| Search Swiss companies in ZEFIX (official commercial register) |
|
| Full company details by UID (CHE-xxx.xxx.xxx) |
|
| SOGC publications for a company (registrations, mergers) |
|
| Search 14,000+ official Swiss government datasets | None |
API: ZEFIX REST · opendata.swiss CKAN
Energy (2 tools)
Tool | Description | Auth |
| SFOE datasets — solar, hydro, EV charging, consumption | None |
| Swissgrid — production mix, cross-border electricity flows | None |
Weather & Environment (3 tools)
Tool | Description | Auth |
| MeteoSwiss OGD datasets (temperature, precipitation, climate) | None |
| SLF avalanche warnings and snow data | None |
| BAFU river levels, flow rates, flood forecasts | None |
API: MeteoSwiss OGD · hydrodaten.admin.ch
Food (2 tools)
Tool | Description | Auth |
| FoodRepo (EPFL) — barcoded Swiss food products + nutrients |
|
| Swiss Food Composition Database (FSVO/OSAV) | None |
API: FoodRepo · naehrwertdaten.ch
Statistics & Finance (4 tools)
Tool | Description | Auth |
| BFS/OFS datasets — population, economy, education | None |
| Swiss National Bank — exchange rates, interest rates, inflation | None |
| Swiss postal codes, streets, communes via OpenPLZ | None |
| SEM migration and asylum statistics | None |
API: BFS · data.snb.ch · openplzapi.org
Installation
1. From npm (recommended)
No clone required. Point your MCP client at the published package:
{
"mcpServers": {
"swiss-apis-mcp": {
"command": "npx",
"args": ["-y", "swiss-apis-mcp"]
}
}
}Or install globally and run the compiled entrypoint:
npm install -g swiss-apis-mcpThen use "command": "swiss-apis-mcp" (and "args": [] if your client requires the field) in the same config shape as above.
2. From source (development)
git clone https://github.com/clement8426/swiss-apis-mcp.git
cd swiss-apis-mcp
npm install
npm run buildUse node /path/to/swiss-apis-mcp/dist/index.js or npx tsx src/index.ts in your MCP config while developing.
3. Optional API keys
Most tools work with zero configuration. Four tools need free credentials:
Key | Service | Register |
| opentransportdata.swiss — GTFS real-time | |
| ZEFIX — Swiss commercial register | |
| ZEFIX — Swiss commercial register | |
| FoodRepo (EPFL) — food products |
Option A — Let the AI agent do it for you:
Ask your agent "check my Swiss APIs setup". It will call swiss_check_setup, identify what's missing, ask you for credentials, and store them automatically via swiss_set_api_key. No restart needed.
Option B — Set them manually before launching:
cp .env.example .env
# Edit .env with your keys4. Test locally (from a clone)
npm run inspectorOpens the MCP Inspector at http://localhost:6274 — run any tool interactively.
Integration
Examples below use npx -y swiss-apis-mcp (published package). From a local clone, replace the args with ["tsx", "/absolute/path/to/swiss-apis-mcp/src/index.ts"] or ["node", "/absolute/path/to/swiss-apis-mcp/dist/index.js"] after npm run build.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"swiss-apis-mcp": {
"command": "npx",
"args": ["-y", "swiss-apis-mcp"]
}
}
}Cursor
Edit ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-level):
{
"mcpServers": {
"swiss-apis-mcp": {
"command": "npx",
"args": ["-y", "swiss-apis-mcp"]
}
}
}Windsurf
Edit ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"swiss-apis-mcp": {
"command": "npx",
"args": ["-y", "swiss-apis-mcp"]
}
}
}Claude Code
claude mcp add swiss-apis-mcp npx -y swiss-apis-mcpContinue.dev
In .continue/config.json:
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "swiss-apis-mcp"]
}
}
]
}
}Project structure
swiss-apis-mcp/
├── src/
│ ├── index.ts # Server entry point — loads saved keys, registers all tools
│ └── tools/
│ ├── setup.ts # swiss_check_setup + swiss_set_api_key
│ ├── transport.ts # transport.opendata.ch + opentransportdata.swiss
│ ├── geo.ts # GeoAdmin REST + swisstopo REFRAME + height API
│ ├── health.ts # BAG/OFSP + Versorgungsatlas
│ ├── politics.ts # OpenParlData + Fedlex SPARQL
│ ├── business.ts # ZEFIX REST + opendata.swiss CKAN
│ ├── energy.ts # SFOE/BFE + Swissgrid
│ ├── weather.ts # MeteoSwiss OGD + SLF + BAFU hydro
│ ├── food.ts # FoodRepo (EPFL) + Swiss Food Composition DB
│ └── statistics.ts # BFS/OFS + SNB + OpenPLZ + SEM
├── tests/
│ ├── helpers/mock-server.ts
│ ├── *.test.ts # Unit tests (offline — axios mocked)
│ └── integration/
│ ├── helpers.ts
│ └── *.integration.test.ts # Integration tests (real HTTP calls)
├── .env.example
├── .gitignore
├── package.json
├── tsconfig.json
├── vitest.config.ts
└── vitest.integration.config.tsScripts
Command | Description |
| Start the MCP server via tsx (development) |
| Compile TypeScript to |
| Start compiled server ( |
| Open MCP Inspector UI at localhost:6274 |
| Run unit tests (fast, offline, no network) |
| Run integration tests (real API calls) |
| Run both |
| Unit tests with coverage report |
Adding a new tool
// src/tools/my_domain.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
import axios from "axios";
export function registerMyDomainTools(server: McpServer) {
server.tool(
"swiss_my_tool_name",
"Description shown to the AI agent — be precise about what data is returned.",
{
param1: z.string().describe("What this parameter does"),
},
async ({ param1 }) => {
const resp = await axios.get("https://api.swiss.ch/endpoint", {
params: { q: param1 },
});
return {
content: [{ type: "text", text: JSON.stringify(resp.data, null, 2) }],
};
}
);
}Then register in src/index.ts:
import { registerMyDomainTools } from "./tools/my_domain.js";
registerMyDomainTools(server);Resources
Licence
MIT — see LICENSE.
Available Tools
34 toolsswiss_avalanche_dataA
Get avalanche warning and snow data from SLF (Institute for Snow and Avalanche Research).
Inputs: query.
swiss_check_setupA
Check which optional API keys are configured. Call this first to know which Swiss API tools are fully operational and which need a free API key.
Inputs: no named parameters.
swiss_company_by_uidA
Get full details of a Swiss company by its UID (e.g. CHE-123.456.789). Requires ZEFIX credentials.
Inputs: uid (required).
swiss_company_publicationsB
Get Swiss Official Gazette (SOGC) publications for a company. Shows registration history, mergers, etc.
Inputs: uid (required).
swiss_company_searchA
Search Swiss companies in ZEFIX (official commercial register). Requires ZEFIX_USER and ZEFIX_PASS env vars (free account at zefix.admin.ch).
Inputs: name (required), canton, active_only, max_results.
swiss_energy_search_datasetsC
Search Swiss energy data from SFOE (Swiss Federal Office of Energy) — electricity production, renewables, consumption, EV charging stations.
Inputs: query (required), rows.
swiss_federal_law_searchB
Search Swiss federal legislation via Fedlex (official federal law publication platform).
Inputs: query (required).
swiss_food_nutrition_databaseB
Search the Swiss Food Composition Database (FSVO) — official nutritional values of foods available in Switzerland.
Inputs: query (required).
swiss_food_search_productsB
Search Swiss food products in FoodRepo (EPFL open database of barcoded Swiss food products). Requires FOODREPO_API_KEY.
Inputs: page, query, barcode.
swiss_geo_convert_coordinatesA
Convert coordinates between Swiss LV95 (CH1903+), LV03 (CH1903) and WGS84 using official swisstopo REFRAME service.
Inputs: coord1 (required), coord2 (required), to_system (required), from_system (required).
swiss_geo_find_layer_featuresB
Search features in a swisstopo map layer by text (streets, buildings, stations, etc.).
Inputs: layer (required), search_text (required), search_field (required), limit.
swiss_geo_get_elevationA
Get elevation (altitude in meters) for WGS84 coordinates anywhere in Switzerland using the official swisstopo REFRAME service.
Inputs: lat (required), lng (required).
swiss_geo_get_wmts_tile_urlB
Generate a swisstopo WMTS tile URL for map display (official Swiss national map).
Inputs: x (required), y (required), z (required), layer.
swiss_geo_identify_cantonC
Identify which Swiss canton a coordinate belongs to.
Inputs: lat (required), lng (required).
swiss_geo_identify_municipalityB
Identify which Swiss municipality (commune) a coordinate belongs to.
Inputs: lat (required), lng (required).
swiss_geo_search_locationB
Search for any Swiss location: cities, addresses, communes, postal codes, points of interest.
Inputs: query (required), sr, limit, types.
swiss_grid_energy_dataC
Get Swiss energy grid data from Swissgrid — actual electricity consumption, production mix, cross-border flows.
Inputs: query.
swiss_health_get_datasetB
Get direct download URLs and metadata for a specific BAG health dataset by its slug.
Inputs: dataset_slug (required).
swiss_health_get_versorgungsatlasB
Get Swiss Health Atlas (Versorgungsatlas) data — 100+ health indicators by canton. Powered by BAG + Swiss Health Observatory.
Inputs: indicator (required).
swiss_health_search_datasetsB
Search BAG (Federal Office of Public Health) datasets on opendata.swiss. Covers infectious diseases, hospitalizations, mortality, vaccination rates, etc.
Inputs: query (required), rows.
swiss_hydro_dataB
Get hydrological data — river levels, flow rates, flood forecasts from BAFU (Swiss Federal Office for the Environment).
Inputs: station_id.
swiss_migration_statisticsC
Get Swiss migration and population data from SEM (State Secretariat for Migration).
Inputs: query.
swiss_opendata_search_datasetsA
Search the opendata.swiss catalog — 14,000+ official Swiss government datasets. No auth required.
Inputs: query (required), rows, format, organization.
swiss_parliament_personsC
Get Swiss parliament members (councillors, deputies) with their parliamentary activity.
Inputs: limit, parliament.
swiss_parliament_searchA
Search Swiss parliamentary business (motions, postulates, votes) across 74+ cantonal and national parliaments via OpenParlData API.
Inputs: query (required), limit, parliament.
swiss_postal_dataB
Get Swiss postal codes, street names, and administrative divisions via OpenPLZ API. Free, no auth.
Inputs: canton, postal_code, municipality.
swiss_set_api_keyA
Store an optional API key so Swiss API tools that require it become fully operational. Keys are saved in ~/.swiss-apis-mcp/keys and take effect immediately — no server restart needed. Ask the user for the value before calling this tool.
Inputs: value (required), key_name (required).
swiss_snb_financial_dataC
Get Swiss National Bank (SNB) financial and monetary data — exchange rates, interest rates, balance sheets.
Inputs: query (required).
swiss_statistics_searchC
Search the Swiss Federal Statistical Office (BFS/OFS) datasets — population, economy, education, society.
Inputs: query (required), rows.
swiss_transport_connectionsB
Find train/bus connections between two Swiss locations. No API key needed.
Inputs: to (required), from (required), via, limit, +1 more.
swiss_transport_gtfs_realtimeC
Get real-time GTFS data from opentransportdata.swiss. Requires OTD_API_KEY env variable.
Inputs: feed_type (required).
swiss_transport_stationboardC
Get next departures from a Swiss public transport station. No API key needed.
Inputs: station (required), limit, transportations.
swiss_transport_station_searchB
Search for Swiss public transport stations by name or coordinates.
Inputs: lat, lon, limit, query.
swiss_weather_search_meteoswissC
Search MeteoSwiss (official Swiss meteorology) open datasets. MeteoSwiss opened its OGD since May 2025. Individual API queries planned for Q2 2026.
Inputs: query (required), rows.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 34 tools
Most tools have distinct domains (transport, geo, health, company, parliament) which make them easy to distinguish. However, there is meaningful overlap between swiss_health_search_datasets, swiss_opendata_search_datasets, and swiss_statistics_search — all search government open data catalogs and could confuse an agent about which to pick for a data search, though domain prefixes help. Similarly swiss_energy_search_datasets versus swiss_grid_energy_data have related but distinct purposes.
The naming pattern is consistent with the swiss_ prefix and mostly follows verb_noun (search_x, get_x, identify_x) conventions. Minor deviations include swiss_postal_data, swiss_migration_statistics, and swiss_avalanche_data which drop a verb, and swiss_grid_energy_data which lacks a verb. Overall the pattern is readable and predictable enough for an agent.
34 tools is on the heavy side, exceeding the typical 3-15 well-scoped range. However, the server deliberately aggregates many distinct Swiss APIs (transport, geo, health, parliament, law, company, energy, weather, food, statistics), each domain having a legitimate subset of tools, so the count is defensible but borders on overwhelming.
The surface is broad, covering many Swiss data domains, but individual domains are inconsistently deep — transport has search/stationboard/connections/gtfs (deep), while weather only has a search tool with actual queries 'planned for Q2 2026' (a dead end), and avalanche/hydro have single tools. Within domains there's no clear operation lifecycle (create/update/delete) since these are mostly read-only, which fits the data-sourcing purpose, but several tools (weather, grid) note future/limited data access.
Related MCP Connectors
Hosted MCP server for live public-data APIs and Skills for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server exposing the Backtest360 engine API as tools for AI agents.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseBqualityBmaintenanceSwiss open data MCP server — transport, weather, geodata, companies, etc,. Zero API keys.94431 npm28MIT
- AlicenseAqualityBmaintenanceMCP server connecting AI models to SRG SSR public APIs – weather, TV/radio metadata, program guide and Swiss votations/elections since 1900.1535 PyPI1MIT
- AlicenseAqualityBmaintenanceAn MCP server connecting AI models to the Swiss Federal Parliament via the Curia Vista OData API, enabling queries of motions, votes, members, sessions, and debate transcripts without authentication.754 PyPI2MIT
- AlicenseBqualityBmaintenanceAn MCP server providing AI-powered access to Open Data from the City of Zurich, enabling queries to 900+ datasets, real-time environmental and mobility data, geodata, parliamentary proceedings, and more.2666 PyPI9MIT