MCP server for Swiss Federal Office of Public Health (BAG) infectious disease surveillance โ IDD API
Project description
๐ฅ bag-health-mcp
Part of the Swiss Public Data MCP Portfolio โ connecting AI models to Swiss public data sources.
MCP server for the Swiss Federal Office of Public Health (BAG) Infectious Disease Dashboard (IDD). Access epidemiological surveillance data for 51 pathogens across Switzerland โ including influenza, COVID-19, measles, wastewater surveillance, and more.
๐ฏ What You Can Do
"Wie ist die aktuelle Grippesituation im Kanton Zรผrich verglichen mit den letzten Wochen?"
โ bag_health_mcp__get_canton_situation(canton="ZH")
"Gibt es aktuell einen Masernausbruch in der Schweiz?"
โ bag_health_mcp__get_disease_data(series_id="measles/cases/incValue/year", canton="all")
"Wie entwickelt sich das SARS-CoV-2-Signal im Abwasser?"
โ bag_health_mcp__list_series(topic="wastewater_viral_load")
โ bag_health_mcp__get_disease_data(series_id="wastewater_viral_load/NA/value/date", ...)
"Welche Krankheitsdaten stellt das BAG aktuell bereit?"
โ bag_health_mcp__list_diseases()
โ More use cases by audience โ
๐ง Tools
| Tool | Description |
|---|---|
bag_health_mcp__list_diseases |
List all 51 disease topics, grouped by category |
bag_health_mcp__list_series |
List data series for a specific disease |
bag_health_mcp__get_series_details |
Get available filter dimensions (canton, age, sex) |
bag_health_mcp__get_disease_data |
Fetch time-series surveillance data |
bag_health_mcp__get_canton_situation |
Situational overview for a canton (Schulamt use case) |
bag_health_mcp__list_export_files |
List available complete export datasets |
bag_health_mcp__download_export |
Download raw CSV/JSON export |
bag_health_mcp__get_data_version |
Current data version (updated every Wednesday) |
Tool annotations
All tools carry MCP tool annotations so a host can reason about them without calling. Every tool is identical here โ it only ever reads from the public BAG IDD API:
| Annotation | Value | Meaning |
|---|---|---|
readOnlyHint |
true |
No tool mutates any state. |
destructiveHint |
false |
No destructive side effects. |
idempotentHint |
true |
Repeating a call has no additional effect. |
openWorldHint |
true |
Tools reach an external system (the IDD API). |
A host may therefore treat all calls as safe, cacheable reads. The values are
declared once as READ_ONLY in server.py and applied to all 8 tools.
๐งฉ MCP Primitives
This server uses all three MCP primitives, each for what it is best at:
Tools (8) โ live, parameterised actions that call the IDD API (above).
Resources โ static, read-only reference data a host can fetch and cache, no arguments or upstream call needed:
| Resource URI | Description |
|---|---|
bag://reference/cantons |
Canton codes accepted by the tools (incl. FL, all) |
bag://reference/disease-categories |
Disease-topic taxonomy by category |
bag://reference/data-licence |
Source, attribution and licence terms |
Prompts โ reusable, parameterised workflows a host can surface (e.g. as slash-commands):
| Prompt | Arguments | Purpose |
|---|---|---|
canton_situation_brief |
canton |
Draft a Schulamt public-health situation brief |
outbreak_check |
disease, canton |
Check whether a disease is currently elevated |
Live surveillance data stays behind Tools (it is parameterised and changes weekly); fixed reference data is exposed as Resources; recommended multi-tool workflows are packaged as Prompts.
๐ซ Relevance for Schools & City Administration
Schulamt / Kreisschulbehรถrden:
- Monitor influenza and ARI incidence in your canton
- Single measles case โ alert for schools with low vaccination coverage
- Pertussis tracking โ protect unvaccinated infants (siblings of school children)
Stadtverwaltung / KI-Fachgruppe:
- Public Health Reporting with structured weekly data
- Wastewater surveillance as 1-week lead indicator before clinical cases
Synergy with portfolio:
bag-epl-mcpโ "What treatments are listed?" (EPL medication database)bag-health-mcpโ "What is currently spreading?" (surveillance data)
๐ก Data Source
- IDD API:
https://api.idd.bag.admin.chโ No authentication required - Update cycle: Every Wednesday
- Coverage: Switzerland + Liechtenstein (FL), 26 cantons
- Topics: 51 pathogens, 1386 data series
Datenquellen & Lizenzen / Data sources & licences
| Source | Provider | Licence | Attribution required |
|---|---|---|---|
| Infectious Disease Dashboard (IDD) | Federal Office of Public Health (FOPH / BAG) | opendata.swiss Open Government Data โ free use, source attribution required (Swiss OGD terms, CC BY-equivalent) | Yes |
Required citation: Federal Office of Public Health FOPH โ Infectious Disease
Dashboard (IDD), open data via opendata.swiss. Every tool response carries this
in a provenance block (attribution + license fields) so downstream
consumers can surface it automatically.
Architecture:
โโโโโโโโโโโโโโโโโโโ
MCP Host โ bag-health-mcp โ
(Claude, etc.) โโโถโ MCP SDK โโโโถ api.idd.bag.admin.ch
โ 8 Tools โ (IDD API, no auth)
โโโโโโโโโโโโโโโโโโโ
๐ Installation
Claude Desktop (stdio)
{
"mcpServers": {
"bag-health": {
"command": "uvx",
"args": ["bag-health-mcp"]
}
}
}
Cloud / HTTP
pip install bag-health-mcp
python -m bag_health_mcp.server --http --port 8000
Transport, host and port are set via environment variables โ MCP_TRANSPORT
(http/stdio), MCP_HOST, MCP_PORT โ which is the recommended way for
deployments (the --http flag still works for local use). The server binds to
127.0.0.1 by default so a local HTTP server is not exposed to the network.
Container/cloud deployments bind all interfaces by setting MCP_HOST=0.0.0.0
explicitly โ the provided Dockerfile does this.
โ ๏ธ Security: HTTP transport exposes the server on the network. Only bind beyond
127.0.0.1in a network-isolated environment โ never directly on a public/shared network. Binding to a non-localhost host logs a warning at startup. The default stdio transport has no network surface. Seedocs/security-posture.md.
HTTP auth (optional): set MCP_AUTH_TOKEN to require
Authorization: Bearer <token> on every HTTP request (401 otherwise). Unset =
no auth (fine for stdio/local). This gates who may invoke the server; for real
user identity, front it with a gateway.
CORS (browser clients): set MCP_CORS_ORIGINS to a comma-separated origin
allow-list to enable cross-origin browser access; the Mcp-Session-Id header is
exposed so stateful sessions work. Empty = no cross-origin (never a wildcard).
For running at scale (session affinity, resource limits, MCP gateway), see the
deployment & scaling guide and the reference
manifests in deploy/.
Logging: the server emits structured JSON logs (one object per line, with an
RFC 5424 severity) to stderr โ stdout is reserved for the stdio JSON-RPC
transport. Set the level with MCP_LOG_LEVEL (default INFO).
Tracing (optional): install the telemetry extra and point the server at an OTLP collector to get OpenTelemetry spans per tool-call plus instrumented outbound HTTP:
pip install "bag-health-mcp[telemetry]"
export OTEL_EXPORTER_OTLP_ENDPOINT="http://otel-collector:4318"
# optional: OTEL_SERVICE_NAME=bag-health-mcp
Tracing is a no-op unless both the extra is installed and an OTEL_*
endpoint is set. Spans carry only the tool name and (on error) the exception
class โ never tool arguments, cantons or surveillance data.
๐๏ธ Available Disease Topics
| Category | Topics |
|---|---|
| Respiratory | influenza, covid19, acute_respiratory_infection, respiratory_pathogens |
| Enteric | campylobacteriosis, salmonellosis, ehec, listeriosis, hepatitis_a/e |
| STI & Bloodborne | hiv, aids, syphilis, gonorrhea, hepatitis_b/c, chlamydiosis |
| Vaccine-preventable | measles, pertussis, rubella, tetanus, diphtheria, ipd, meningo |
| Vector-borne | lyme_borreliosis, tick-borne_encephalitis, dengue, malaria, zika |
| Wastewater | wastewater_viral_load, wastewater_sequencing |
๐ผ๏ธ Demo
Claude asking about the influenza situation in canton Zurich โ single tool call, structured result, actionable German-language summary.
๐ Safety & Limits
| Aspect | Details |
|---|---|
| Access | Read-only โ no write operations possible |
| Egress | Code-layer allow-list: the server only contacts the BAG IDD API, HTTPS-only, enforced on every request incl. redirect hops (SSRF/SEC-004 + SEC-021). Network-layer companion policy in deploy/networkpolicy.yaml |
| Personal data | None โ BAG IDD data is aggregated and anonymised at canton level by law |
| Rate limits | No published IDD API rate limit; server caps responses at 104 data points per call by default (limit_weeks param) |
| Timeout | 30 s per API call |
| Authentication | No API keys required โ all data publicly accessible |
| Data licence | opendata.swiss OGD โ free use, source attribution required (CC BY-equivalent). FOPH IDD must be cited; see Data sources & licences |
| Terms of Service | Subject to BAG IDD API ToS |
โ ๏ธ Known Limitations
- Beta API: IDD API is labelled
v0.1 betaโ schema may change without notice - Weekly cadence: Data is not real-time; updated Wednesdays only
- Canton granularity: Some rare diseases have insufficient cases for canton-level data (suppressed for privacy)
- Age groups: Available dimensions vary by disease series; use
bag_health_mcp__get_series_detailsto check
๐จ๐ญ Compliance
- ISDS (Stadt Zรผrich): a draft information-security protection-needs
classification (Schutzbedarfsanalyse per Grundwert + measures mapping) is in
docs/isds-klassifikation.md. It is a technically-grounded draft pending ISBO/OIZ sign-off โ not a binding classification. - Data classification (Schulamt): the data is classified รFFENTLICH / BUI
(public OGD, no personal data, aggregated at canton level with small cells
suppressed at source). Draft scheme + aggregation-risk note in
docs/datenklassifikation-schulamt.md; the aggregatingbag_health_mcp__get_canton_situationtool surfaces this in its response. - Security posture: lethal-trifecta assessment (the server is strictly
read-only โ not affected), secret-management decision (no secrets โ public
data), and network-exposure notes are in
docs/security-posture.md. - Phase architecture: this is a Phase 1 (read-only) server; write/send
capabilities are deferred behind documented prerequisites. See
docs/roadmap.md.
๐ License
Code: MIT (see LICENSE).
Data: BAG IDD is Open Government Data on opendata.swiss under free use with mandatory source attribution (Swiss OGD terms, CC BY-equivalent) โ not public domain. Cite the Federal Office of Public Health FOPH (IDD) when reusing the data; see Data sources & licences.
๐ Related Portfolio Servers
swiss-statistics-mcpโ BFS demographic databag-epl-mcpโ BAG medication reimbursement listzurich-opendata-mcpโ City of Zurich open data
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bag_health_mcp-0.2.0.tar.gz.
File metadata
- Download URL: bag_health_mcp-0.2.0.tar.gz
- Upload date:
- Size: 112.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eae829f4be361aad9467d769b6d8d0df6dccb012cd1bd68fb40f9d9b3214a8ab
|
|
| MD5 |
4b8256aee76886fb997edce3da92eaaa
|
|
| BLAKE2b-256 |
af84559bf043de40d63802bdb5ca9388f8092f607518d6ab40a53de923d78a8c
|
Provenance
The following attestation bundles were made for bag_health_mcp-0.2.0.tar.gz:
Publisher:
publish.yml on malkreide/bag-health-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bag_health_mcp-0.2.0.tar.gz -
Subject digest:
eae829f4be361aad9467d769b6d8d0df6dccb012cd1bd68fb40f9d9b3214a8ab - Sigstore transparency entry: 1683350181
- Sigstore integration time:
-
Permalink:
malkreide/bag-health-mcp@e8c1a018c078caa61eb003c9b483dacd9c45b167 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/malkreide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8c1a018c078caa61eb003c9b483dacd9c45b167 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bag_health_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: bag_health_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7e9ec403ca57f3e2ce779a11a3abcd8348c6a17627527d311cd402ae1724f42
|
|
| MD5 |
846959a86a0d63a9b1007a28c759e26e
|
|
| BLAKE2b-256 |
9a41854eab4d22ccb49800f5c691ba1c11a94eabf30482b50a58102029943372
|
Provenance
The following attestation bundles were made for bag_health_mcp-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on malkreide/bag-health-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bag_health_mcp-0.2.0-py3-none-any.whl -
Subject digest:
a7e9ec403ca57f3e2ce779a11a3abcd8348c6a17627527d311cd402ae1724f42 - Sigstore transparency entry: 1683350322
- Sigstore integration time:
-
Permalink:
malkreide/bag-health-mcp@e8c1a018c078caa61eb003c9b483dacd9c45b167 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/malkreide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8c1a018c078caa61eb003c9b483dacd9c45b167 -
Trigger Event:
release
-
Statement type: