bag-epl-mcp 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bag_epl_mcp-1.0.0/.github/workflows/ci.yml +36 -0
- bag_epl_mcp-1.0.0/.github/workflows/publish.yml +32 -0
- bag_epl_mcp-1.0.0/.gitignore +8 -0
- bag_epl_mcp-1.0.0/CONTRIBUTING.md +39 -0
- bag_epl_mcp-1.0.0/LICENSE +21 -0
- bag_epl_mcp-1.0.0/PKG-INFO +197 -0
- bag_epl_mcp-1.0.0/README.de.md +109 -0
- bag_epl_mcp-1.0.0/README.md +145 -0
- bag_epl_mcp-1.0.0/pyproject.toml +72 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v5
|
|
21
|
+
|
|
22
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
23
|
+
uses: actions/setup-python@v6
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
pip install -e ".[dev]"
|
|
31
|
+
|
|
32
|
+
- name: Lint with ruff
|
|
33
|
+
run: python -m ruff check src/ tests/
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: PYTHONPATH=src python -m pytest tests/ -m "not live" -v
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
publish:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
environment: pypi
|
|
14
|
+
permissions:
|
|
15
|
+
id-token: write
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v5
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v6
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.12"
|
|
24
|
+
|
|
25
|
+
- name: Install build tools
|
|
26
|
+
run: pip install build
|
|
27
|
+
|
|
28
|
+
- name: Build package
|
|
29
|
+
run: python -m build
|
|
30
|
+
|
|
31
|
+
- name: Publish to PyPI
|
|
32
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Contributing to bag-epl-mcp
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing! This server is part of the [swiss-public-data-mcp](https://github.com/malkreide/swiss-public-data-mcp) portfolio.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/malkreide/bag-epl-mcp
|
|
9
|
+
cd bag-epl-mcp
|
|
10
|
+
pip install -e ".[dev]"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Running Tests
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Unit tests only (no network):
|
|
17
|
+
PYTHONPATH=src pytest tests/ -m "not live" -v
|
|
18
|
+
|
|
19
|
+
# All tests including live API calls:
|
|
20
|
+
PYTHONPATH=src pytest tests/ -v
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Code Style
|
|
24
|
+
|
|
25
|
+
This project uses [ruff](https://docs.astral.sh/ruff/) for linting and formatting:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python -m ruff check src/ tests/
|
|
29
|
+
python -m ruff format src/ tests/
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Phase 2: FHIR API
|
|
33
|
+
|
|
34
|
+
When the BAG publishes its FHIR/IDMP API for the ePL, contributions updating the tools to use it are very welcome. The architecture is designed to make this upgrade minimal — see the `FHIR_BASE_URL` constant and the `_sl_website_suche` function in `server.py`.
|
|
35
|
+
|
|
36
|
+
## Reporting Issues
|
|
37
|
+
|
|
38
|
+
- Bug reports: [GitHub Issues](https://github.com/malkreide/bag-epl-mcp/issues)
|
|
39
|
+
- API changes: Open an issue if the BAG ePL API structure changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 malkreide
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bag-epl-mcp
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: MCP server for the Swiss BAG electronic benefits platform (ePL): SL, GGSL, MiGeL
|
|
5
|
+
Project-URL: Homepage, https://github.com/malkreide/bag-epl-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/malkreide/bag-epl-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/malkreide/bag-epl-mcp/issues
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2026 malkreide
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Keywords: bag,fhir,ggsl,krankenversicherung,mcp,migel,model-context-protocol,python,spezialitaetenliste,swiss-open-data
|
|
31
|
+
Classifier: Development Status :: 4 - Beta
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
33
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
39
|
+
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
40
|
+
Requires-Python: >=3.11
|
|
41
|
+
Requires-Dist: fastmcp>=2.0.0
|
|
42
|
+
Requires-Dist: httpx>=0.27.0
|
|
43
|
+
Requires-Dist: lxml>=5.0.0
|
|
44
|
+
Requires-Dist: openpyxl>=3.1.0
|
|
45
|
+
Requires-Dist: pydantic>=2.0.0
|
|
46
|
+
Provides-Extra: dev
|
|
47
|
+
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
|
|
48
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
49
|
+
Requires-Dist: respx>=0.21.0; extra == 'dev'
|
|
50
|
+
Requires-Dist: ruff>=0.6.0; extra == 'dev'
|
|
51
|
+
Description-Content-Type: text/markdown
|
|
52
|
+
|
|
53
|
+
# bag-epl-mcp
|
|
54
|
+
|
|
55
|
+
[](https://github.com/malkreide/bag-epl-mcp/actions/workflows/ci.yml)
|
|
56
|
+
[](https://pypi.org/project/bag-epl-mcp/)
|
|
57
|
+
[](https://pypi.org/project/bag-epl-mcp/)
|
|
58
|
+
[](LICENSE)
|
|
59
|
+
[](https://github.com/malkreide/swiss-public-data-mcp)
|
|
60
|
+
|
|
61
|
+
**MCP server for the Swiss Federal Office of Public Health (BAG) electronic benefits platform (ePL).**
|
|
62
|
+
|
|
63
|
+
Enables AI models to answer questions about mandatory health insurance coverage in Switzerland — in natural language, grounded in real data.
|
|
64
|
+
|
|
65
|
+
> **Anchor query:** *"Is this medication covered by mandatory health insurance?"*
|
|
66
|
+
> → `epl_sl_suche`: Live lookup in the Spezialitätenliste (SL)
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## What is the ePL?
|
|
71
|
+
|
|
72
|
+
The **elektronische Plattform Leistungen (ePL)** is the BAG's new platform for three key lists of the Swiss healthcare system:
|
|
73
|
+
|
|
74
|
+
| List | Purpose | Legal basis |
|
|
75
|
+
|------|---------|-------------|
|
|
76
|
+
| **Spezialitätenliste (SL)** | Compulsory-insurance medications | KVG Art. 52 |
|
|
77
|
+
| **Geburtsgebrechen-Spezialitätenliste (GGSL)** | Medications for congenital disorders (IV) | IVG Anhang |
|
|
78
|
+
| **Mittel- und Gegenständeliste (MiGeL)** | Medical devices & aids | KLV Art. 20 |
|
|
79
|
+
|
|
80
|
+
## Tools
|
|
81
|
+
|
|
82
|
+
| Tool | Description |
|
|
83
|
+
|------|-------------|
|
|
84
|
+
| `epl_sl_suche` | Search the Spezialitätenliste for a medication |
|
|
85
|
+
| `epl_ggsl_abfrage` | Check GGSL coverage for congenital disorders |
|
|
86
|
+
| `epl_migel_suche` | Search the MiGeL for medical devices |
|
|
87
|
+
| `epl_gesuchseingaenge` | List pending SL admission requests (transparency) |
|
|
88
|
+
| `epl_rechtskontext` | Legal context for coverage questions (WZW criteria) |
|
|
89
|
+
| `epl_server_info` | Server status and API phase information |
|
|
90
|
+
|
|
91
|
+
## Architecture: Three-Phase Design
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Phase 1 (current) → XML/XLSX downloads + SL website access
|
|
95
|
+
Phase 2 (planned) → FHIR/IDMP API (BAG, ~2025/2026)
|
|
96
|
+
Phase 3 (vision) → MiGeL + AL via ePL-FHIR (2026/2027)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The server is **already useful today** and will seamlessly upgrade when the BAG publishes its FHIR API.
|
|
100
|
+
|
|
101
|
+
## Portfolio Synergies
|
|
102
|
+
|
|
103
|
+
| Combination | Value | Rating |
|
|
104
|
+
|-------------|-------|--------|
|
|
105
|
+
| `bag-epl-mcp` + `fedlex-mcp` | Legal context loop: statute → concrete list | ⭐⭐⭐ |
|
|
106
|
+
| `bag-epl-mcp` + `swiss-statistics-mcp` | Healthcare cost analysis | ⭐⭐ |
|
|
107
|
+
| `bag-epl-mcp` + `global-education-mcp` | OECD special needs benchmarking | ⭐ |
|
|
108
|
+
|
|
109
|
+
**The compliance loop** (strongest combination with `fedlex-mcp`):
|
|
110
|
+
1. *"Must this service be covered?"* → `epl_rechtskontext` → KVG/KLV norms
|
|
111
|
+
2. *"What does the law say?"* → `fedlex-mcp` → exact legal text
|
|
112
|
+
3. *"Is it actually on the list?"* → `epl_sl_suche` → live SL check
|
|
113
|
+
|
|
114
|
+
## Installation
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pip install bag-epl-mcp
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Usage with Claude Desktop
|
|
121
|
+
|
|
122
|
+
Add to `claude_desktop_config.json`:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"mcpServers": {
|
|
127
|
+
"bag-epl-mcp": {
|
|
128
|
+
"command": "uvx",
|
|
129
|
+
"args": ["bag-epl-mcp"]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Usage with Streamable HTTP (Cloud/Render.com)
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
MCP_TRANSPORT=streamable_http MCP_PORT=8000 bag-epl-mcp
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Example Queries
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
# School health service use case:
|
|
145
|
+
"Is Methylphenidate (Ritalin) covered by mandatory health insurance?"
|
|
146
|
+
→ epl_sl_suche: suchbegriff="Methylphenidat"
|
|
147
|
+
|
|
148
|
+
# Special needs education:
|
|
149
|
+
"Which medications are covered for children with congenital disorder GG-313 (diabetes)?"
|
|
150
|
+
→ epl_ggsl_abfrage: geburtsgebrechen_nr="313"
|
|
151
|
+
|
|
152
|
+
# Legal compliance:
|
|
153
|
+
"Which laws regulate admission to the Spezialitätenliste?"
|
|
154
|
+
→ epl_rechtskontext: frage="Welche Gesetze regeln die Aufnahme in die SL?"
|
|
155
|
+
|
|
156
|
+
# Medical devices for inclusive schools:
|
|
157
|
+
"Is a wheelchair covered by mandatory health insurance?"
|
|
158
|
+
→ epl_migel_suche: suchbegriff="Rollstuhl"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Context: Schulamt der Stadt Zürich
|
|
162
|
+
|
|
163
|
+
This server is particularly relevant for the school system:
|
|
164
|
+
|
|
165
|
+
- **School health service**: Check if a pupil's medication is covered before advising families
|
|
166
|
+
- **Special needs support**: GGSL coverage for pupils with congenital disorders
|
|
167
|
+
- **Inclusive education**: MiGeL coverage for assistive devices
|
|
168
|
+
- **HR / Stadtentwicklung**: Benefits questions for city employees
|
|
169
|
+
|
|
170
|
+
## Known Limitations
|
|
171
|
+
|
|
172
|
+
- **Phase 1 limitation**: The ePL internal API is not publicly documented. The SL website (sl.bag.admin.ch) is an Angular SPA with a private backend. Direct medication search may return no results until the BAG publishes its FHIR API.
|
|
173
|
+
- **Fallback**: All tools provide direct links to sl.bag.admin.ch for manual searches.
|
|
174
|
+
- **MiGeL**: Not yet integrated in ePL (planned 2026/2027); MiGeL tools use category matching.
|
|
175
|
+
|
|
176
|
+
## Testing
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Unit tests (no live API calls):
|
|
180
|
+
PYTHONPATH=src pytest tests/ -m "not live" -v
|
|
181
|
+
|
|
182
|
+
# Live tests (requires network):
|
|
183
|
+
PYTHONPATH=src pytest tests/ -m "live" -v
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Legal Notices
|
|
187
|
+
|
|
188
|
+
Data sources:
|
|
189
|
+
- [Spezialitätenliste (SL)](https://sl.bag.admin.ch) — Bundesamt für Gesundheit (BAG)
|
|
190
|
+
- [KVG SR 832.10](https://www.fedlex.admin.ch/eli/cc/1995/1328_1328_1328/de)
|
|
191
|
+
- [KLV SR 832.112.31](https://www.fedlex.admin.ch/eli/cc/1995/4964_4964_4964/de)
|
|
192
|
+
|
|
193
|
+
This server provides informational access only. For medical or legal decisions, always consult the official BAG sources directly.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
Part of the [swiss-public-data-mcp](https://github.com/malkreide/swiss-public-data-mcp) portfolio.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# bag-epl-mcp
|
|
2
|
+
|
|
3
|
+
[](https://github.com/malkreide/bag-epl-mcp/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/bag-epl-mcp/)
|
|
5
|
+
[](https://github.com/malkreide/swiss-public-data-mcp)
|
|
6
|
+
|
|
7
|
+
**MCP-Server für die elektronische Plattform Leistungen (ePL) des Bundesamts für Gesundheit (BAG).**
|
|
8
|
+
|
|
9
|
+
Ermöglicht KI-Modellen, Fragen zur obligatorischen Krankenpflegeversicherung in natürlicher Sprache zu beantworten — verankert in echten Daten.
|
|
10
|
+
|
|
11
|
+
> **Anker-Abfrage:** *«Ist dieses Medikament kassenpflichtig?»*
|
|
12
|
+
> → `epl_sl_suche`: Direktabfrage in der Spezialitätenliste (SL)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Was ist die ePL?
|
|
17
|
+
|
|
18
|
+
Die **elektronische Plattform Leistungen (ePL)** ist die neue Plattform des BAG für drei Schlüssellisten des Schweizer Gesundheitssystems:
|
|
19
|
+
|
|
20
|
+
| Liste | Zweck | Rechtsgrundlage |
|
|
21
|
+
|-------|-------|-----------------|
|
|
22
|
+
| **Spezialitätenliste (SL)** | Kassenpflichtige Medikamente | KVG Art. 52 |
|
|
23
|
+
| **Geburtsgebrechen-Spezialitätenliste (GGSL)** | Medikamente bei Geburtsgebrechen (IV) | IVG Anhang |
|
|
24
|
+
| **Mittel- und Gegenständeliste (MiGeL)** | Medizinprodukte und Hilfsmittel | KLV Art. 20 |
|
|
25
|
+
|
|
26
|
+
## Tools
|
|
27
|
+
|
|
28
|
+
| Tool | Beschreibung |
|
|
29
|
+
|------|-------------|
|
|
30
|
+
| `epl_sl_suche` | Kassenpflichtige Medikamente in der SL suchen |
|
|
31
|
+
| `epl_ggsl_abfrage` | GGSL-Deckung bei Geburtsgebrechen prüfen |
|
|
32
|
+
| `epl_migel_suche` | Medizinprodukte in der MiGeL suchen |
|
|
33
|
+
| `epl_gesuchseingaenge` | Transparenzliste SL-Neuaufnahmen abrufen |
|
|
34
|
+
| `epl_rechtskontext` | Rechtliche Grundlagen zur Kassenpflicht (WZW) |
|
|
35
|
+
| `epl_server_info` | Serverstatus und API-Phaseninfo |
|
|
36
|
+
|
|
37
|
+
## Architektur: Drei-Phasen-Design
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Phase 1 (aktuell) → XML/XLSX-Downloads + SL-Website-Zugriff
|
|
41
|
+
Phase 2 (geplant) → FHIR/IDMP-API (BAG, ~2025/2026)
|
|
42
|
+
Phase 3 (Vision) → MiGeL + AL via ePL-FHIR (2026/2027)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Gleise bauen, bevor der Zug kommt:** Der Server ist heute nutzbar und upgradet nahtlos, sobald das BAG seine FHIR-API publiziert.
|
|
46
|
+
|
|
47
|
+
## Portfolio-Synergien
|
|
48
|
+
|
|
49
|
+
| Kombination | Mehrwert | Bewertung |
|
|
50
|
+
|-------------|---------|-----------|
|
|
51
|
+
| `bag-epl-mcp` + `fedlex-mcp` | Rechtskontext-Loop: Gesetz → konkrete Liste | ⭐⭐⭐ |
|
|
52
|
+
| `bag-epl-mcp` + `swiss-statistics-mcp` | Gesundheitskosten-Analyse | ⭐⭐ |
|
|
53
|
+
| `bag-epl-mcp` + `global-education-mcp` | OECD Sonderpädagogik-Benchmarking | ⭐ |
|
|
54
|
+
|
|
55
|
+
**Der Compliance-Loop** (stärkste Kombination mit `fedlex-mcp`):
|
|
56
|
+
1. *«Muss diese Leistung gedeckt sein?»* → `epl_rechtskontext` → KVG/KLV-Normen
|
|
57
|
+
2. *«Was sagt das Gesetz genau?»* → `fedlex-mcp` → Gesetzestext
|
|
58
|
+
3. *«Ist es tatsächlich auf der Liste?»* → `epl_sl_suche` → Live-SL-Prüfung
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install bag-epl-mcp
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Verwendung mit Claude Desktop
|
|
67
|
+
|
|
68
|
+
In `claude_desktop_config.json` eintragen:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"bag-epl-mcp": {
|
|
74
|
+
"command": "uvx",
|
|
75
|
+
"args": ["bag-epl-mcp"]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Beispielabfragen
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
# Schulgesundheitsdienst:
|
|
85
|
+
«Ist Methylphenidat (Ritalin) kassenpflichtig?»
|
|
86
|
+
→ epl_sl_suche: suchbegriff="Methylphenidat"
|
|
87
|
+
|
|
88
|
+
# Sonderpädagogik:
|
|
89
|
+
«Welche Medikamente sind bei GG-Nr. 313 (Diabetes) gedeckt?»
|
|
90
|
+
→ epl_ggsl_abfrage: geburtsgebrechen_nr="313"
|
|
91
|
+
|
|
92
|
+
# Rechtliche Compliance:
|
|
93
|
+
«Welche Gesetze regeln die Aufnahme in die Spezialitätenliste?»
|
|
94
|
+
→ epl_rechtskontext: frage="Welche Gesetze regeln die Aufnahme in die SL?"
|
|
95
|
+
|
|
96
|
+
# Inklusionsschule:
|
|
97
|
+
«Ist ein Rollstuhl über die Grundversicherung gedeckt?»
|
|
98
|
+
→ epl_migel_suche: suchbegriff="Rollstuhl"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Bekannte Einschränkungen
|
|
102
|
+
|
|
103
|
+
- **Phase-1-Limitation**: Die interne ePL-API ist nicht öffentlich dokumentiert. Die SL-Website (sl.bag.admin.ch) ist eine Angular-SPA mit privatem Backend. Direkte Medikamentensuche kann leer zurückkehren, bis das BAG seine FHIR-API veröffentlicht.
|
|
104
|
+
- **Fallback**: Alle Tools liefern direkte Links zu sl.bag.admin.ch für manuelle Suchen.
|
|
105
|
+
- **MiGeL**: Noch nicht in ePL integriert (geplant 2026/2027).
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
Teil des [swiss-public-data-mcp](https://github.com/malkreide/swiss-public-data-mcp)-Portfolios.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# bag-epl-mcp
|
|
2
|
+
|
|
3
|
+
[](https://github.com/malkreide/bag-epl-mcp/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/bag-epl-mcp/)
|
|
5
|
+
[](https://pypi.org/project/bag-epl-mcp/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com/malkreide/swiss-public-data-mcp)
|
|
8
|
+
|
|
9
|
+
**MCP server for the Swiss Federal Office of Public Health (BAG) electronic benefits platform (ePL).**
|
|
10
|
+
|
|
11
|
+
Enables AI models to answer questions about mandatory health insurance coverage in Switzerland — in natural language, grounded in real data.
|
|
12
|
+
|
|
13
|
+
> **Anchor query:** *"Is this medication covered by mandatory health insurance?"*
|
|
14
|
+
> → `epl_sl_suche`: Live lookup in the Spezialitätenliste (SL)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## What is the ePL?
|
|
19
|
+
|
|
20
|
+
The **elektronische Plattform Leistungen (ePL)** is the BAG's new platform for three key lists of the Swiss healthcare system:
|
|
21
|
+
|
|
22
|
+
| List | Purpose | Legal basis |
|
|
23
|
+
|------|---------|-------------|
|
|
24
|
+
| **Spezialitätenliste (SL)** | Compulsory-insurance medications | KVG Art. 52 |
|
|
25
|
+
| **Geburtsgebrechen-Spezialitätenliste (GGSL)** | Medications for congenital disorders (IV) | IVG Anhang |
|
|
26
|
+
| **Mittel- und Gegenständeliste (MiGeL)** | Medical devices & aids | KLV Art. 20 |
|
|
27
|
+
|
|
28
|
+
## Tools
|
|
29
|
+
|
|
30
|
+
| Tool | Description |
|
|
31
|
+
|------|-------------|
|
|
32
|
+
| `epl_sl_suche` | Search the Spezialitätenliste for a medication |
|
|
33
|
+
| `epl_ggsl_abfrage` | Check GGSL coverage for congenital disorders |
|
|
34
|
+
| `epl_migel_suche` | Search the MiGeL for medical devices |
|
|
35
|
+
| `epl_gesuchseingaenge` | List pending SL admission requests (transparency) |
|
|
36
|
+
| `epl_rechtskontext` | Legal context for coverage questions (WZW criteria) |
|
|
37
|
+
| `epl_server_info` | Server status and API phase information |
|
|
38
|
+
|
|
39
|
+
## Architecture: Three-Phase Design
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Phase 1 (current) → XML/XLSX downloads + SL website access
|
|
43
|
+
Phase 2 (planned) → FHIR/IDMP API (BAG, ~2025/2026)
|
|
44
|
+
Phase 3 (vision) → MiGeL + AL via ePL-FHIR (2026/2027)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The server is **already useful today** and will seamlessly upgrade when the BAG publishes its FHIR API.
|
|
48
|
+
|
|
49
|
+
## Portfolio Synergies
|
|
50
|
+
|
|
51
|
+
| Combination | Value | Rating |
|
|
52
|
+
|-------------|-------|--------|
|
|
53
|
+
| `bag-epl-mcp` + `fedlex-mcp` | Legal context loop: statute → concrete list | ⭐⭐⭐ |
|
|
54
|
+
| `bag-epl-mcp` + `swiss-statistics-mcp` | Healthcare cost analysis | ⭐⭐ |
|
|
55
|
+
| `bag-epl-mcp` + `global-education-mcp` | OECD special needs benchmarking | ⭐ |
|
|
56
|
+
|
|
57
|
+
**The compliance loop** (strongest combination with `fedlex-mcp`):
|
|
58
|
+
1. *"Must this service be covered?"* → `epl_rechtskontext` → KVG/KLV norms
|
|
59
|
+
2. *"What does the law say?"* → `fedlex-mcp` → exact legal text
|
|
60
|
+
3. *"Is it actually on the list?"* → `epl_sl_suche` → live SL check
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install bag-epl-mcp
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage with Claude Desktop
|
|
69
|
+
|
|
70
|
+
Add to `claude_desktop_config.json`:
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"mcpServers": {
|
|
75
|
+
"bag-epl-mcp": {
|
|
76
|
+
"command": "uvx",
|
|
77
|
+
"args": ["bag-epl-mcp"]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Usage with Streamable HTTP (Cloud/Render.com)
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
MCP_TRANSPORT=streamable_http MCP_PORT=8000 bag-epl-mcp
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Example Queries
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
# School health service use case:
|
|
93
|
+
"Is Methylphenidate (Ritalin) covered by mandatory health insurance?"
|
|
94
|
+
→ epl_sl_suche: suchbegriff="Methylphenidat"
|
|
95
|
+
|
|
96
|
+
# Special needs education:
|
|
97
|
+
"Which medications are covered for children with congenital disorder GG-313 (diabetes)?"
|
|
98
|
+
→ epl_ggsl_abfrage: geburtsgebrechen_nr="313"
|
|
99
|
+
|
|
100
|
+
# Legal compliance:
|
|
101
|
+
"Which laws regulate admission to the Spezialitätenliste?"
|
|
102
|
+
→ epl_rechtskontext: frage="Welche Gesetze regeln die Aufnahme in die SL?"
|
|
103
|
+
|
|
104
|
+
# Medical devices for inclusive schools:
|
|
105
|
+
"Is a wheelchair covered by mandatory health insurance?"
|
|
106
|
+
→ epl_migel_suche: suchbegriff="Rollstuhl"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Context: Schulamt der Stadt Zürich
|
|
110
|
+
|
|
111
|
+
This server is particularly relevant for the school system:
|
|
112
|
+
|
|
113
|
+
- **School health service**: Check if a pupil's medication is covered before advising families
|
|
114
|
+
- **Special needs support**: GGSL coverage for pupils with congenital disorders
|
|
115
|
+
- **Inclusive education**: MiGeL coverage for assistive devices
|
|
116
|
+
- **HR / Stadtentwicklung**: Benefits questions for city employees
|
|
117
|
+
|
|
118
|
+
## Known Limitations
|
|
119
|
+
|
|
120
|
+
- **Phase 1 limitation**: The ePL internal API is not publicly documented. The SL website (sl.bag.admin.ch) is an Angular SPA with a private backend. Direct medication search may return no results until the BAG publishes its FHIR API.
|
|
121
|
+
- **Fallback**: All tools provide direct links to sl.bag.admin.ch for manual searches.
|
|
122
|
+
- **MiGeL**: Not yet integrated in ePL (planned 2026/2027); MiGeL tools use category matching.
|
|
123
|
+
|
|
124
|
+
## Testing
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Unit tests (no live API calls):
|
|
128
|
+
PYTHONPATH=src pytest tests/ -m "not live" -v
|
|
129
|
+
|
|
130
|
+
# Live tests (requires network):
|
|
131
|
+
PYTHONPATH=src pytest tests/ -m "live" -v
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Legal Notices
|
|
135
|
+
|
|
136
|
+
Data sources:
|
|
137
|
+
- [Spezialitätenliste (SL)](https://sl.bag.admin.ch) — Bundesamt für Gesundheit (BAG)
|
|
138
|
+
- [KVG SR 832.10](https://www.fedlex.admin.ch/eli/cc/1995/1328_1328_1328/de)
|
|
139
|
+
- [KLV SR 832.112.31](https://www.fedlex.admin.ch/eli/cc/1995/4964_4964_4964/de)
|
|
140
|
+
|
|
141
|
+
This server provides informational access only. For medical or legal decisions, always consult the official BAG sources directly.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
Part of the [swiss-public-data-mcp](https://github.com/malkreide/swiss-public-data-mcp) portfolio.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "bag-epl-mcp"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "MCP server for the Swiss BAG electronic benefits platform (ePL): SL, GGSL, MiGeL"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
keywords = [
|
|
13
|
+
"mcp",
|
|
14
|
+
"model-context-protocol",
|
|
15
|
+
"swiss-open-data",
|
|
16
|
+
"bag",
|
|
17
|
+
"spezialitaetenliste",
|
|
18
|
+
"ggsl",
|
|
19
|
+
"migel",
|
|
20
|
+
"fhir",
|
|
21
|
+
"krankenversicherung",
|
|
22
|
+
"python",
|
|
23
|
+
]
|
|
24
|
+
classifiers = [
|
|
25
|
+
"Development Status :: 4 - Beta",
|
|
26
|
+
"Intended Audience :: Developers",
|
|
27
|
+
"Intended Audience :: Healthcare Industry",
|
|
28
|
+
"License :: OSI Approved :: MIT License",
|
|
29
|
+
"Programming Language :: Python :: 3",
|
|
30
|
+
"Programming Language :: Python :: 3.11",
|
|
31
|
+
"Programming Language :: Python :: 3.12",
|
|
32
|
+
"Programming Language :: Python :: 3.13",
|
|
33
|
+
"Topic :: Scientific/Engineering :: Medical Science Apps.",
|
|
34
|
+
]
|
|
35
|
+
dependencies = [
|
|
36
|
+
"fastmcp>=2.0.0",
|
|
37
|
+
"httpx>=0.27.0",
|
|
38
|
+
"pydantic>=2.0.0",
|
|
39
|
+
"openpyxl>=3.1.0",
|
|
40
|
+
"lxml>=5.0.0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.optional-dependencies]
|
|
44
|
+
dev = [
|
|
45
|
+
"pytest>=8.0.0",
|
|
46
|
+
"pytest-asyncio>=0.24.0",
|
|
47
|
+
"respx>=0.21.0",
|
|
48
|
+
"ruff>=0.6.0",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[project.scripts]
|
|
52
|
+
bag-epl-mcp = "bag_epl_mcp.server:main"
|
|
53
|
+
|
|
54
|
+
[project.urls]
|
|
55
|
+
Homepage = "https://github.com/malkreide/bag-epl-mcp"
|
|
56
|
+
Repository = "https://github.com/malkreide/bag-epl-mcp"
|
|
57
|
+
Issues = "https://github.com/malkreide/bag-epl-mcp/issues"
|
|
58
|
+
|
|
59
|
+
[tool.hatch.build.targets.wheel]
|
|
60
|
+
packages = ["src/bag_epl_mcp"]
|
|
61
|
+
|
|
62
|
+
[tool.ruff]
|
|
63
|
+
line-length = 100
|
|
64
|
+
target-version = "py311"
|
|
65
|
+
|
|
66
|
+
[tool.ruff.lint]
|
|
67
|
+
select = ["E", "F", "I", "UP", "B", "SIM"]
|
|
68
|
+
ignore = ["E501"]
|
|
69
|
+
|
|
70
|
+
[tool.pytest.ini_options]
|
|
71
|
+
testpaths = ["tests"]
|
|
72
|
+
markers = ["live: marks tests that call live APIs (deselect with '-m not live')"]
|