Skip to main content

MCP Server for Swiss Federal Food Safety and Veterinary Office (BLV) open data โ€” no auth required

Project description

๐Ÿ‡จ๐Ÿ‡ญ Part of the Swiss Public Data MCP Portfolio

swiss-food-safety-mcp

Version License: MIT Python 3.11+ MCP Data Source No Auth Required CI

MCP server connecting AI models to Swiss Federal Food Safety and Veterinary Office (BLV) open data โ€” food recalls, animal disease surveillance, food control results, antibiotic usage, children's nutrition surveys and the pesticide register. No authentication required.

๐Ÿ‡ฉ๐Ÿ‡ช Deutsche Version


Overview

swiss-food-safety-mcp gives AI assistants like Claude direct access to official Swiss food safety and veterinary data from the Federal Food Safety and Veterinary Office (BLV / Bundesamt fรผr Lebensmittelsicherheit und Veterinรคrwesen). It provides 11 tools covering food recalls, animal disease surveillance, food control results, antibiotic usage in veterinary medicine, nutrition surveys for children, and the pesticide register.

All data comes from official Swiss federal sources (opendata.swiss, lindas.admin.ch, news.admin.ch). No API keys or authentication are required.

This server follows the No-Auth-First philosophy and is part of a Swiss public sector MCP portfolio.

Anchor demo query: "Are there any current BLV food warnings relevant to Zurich school canteens โ€” and which notifiable animal diseases are currently reported in the canton?"

Demo

Demo: Claude using blv_get_public_warnings and blv_search_animal_diseases โ†’ More use cases by audience โ†’


Features

  • ๐Ÿšจ Public warnings & recalls โ€” Live RSS feed of BLV product recalls and health warnings
  • ๐Ÿ„ Animal disease surveillance โ€” Notifiable animal diseases since 1991 (InfoSM) via SPARQL + CSV
  • ๐Ÿฆ Avian influenza monitoring โ€” Wild bird surveillance data with geodata
  • ๐Ÿฅฉ Food control results โ€” Cantonal food inspection results and violation rates
  • ๐Ÿ’Š Antibiotic usage veterinary โ€” ISABV data on antibiotic use in animal medicine
  • ๐Ÿง’ Children's nutrition survey โ€” menuCH-Kids national nutritional survey data
  • ๐ŸŒฟ Pesticide register โ€” Swiss approved pesticide products and active ingredients
  • ๐Ÿ“Š Dataset discovery โ€” Browse all 28 BLV datasets on opendata.swiss via CKAN API
  • ๐Ÿ”— Dual transport โ€” stdio (Claude Desktop) + Streamable HTTP (cloud/Render.com)
  • ๐Ÿ—ฃ๏ธ Bilingual โ€” German-first documentation, English secondary

Prerequisites

  • Python 3.11+
  • uv or uvx (recommended) โ€” install uv

Installation

Using uvx (recommended โ€” no install needed)

uvx swiss-food-safety-mcp

Using uv

uv tool install swiss-food-safety-mcp
swiss-food-safety-mcp

From source

git clone https://github.com/malkreide/swiss-food-safety-mcp
cd swiss-food-safety-mcp
uv sync
uv run swiss-food-safety-mcp

Quickstart

Add to claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "swiss-food-safety": {
      "command": "uvx",
      "args": ["swiss-food-safety-mcp"]
    }
  }
}

Try it immediately in Claude Desktop:

"Which BLV food warnings are currently active?"
"Are there any notifiable animal diseases reported in Zurich canton this year?"

Other MCP Clients (Cursor, Windsurf, VS Code + Continue)

{
  "mcpServers": {
    "swiss-food-safety": {
      "command": "uvx",
      "args": ["swiss-food-safety-mcp"]
    }
  }
}

Cloud Deployment (Streamable HTTP)

For use via claude.ai in the browser (e.g. on managed workstations without local software):

# Loopback only (default) โ€” safe for local testing:
swiss-food-safety-mcp --http
# Server runs on 127.0.0.1:8002

# External exposure (e.g. behind the Render TLS proxy):
swiss-food-safety-mcp --http --host 0.0.0.0

โš ๏ธ The HTTP transport binds to 127.0.0.1 by default. Pass --host 0.0.0.0 only when external exposure is intended. Set BLV_MCP_ALLOWED_ORIGINS (comma-separated, no wildcard) to permit browser clients; it defaults to https://claude.ai.

Render.com (recommended):

  1. Push/fork the repository to GitHub
  2. On render.com: New Web Service โ†’ connect GitHub repo
  3. Set the start command to: swiss-food-safety-mcp --http --host 0.0.0.0
  4. In claude.ai under Settings โ†’ MCP Servers, add: https://your-app.onrender.com/mcp

Docker:

docker build -t swiss-food-safety-mcp .
docker run -p 8002:8002 swiss-food-safety-mcp
# or, with explicit CPU/memory limits:
docker compose up

The image is a non-root, multi-stage build; the container already binds 0.0.0.0 and includes a healthcheck. docker-compose.yml additionally caps CPU and memory.

๐Ÿ’ก "stdio for the developer laptop, Streamable HTTP for the browser."

๐Ÿ”ง Configuration โ€” every runtime setting is overridable via BLV_MCP_* environment variables (BLV_MCP_HTTP_HOST, BLV_MCP_HTTP_PORT, BLV_MCP_ALLOWED_ORIGINS, BLV_MCP_TIMEOUT, BLV_MCP_OTEL_ENDPOINT, โ€ฆ). Outbound requests are restricted to Swiss federal hosts (*.admin.ch, opendata.swiss). Optional OpenTelemetry tracing: install with pip install swiss-food-safety-mcp[otel] and set BLV_MCP_OTEL_ENDPOINT.


Available Tools

Tool Description Data Source
blv_get_public_warnings Current food recalls & health warnings news.admin.ch RSS
blv_list_datasets Browse all 28 BLV open datasets opendata.swiss CKAN
blv_get_dataset_info Dataset details & resource URLs opendata.swiss CKAN
blv_search_animal_diseases Notifiable animal diseases since 1991 SPARQL / CSV fallback
blv_get_animal_health_stats Annual animal health statistics opendata.swiss CSV/JSON
blv_get_food_control_results Cantonal food inspection results opendata.swiss CSV
blv_get_antibiotic_usage_vet Veterinary antibiotic usage (ISABV) opendata.swiss CSV
blv_get_avian_influenza Wild bird avian influenza surveillance opendata.swiss JSON/KML
blv_get_nutrition_data_children Children's nutrition survey (menuCH-Kids) opendata.swiss CSV
blv_search_pesticide_products Swiss approved pesticide register opendata.swiss XML
blv_get_meat_inspection_stats Slaughterhouse inspection statistics opendata.swiss CSV/JSON

Example Queries

Query Tool
"Which BLV food warnings are currently active?" blv_get_public_warnings
"Are there animal diseases in Zurich canton in 2024?" blv_search_animal_diseases
"What is the avian influenza situation in Switzerland 2024?" blv_get_avian_influenza
"What do Swiss children actually eat?" blv_get_nutrition_data_children
"Which copper-based pesticides are approved in Switzerland?" blv_search_pesticide_products

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Claude / AI   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Swiss Food Safety MCP     โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Swiss Federal Open Data     โ”‚
โ”‚   (MCP Host)    โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚   (MCP Server)              โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚                             โ”‚     โ”‚  opendata.swiss (CKAN/CSV)   โ”‚
                        โ”‚  11 Tools ยท No Auth         โ”‚     โ”‚  lindas.admin.ch (SPARQL)    โ”‚
                        โ”‚  Stdio | Streamable HTTP    โ”‚     โ”‚  news.admin.ch (RSS/XML)     โ”‚
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Synergies with Related MCP Servers

Combination Use Case
swiss-food-safety-mcp + zurich-opendata-mcp Geo-mapped animal disease risk near school locations
swiss-food-safety-mcp + fedlex-mcp Link recalls to food law (Lebensmittelgesetz)
swiss-food-safety-mcp + swiss-statistics-mcp Nutrition data ร— socioeconomics by school district
swiss-food-safety-mcp + global-education-mcp Swiss children's nutrition vs. OECD benchmarks

Project Structure

swiss-food-safety-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ swiss_food_safety_mcp/
โ”‚       โ”œโ”€โ”€ __init__.py        # Package metadata
โ”‚       โ””โ”€โ”€ server.py          # All tools, resources, prompts
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ test_server.py         # Unit tests (no live API calls)
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ””โ”€โ”€ ci.yml             # Python 3.11โ€“3.13 matrix
โ”œโ”€โ”€ pyproject.toml             # hatchling build, uv-compatible
โ”œโ”€โ”€ CHANGELOG.md
โ”œโ”€โ”€ CONTRIBUTING.md
โ”œโ”€โ”€ LICENSE                    # MIT
โ”œโ”€โ”€ README.md                  # This file (English)
โ””โ”€โ”€ README.de.md               # German version

Data Sources

Source Description Format
opendata.swiss/BLV 28 open datasets CSV, JSON, Parquet, SPARQL, XML
lindas.admin.ch/sparql Swiss linked data SPARQL endpoint RDF/SPARQL
news.admin.ch RSS BLV public warnings & recalls RSS/XML
blv.admin.ch BLV website (DE/FR/IT/EN) HTML

All data is open government data (OGD) under Creative Commons with attribution requirement.


Known Limitations

  • SPARQL endpoint: Automatic fallback to CSV if the lindas.admin.ch SPARQL endpoint is unavailable
  • RSS feed: Limited to the most recent BLV publications; no historical archive
  • Pesticide register: XML parsing may be slow for queries returning large result sets
  • CKAN datasets: Opendata.swiss rate limits apply under heavy usage
  • Animal disease data: Canton-level filtering depends on data completeness in the source

Safety & Limits

  • Read-only: All tools perform HTTP GET requests only โ€” no data is written, modified, or deleted.
  • No personal data: The APIs return aggregated public health and food safety statistics. No personally identifiable information is processed or stored by this server.
  • Rate limits: opendata.swiss CKAN and lindas.admin.ch SPARQL are public APIs; use limit and filtering parameters conservatively. The server enforces a 30-second timeout per request.
  • Data freshness: RSS warnings reflect the latest BLV publications at query time. Statistical datasets (animal diseases, food control, antibiotics) are updated periodically by the BLV. No caching is performed by this server.
  • Terms of service: Data is subject to the ToS of each source โ€” opendata.swiss, lindas.admin.ch, news.admin.ch. BLV data is published under Creative Commons with attribution.
  • No guarantees: This server is a community project, not affiliated with the BLV or the Swiss federal administration. Availability depends on upstream APIs.

Deployment & Scaling

This server is Phase 1 โ€” read-only (see ROADMAP.md): all 11 tools are read-only queries with no write surface.

Run it as a single instance. The Streamable HTTP transport keeps per-session state, so horizontal scaling would require Mcp-Session-Id sticky routing at the load balancer plus a shared session store โ€” neither is implemented, by design, for a server of this scope. A single Render instance (or one container) is the supported deployment; docker-compose.yml sets explicit CPU/memory limits for self-hosting.


Testing

# Unit tests (no API access required)
PYTHONPATH=src pytest tests/ -m "not live"

# All tests including live API checks
PYTHONPATH=src pytest tests/

Changelog

See CHANGELOG.md


Contributing

See CONTRIBUTING.md


License

MIT License โ€” see LICENSE


Author

Hayal Oezkan ยท github.com/malkreide


Credits & Related Projects

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swiss_food_safety_mcp-1.1.0.tar.gz (48.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swiss_food_safety_mcp-1.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file swiss_food_safety_mcp-1.1.0.tar.gz.

File metadata

  • Download URL: swiss_food_safety_mcp-1.1.0.tar.gz
  • Upload date:
  • Size: 48.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for swiss_food_safety_mcp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4d2f13b79e4e239a3ee06c5b84e46597d4c30223edfd47765fe95405fb5800b6
MD5 496fc3c4b75ced16ac1d07cc36349694
BLAKE2b-256 cf540e87f060e6305ee4e0dc6b2f72abdd2c4d4b20d430be9e1ab903c3dc91a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for swiss_food_safety_mcp-1.1.0.tar.gz:

Publisher: publish.yml on malkreide/swiss-food-safety-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file swiss_food_safety_mcp-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for swiss_food_safety_mcp-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4dba6f84ea0c015b5cf2e7c18d7f18c8e5622ad6f72e3691b63c6cedb5fa4bba
MD5 e2c716de11fee4590dbb369a370bb2cb
BLAKE2b-256 f910e00a27a96b4a07b41cce136c973b7406bd50dca17f940c6d802e00bb8000

See more details on using hashes here.

Provenance

The following attestation bundles were made for swiss_food_safety_mcp-1.1.0-py3-none-any.whl:

Publisher: publish.yml on malkreide/swiss-food-safety-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page