MCP Server for City of Zurich Open Data โ 20 tools for CKAN, geodata, parliament, tourism, SPARQL, and real-time data across 6 APIs
Project description
๐จ๐ญ Part of the Swiss Public Data MCP Portfolio
๐๏ธ Zurich Open Data MCP Server
๐ English | Deutsch
An MCP (Model Context Protocol) server providing AI-powered access to Open Data from the City of Zurich, Switzerland.
Enables Claude, ChatGPT, and other MCP-compatible AI assistants to directly query 900+ datasets, geodata, parliamentary proceedings, council resolutions, tourism data, linked data, and real-time environmental and mobility information from the City of Zurich. 24 Tools, 5 Resources, 6 APIs.
Demo
โจ Features
CKAN Open Data (data.stadt-zuerich.ch)
zurich_search_datasetsโ Full-text search with Solr syntax across 900+ datasetszurich_get_datasetโ Complete metadata and download URLs for a datasetzurich_datastore_queryโ Query tabular data directly (filters, sorting)zurich_datastore_sqlโ SQL queries on the DataStorezurich_list_categoriesโ Browse 19 thematic categorieszurich_list_tagsโ Tag-based thematic search
Real-Time Environmental Data
zurich_weather_liveโ ๐ค๏ธ Current weather (temperature, humidity, pressure, rain) from 5 UGZ stationszurich_air_qualityโ ๐ฌ๏ธ Live air quality (NOโ, Oโ, PM10, PM2.5) with WHO thresholdszurich_water_weatherโ ๐ Lake Zurich data (water temperature, level, wind) every 10 min
Real-Time Mobility Data
zurich_pedestrian_trafficโ ๐ถ Pedestrian counts on Bahnhofstrasse (3 locations, hourly)zurich_vbz_passengersโ ๐ VBZ public transit ridership (800,000+ records, all lines/stops)zurich_parking_liveโ ๐ ฟ๏ธ Real-time occupancy of 36 parking garages (ParkenDD)
Geoportal (WFS Geodata)
zurich_geo_layersโ ๐ List 14 available geodata layerszurich_geo_featuresโ ๐ Fetch GeoJSON features (schools, districts, playgrounds, climate data, etc.)
City Parliament (Paris API)
zurich_parliament_searchโ ๐๏ธ Search parliamentary proceedings (interpellations, motions, postulates)zurich_parliament_membersโ ๐๏ธ Search council members (party, commissions, mandates)
Zurich Tourism
zurich_tourismโ ๐จ Attractions, restaurants, hotels, events (Schema.org data, 4 languages)
Linked Data (SPARQL)
zurich_sparqlโ ๐ SPARQL queries on the statistical linked data endpoint (currently disabled โ endpoint not productive yet)
Stadtratsbeschlรผsse (Council Resolutions)
search_stadtratsbeschluesseโ ๐ Full-text search of public council resolutions (title, department, date range)get_beschluesse_by_departementโ ๐ List all resolutions of a department (e.g.SSD,FD,PRD)get_stadtratsbeschluss_detailโ ๐ Single resolution byNNNN/YYYYnumber
Analysis Tools
zurich_analyze_datasetsโ Comprehensive analysis: relevance, recency, data structurezurich_catalog_statsโ Catalog overview with statisticszurich_find_school_dataโ Curated search for education-related datasets
MCP Resources
zurich://dataset/{name}โ Dataset metadatazurich://category/{group_id}โ Category detailszurich://parkingโ Current parking datazurich://geo/{layer_id}โ GeoJSON geodata (14 layers)zurich://tourism/categoriesโ Tourism categories
๐ Installation
Prerequisites
- Python 3.11+
- pip or uv
Install
# Clone
git clone https://github.com/malkreide/zurich-opendata-mcp.git
cd zurich-opendata-mcp
# Install
pip install -e .
# Or with uv
uv pip install -e .
โ๏ธ Configuration
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"zurich-opendata": {
"command": "python",
"args": ["-m", "zurich_opendata_mcp.server"],
"env": {}
}
}
}
Alternatively, using the installed command:
{
"mcpServers": {
"zurich-opendata": {
"command": "zurich-opendata-mcp"
}
}
}
Claude Code (CLI)
claude mcp add zurich-opendata -- python -m zurich_opendata_mcp.server
Cursor / VS Code
Add to .vscode/settings.json:
{
"mcpServers": {
"zurich-opendata": {
"command": "python",
"args": ["-m", "zurich_opendata_mcp.server"]
}
}
}
๐ฌ Example Queries
Once configured, you can ask Claude:
Open Data
- "What datasets are available about schools in Zurich?"
- "Show me school holidays for public schools"
- "Analyze the available geodata"
Real-Time Data
- "What's the current temperature in Zurich?" โ
zurich_weather_live - "How is the air quality today?" โ
zurich_air_quality - "What's the water temperature in Lake Zurich?" โ
zurich_water_weather - "How many parking spaces are free right now?" โ
zurich_parking_live - "How many people are on Bahnhofstrasse right now?" โ
zurich_pedestrian_traffic
Geodata
- "Show me all school facilities in Zurich as GeoJSON" โ
zurich_geo_features - "What geodata layers are available?" โ
zurich_geo_layers - "Where are the playgrounds in Zurich?"
City Parliament
- "What parliamentary motions about schools were filed?" โ
zurich_parliament_search - "Which council members belong to the SP party?" โ
zurich_parliament_members
Council Resolutions (Stadtratsbeschlรผsse)
- "Find council resolutions about Volksschule from 2025" โ
search_stadtratsbeschluesse - "List all SSD resolutions in 2025" โ
get_beschluesse_by_departement - "Show council resolution 1203/2025" โ
get_stadtratsbeschluss_detail
Tourism & Statistics
- "What restaurants does Zurich Tourism recommend?" โ
zurich_tourism - "How has Zurich's population evolved?" โ
zurich_sparql
๐ Data Sources
| API | Endpoint | Data |
|---|---|---|
| CKAN | data.stadt-zuerich.ch/api/3/ | 900+ open datasets |
| Geoportal WFS | ogd.stadt-zuerich.ch/wfs/geoportal | 14 geodata layers (GeoJSON) |
| Paris API | gemeinderat-zuerich.ch/api | Parliamentary proceedings & members |
| Zurich Tourism | zuerich.com/en/api/v2/data | Attractions, restaurants, hotels |
| SPARQL | ld.stadt-zuerich.ch/query | Linked Open Data / statistics |
| ParkenDD | api.parkendd.de/Zuerich | Real-time parking occupancy |
๐ Available Data Categories
| Category | ID |
|---|---|
| Employment | arbeit-und-erwerb |
| Base Maps | basiskarten |
| Construction & Housing | bauen-und-wohnen |
| Population | bevolkerung |
| Education | bildung |
| Energy | energie |
| Finance | finanzen |
| Leisure | freizeit |
| Health | gesundheit |
| Crime | kriminalitat |
| Culture | kultur |
| Mobility | mobilitat |
| Politics | politik |
| Prices | preise |
| Social Affairs | soziales |
| Tourism | tourismus |
| Environment | umwelt |
| Administration | verwaltung |
| Economy | volkswirtschaft |
๐ Available Geo Layers
Source of truth: GEOPORTAL_LAYERS in src/zurich_opendata_mcp/config.py.
| Layer ID | Description |
|---|---|
schulanlagen |
School facilities (kindergartens, schools, after-school care) |
schulkreise |
School district boundaries (polygons) |
schulwege |
School-route crossings and hazard points |
stadtkreise |
City district boundaries (polygons) |
spielplaetze |
Public playgrounds |
kreisbuero |
City district offices |
sammelstelle |
Waste collection points |
sport |
Sports facilities |
klimadaten |
Climate data (raster, temperatures, heat islands) |
lehrpfade |
Educational trails |
stimmlokale |
Polling stations |
sozialzentrum |
Social centres |
velopruefstrecken |
Bicycle exam routes for schools |
familienberatung |
Family-counselling meeting points |
๐๏ธ Project Structure
zurich-opendata-mcp/
โโโ src/zurich_opendata_mcp/
โ โโโ __init__.py
โ โโโ app.py # Shared FastMCP instance
โ โโโ server.py # Console entry + back-compat re-exports
โ โโโ config.py # Endpoints, layer maps, resource IDs
โ โโโ http_client.py # Shared httpx client + CKAN wrapper
โ โโโ formatters.py # Markdown + error formatting
โ โโโ clients/ # API clients: paris, sparql, tourism, wfs
โ โโโ tools/ # @mcp.tool implementations:
โ # catalog, datastore, geo, parliament,
โ # realtime, sparql, strb, tourism,
โ # resources (zurich:// URIs)
โโโ tests/
โ โโโ test_server.py # Pydantic + integration tests (live-marked)
โโโ audits/ # Code-audit reports
โโโ .github/workflows/ # ci.yml + publish.yml (Trusted Publisher)
โโโ pyproject.toml
โโโ README.md / README.de.md
โโโ CONTRIBUTING.md / .de.md
โโโ SECURITY.md / .de.md
โโโ CHANGELOG.md
โโโ CLAUDE.md # Project conventions for Claude
โโโ LICENSE
โโโ claude_desktop_config.json
๐งช Development
# Install dev dependencies
pip install -e ".[dev]"
# Unit + validation tests (no network)
pytest tests/ -m "not live"
# Live integration tests (against live APIs โ opt-in)
pytest tests/ -m live
# Linting
ruff check src/ tests/
Safety & Limits
- Read-only: All tools perform HTTP GET requests only โ no data is written, modified, or deleted.
- No personal data: The APIs return open civic datasets (parking occupancy, weather readings, parliamentary proceedings). No personally identifiable information (PII) is processed or stored by this server.
- Rate limits: CKAN Solr search and ParkenDD are public APIs without documented rate limits; use
rowsandlimitparameters conservatively. The server enforces a 30s timeout per request. - Data freshness: Real-time tools (parking, weather, air quality) reflect the upstream source at query time. No caching is performed by this server.
- Terms of service: Data is subject to the ToS of each source โ data.stadt-zuerich.ch, ParkenDD, gemeinderat-zuerich.ch. All City of Zurich data is published under CC0 (Open by Default since 2021).
- No guarantees: This server is a community project, not affiliated with the City of Zurich or any of the API providers. Availability depends on upstream APIs.
๐ค Contributing
Contributions are welcome โ see CONTRIBUTING.md (Deutsch).
๐ Security
Read-only, no PII, no authentication, a fixed set of public-data endpoints. See SECURITY.md (Deutsch) for the full security posture and accepted-risk decisions.
๐ License
MIT License โ see LICENSE. All data used is published under open licenses (CC0 / Open by Default since 2021).
๐ค Author
Hayal Oezkan ยท malkreide
Powered by Model Context Protocol โข 6 APIs โข 24 Tools โข 5 Resources
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 zurich_opendata_mcp-0.3.3.tar.gz.
File metadata
- Download URL: zurich_opendata_mcp-0.3.3.tar.gz
- Upload date:
- Size: 190.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11fae90d47483fa6dd6c66797fa34f03e48a97493a96e24f0c9c4df09430d7c2
|
|
| MD5 |
e2d404e0d67f030477c8f2569e57d0de
|
|
| BLAKE2b-256 |
8c065abe1e6ac8d3410bd8d7951475618aef607f570abccef78966eb0c636a18
|
File details
Details for the file zurich_opendata_mcp-0.3.3-py3-none-any.whl.
File metadata
- Download URL: zurich_opendata_mcp-0.3.3-py3-none-any.whl
- Upload date:
- Size: 45.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06ac0e1a5a43ff6788d58c33e31591b6b766ba83c3603a88426ddb307f4764c0
|
|
| MD5 |
35361f45d18099f0f70fcccd332a8ca4
|
|
| BLAKE2b-256 |
ecec1877c111a5593852367623934d82a72d0cd65adc0f3664a9b055e691cd68
|