Zh Education Mcp

io.github.malkreide由 GitHub 帳號 malkreide 發布v0.3.0更新於 Oct 25, 2026

Canton and City of Zurich education data: schools, statistics, infrastructure

已驗證STDIO僅桌面位置與生活資料與分析

概覽

AI 產生的概覽

唯讀 MCP 伺服器,讓助理存取蘇黎世州與蘇黎世市教育統計資料(BISTA):學生人數、學區趨勢、國籍結構與高中畢業率。

可以做什麼
列出蘇黎世州的學校社區與學區(Schulkreis),並查詢有效名稱
執行需求
需要 Python 3.11+ 及 uv 或 pip,也可用 uvx 免安裝執行。需連網存取 BISTA 公開 API;無需 API 金鑰或帳號。
安裝前請注意
唯讀且不需任何憑證,風險較低。資料依原樣來自 BISTA API,每年僅更新一次(基準日 9 月 15 日),結果可能落後;AI 產生的解讀應與 BISTA 官方入口網站核對。資料採 CC BY 4.0 授權,須標註來源 Bildungsstatistik Kanton Zürich (BISTA)。本專案為獨立開源專案,與蘇黎世州無隸屬關係。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Zh Education Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

🇨🇭 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.

SourceDataAPI
BISTA Kanton ZürichLearner 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?"


Demo

[zh-education-mcp demo: Claude queries BISTA data]


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

bash
# Clone the repositorygit clone https://github.com/malkreide/zh-education-mcp.gitcd zh-education-mcp
# Installpip install -e .# or with uv:uv pip install -e .

Or with uvx (no permanent installation):

bash
uvx zh-education-mcp

Quickstart

bash
# 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?"

→ More use cases by audience →


Configuration

Claude Desktop

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

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

Or with uvx:

json
{  "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 (Streamable HTTP 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 → runtime Docker (uses the provided Dockerfile)
  3. Set env vars: MCP_TRANSPORT=streamable-http, MCP_HOST=0.0.0.0, MCP_PORT=8000, and MCP_CORS_ORIGINS=https://claude.ai
  4. In claude.ai under Settings → MCP Servers, add: https://your-app.onrender.com/mcp

💡 "stdio for the developer laptop, Streamable HTTP for the browser."

Health probe: GET /health. Full deployment guide (container, load balancing, CORS, resource limits): docs/deployment.md.


Available Tools

ToolDescription
zh_edu_list_schulgemeindenList all school communities / Schulkreise in Canton Zurich
zh_edu_schulkreis_trendPupil trend by Schulkreis (2000–present)
zh_edu_overviewCanton-wide learner overview by school level
zh_edu_sek1_profilSecondary I profile (Sek A/B/C breakdown)
zh_edu_staatsangehoerigkeitenNationality structure of pupils per school community
zh_edu_maturitaetsquoteGymnasium graduation rates by municipality / district
zh_edu_wohnort_trendResidence-based learner trend (Bezirk / Gemeinde)
zh_edu_mittelschulenSecondary school statistics (Gymnasium, FMS, HMS)

Example Use Cases

QueryTool
"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

SourceProtocolCoverageAuthUpdate
BISTA Kanton ZHREST/CSVLearner statistics 2000–presentNoneAnnual (15 Sep)

Project Structure

zh-education-mcp/├── src/zh_education_mcp/│   ├── __init__.py              # Package│   ├── config.py               # ENV settings (MCP_*)│   ├── constants.py            # API base, endpoints, timeouts│   ├── logging_setup.py        # structured stderr logging│   ├── identity.py             # server identity for `_meta` / `server/discover`│   ├── provenance.py           # response envelope, license attribution│   ├── http_client.py          # egress guard, connection pool, lifespan│   ├── data.py                 # cache, CSV fetch, filters, error handling│   ├── models.py               # Pydantic input models│   ├── tools.py                # FastMCP instance, 8 tools, 2 resources│   └── server.py               # thin composition layer + entrypoint├── tests/│   └── test_server.py           # Unit tests (mocked HTTP with respx)├── docs/                        # deployment, security, egress, roadmap, …├── Dockerfile                   # multi-stage, non-root, healthcheck├── docker-compose.yml           # resource limits, read-only rootfs├── .github/workflows/ci.yml     # GitHub Actions (Python 3.11/3.12/3.13)├── .github/dependabot.yml       # monthly dependency updates├── pyproject.toml├── CHANGELOG.md├── CONTRIBUTING.md              # + CONTRIBUTING.de.md├── SECURITY.md                  # + SECURITY.de.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).

Safety & Limits

TopicDetails
No personal dataBISTA statistics are aggregated — no individual pupil data is exposed or accessible. All figures are anonymized at the school community level.
Read-onlyAll tools are read-only (readOnlyHint: true). The server cannot modify, delete, or write any data.
No authenticationThe BISTA API is fully public. No API keys, tokens, or credentials are stored or transmitted.
Rate limitsThe BISTA API has no documented rate limit, but the server uses a 24h in-memory cache to minimize requests. Please use responsibly.
Data licenseAll data is published under CC BY 4.0 by the Canton of Zurich. Attribution: Bildungsstatistik Kanton Zürich (BISTA).
Terms of ServiceUsage is subject to the BISTA terms of use. The MCP server is an independent open-source project and is not affiliated with the Canton of Zurich.
AI output disclaimerStatistics are passed through as-is from the BISTA API. AI-generated interpretations or summaries should be verified against the official BISTA portal.

Testing

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

The live suite also runs on a schedule: every Monday 05:23 UTC, plus on demand (live-tests.yml). A red run opens an upstream-labelled issue; a green one closes it. -m "not live" is not a place where tests run, and these three are the only tests here that can contradict a wrong assumption about BISTA — see CONTRIBUTING.


MCP Protocol Version

This server speaks two protocol eras over the same endpoint. The client's first request on a connection decides which one applies; a later claim from the other era is refused.

EraRevisionWho reaches it
initialize handshake2024-11-05 … 2025-11-25What today's clients speak. The server answers with the revision asked for, or with the 2025-11-25 ceiling when the request asks for something newer.
Per-request envelope2026-07-28A request carrying the 2026-07-28 _meta envelope opens a modern connection.

Both revisions are pinned in tests/test_protocol_version.py and asserted against the installed SDK, so a Dependabot bump of mcp cannot move either one silently. The handshake ceiling is measured against a live initialize through the assembled ASGI stack, not read off a constant name.

Note that the SDK's LATEST_PROTOCOL_VERSION is an alias for the modern era, not for the handshake era — pinning against it alone would leave the era that current clients actually negotiate free to drift.

What the server itself contributes on the modern era

Speaking the revision is the SDK's job. What a server has to supply is listed here, and measured in tests/test_modern_protocol.py against real requests through the assembled ASGI stack rather than against constants:

What 2026-07-28 requiresHow this server supplies it
serverInfo stamp on every result (spec #3002)Name, title, version, description and website — from the package metadata, see identity.py
server/discover ("Servers MUST implement")Answers with supportedVersions, capabilities and instructions
instructions for the modelReference date, suppressed small counts, attribution duty, read-only scope — deliberately the things no tool description carries
resultType on every resultSet by the SDK, asserted here against the wire
Envelope and header validation (Mcp-Method, Mcp-Name, Mcp-Protocol-Version)A contradicting header is rejected with -32020, a missing envelope with -32602
Freshness hints (SEP-2549)Every cacheable listing method carries ttlMs 300,000 / cacheScope public; resources/read deliberately does not

The identity is not maintained in src/: version, description and website come from the distribution metadata and therefore from pyproject.toml — the one source check_version_sync.py permits. Before this revision the server stamped version: "" onto every modern-era result.

Update policy. When the gate fails, do not edit the constant blindly: read the spec changelog between the two revisions, verify the server still behaves, then move the constant, this section, README.de.md and CHANGELOG.md together.

Project phase: Phase 1 — read-only (all tools readOnlyHint: true). See docs/roadmap.md.


Release

Publishing is driven by a GitHub release (release: published → publish.yml): build → gate → PyPI → MCP Registry.

The gate (check_release_artifacts.py) runs before the upload and inspects the built wheel, not the sources:

  • exactly one mcp-name: marker (an HTML comment, see the bottom of this file) in the wheel METADATA — the MCP Registry proves PyPI ownership with it — and it must match server.json name
  • server.json description at most 100 characters; the Registry answers 422, and only after the PyPI upload has already succeeded
  • server.json version equal to pyproject.toml version, and the git tag equal to the version actually built

It sits ahead of the upload because nothing is correctable behind it: a PyPI version is immutable, so a fix costs a version bump.

If you edit this README: the marker at the very bottom is shipped as part of the package description (readme = "README.md" in pyproject.toml), and removing it fails the gate. README.de.md carries no marker and is not published. The version badge above is checked on every pull request by check_version_sync.py against pyproject.toml and server.json.


Changelog

See CHANGELOG.md


Contributing

See CONTRIBUTING.md · 🇩🇪 Beitragen


Security

See SECURITY.md · 🇩🇪 Sicherheit


License

MIT License — see LICENSE


Author

Hayal Oezkan · malkreide


Credits & Related Projects

Installation

Run via uv's uvx — no clone or manual install needed. Add to your MCP client config (mcpServers for Claude Desktop, Cursor and Windsurf; use a top-level servers key for VS Code in .vscode/mcp.json):

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

來源:README.md,提交 5651efa

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.3.0最新Sep 19, 2026
  2. v0.2.7Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分