Skip to main content

MCP-Server für Bildungsstatistiken des Kantons und der Stadt Zürich (BISTA)

Project description

🇨🇭 Part of the Swiss Public Data MCP Portfolio

📊 zh-education-mcp

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

MCP server for education statistics of the Canton and City of Zurich (BISTA)

🇩🇪 Deutsche Version


Overview

zh-education-mcp connects AI assistants to the Bildungsstatistik Kanton Zürich (BISTA) — the official education statistics of the Canton of Zurich. It provides structured access to pupil numbers, school district trends, secondary school profiles, nationality breakdowns, and gymnasium graduation rates.

Source Data API
BISTA Kanton Zürich Learner statistics (Volksschule, Mittelschulen, Maturität) REST/CSV

All data is fetched from the BISTA public API (bista.zh.ch/basicapi/ogd/) — no API key required. Data is updated annually on 15 September (reference date).

Anchor demo query: "How has the number of pupils in school district Letzi developed over the last 5 years?"


Features

  • 📊 8 tools for education data across all school levels
  • 🔍 School district trends — pupil numbers for all Schulkreise (Letzi, Glattal, Schwamendingen, Oerlikon, Uto, Waidberg, Zürichberg) from 2000 to present
  • 🏫 Secondary school profiles — breakdown by requirement type (Sek A/B/C, Mittelschule, special classes)
  • 🌐 Nationality structure — top nationalities of pupils per school community
  • 🎓 Gymnasium graduation rates — Maturitätsquote by municipality, district, and canton
  • 📈 Canton-wide overview — all learners by school level, type, gender, and nationality
  • 🏠 Residence-based trends — pupil counts by place of residence (Bezirk / Gemeinde)
  • 🏛️ Mittelschulen — Gymnasium, FMS, HMS statistics
  • 🔓 No API key required — all data under CC BY 4.0
  • ☁️ Dual transport — stdio (Claude Desktop) + Streamable HTTP (cloud)

Prerequisites

  • Python 3.11+
  • uv (recommended) or pip

Installation

# Clone the repository
git clone https://github.com/malkreide/zh-education-mcp.git
cd zh-education-mcp

# Install
pip install -e .
# or with uv:
uv pip install -e .

Or with uvx (no permanent installation):

uvx zh-education-mcp

Quickstart

# stdio (for Claude Desktop)
python -m zh_education_mcp.server

# Streamable HTTP (port 8000)
python -m zh_education_mcp.server --http --port 8000

Try it immediately in Claude Desktop:

"Wie hat sich die Lernendenzahl im Schulkreis Letzi entwickelt?" "Zeige die Maturitätsquote der Stadt Zürich" "Welche Nationalitäten sind in Adliswil am häufigsten?"


Configuration

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "zh-education": {
      "command": "python",
      "args": ["-m", "zh_education_mcp.server"]
    }
  }
}

Or with uvx:

{
  "mcpServers": {
    "zh-education": {
      "command": "uvx",
      "args": ["zh-education-mcp"]
    }
  }
}

Config file locations:

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

Cloud Deployment (SSE for browser access)

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

Render.com (recommended):

  1. Push/fork the repository to GitHub
  2. On render.com: New Web Service → connect GitHub repo
  3. Set start command: python -m zh_education_mcp.server --http --port 8000
  4. In claude.ai under Settings → MCP Servers, add: https://your-app.onrender.com/sse

💡 "stdio for the developer laptop, SSE for the browser."


Available Tools

Tool Description
zh_edu_list_schulgemeinden List all school communities / Schulkreise in Canton Zurich
zh_edu_schulkreis_trend Pupil trend by Schulkreis (2000–present)
zh_edu_overview Canton-wide learner overview by school level
zh_edu_sek1_profil Secondary I profile (Sek A/B/C breakdown)
zh_edu_staatsangehoerigkeiten Nationality structure of pupils per school community
zh_edu_maturitaetsquote Gymnasium graduation rates by municipality / district
zh_edu_wohnort_trend Residence-based learner trend (Bezirk / Gemeinde)
zh_edu_mittelschulen Secondary school statistics (Gymnasium, FMS, HMS)

Example Use Cases

Query Tool
"List all Schulkreise in Zurich" zh_edu_list_schulgemeinden
"Pupil trend in Letzi over 5 years" zh_edu_schulkreis_trend
"How many Sek A vs Sek B in Winterthur?" zh_edu_sek1_profil
"Top nationalities in Zürich-Letzi" zh_edu_staatsangehoerigkeiten
"Maturitätsquote of Stadt Zürich" zh_edu_maturitaetsquote

Architecture

┌─────────────────┐     ┌──────────────────────────────┐     ┌──────────────────────────┐
│   Claude / AI   │────▶│  zh-education-mcp            │────▶│  BISTA Kanton Zürich     │
│   (MCP Host)    │◀────│  (MCP Server)                │◀────│  REST/CSV (Public API)   │
└─────────────────┘     │                              │     └──────────────────────────┘
                        │  8 Tools                     │
                        │  Stdio | Streamable HTTP     │
                        │  24h Cache                   │
                        │  No authentication required  │
                        └──────────────────────────────┘

Data Source Characteristics

Source Protocol Coverage Auth Update
BISTA Kanton ZH REST/CSV Learner statistics 2000–present None Annual (15 Sep)

Project Structure

zh-education-mcp/
├── src/zh_education_mcp/
│   ├── __init__.py              # Package
│   └── server.py                # 8 tools, cache, dual transport
├── tests/
│   └── test_server.py           # Unit tests (mocked HTTP with respx)
├── .github/workflows/ci.yml     # GitHub Actions (Python 3.11/3.12/3.13)
├── pyproject.toml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md                    # This file (English)
└── README.de.md                 # German version

Known Limitations

  • Annual updates only: BISTA data is updated once per year (reference date: 15 September). The 24h in-memory cache matches this cycle.
  • CSV-based API: The BISTA API returns CSV data; large datasets may take a moment to parse.
  • School community names: Names must match exactly (use zh_edu_list_schulgemeinden to find valid names).

Testing

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

# Integration tests (live API calls)
pytest tests/ -m "live"

Changelog

See CHANGELOG.md


Contributing

See CONTRIBUTING.md


License

MIT License — see LICENSE


Author

Hayal Oezkan · 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

zh_education_mcp-0.1.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

zh_education_mcp-0.1.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file zh_education_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: zh_education_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zh_education_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 94e14e8aedb6d4f692fbe4d867bcfdd8b97f6070c2f61cb729fa8be74cec1dad
MD5 d91707e44443b2373f7a90e27459eca4
BLAKE2b-256 27636671dbbe885d335e4f44bcfbf9fdb80da2d015d8ba2cf1dc074c349e59b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for zh_education_mcp-0.1.0.tar.gz:

Publisher: publish.yml on malkreide/zh-education-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 zh_education_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zh_education_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a7c25be61a25093f83927ebba05f6a9fbff6c4c00cb816965b68332e5a3780c
MD5 463be4969b6e175a20d042c791a376df
BLAKE2b-256 31a67d6ca624bbd3c0817f45fe0ad4130f5591b5149494815194fd0d617ec5de

See more details on using hashes here.

Provenance

The following attestation bundles were made for zh_education_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on malkreide/zh-education-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