Skip to main content

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

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

๐ŸŒ 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

Demo: Claude using zurich_parking_live and zurich_air_quality

โœจ Features

CKAN Open Data (data.stadt-zuerich.ch)

  • zurich_search_datasets โ€“ Full-text search with Solr syntax across 900+ datasets
  • zurich_get_dataset โ€“ Complete metadata and download URLs for a dataset
  • zurich_datastore_query โ€“ Query tabular data directly (filters, sorting)
  • zurich_datastore_sql โ€“ SQL queries on the DataStore
  • zurich_list_categories โ€“ Browse 19 thematic categories
  • zurich_list_tags โ€“ Tag-based thematic search

Real-Time Environmental Data

  • zurich_weather_live โ€“ ๐ŸŒค๏ธ Current weather (temperature, humidity, pressure, rain) from 5 UGZ stations
  • zurich_air_quality โ€“ ๐ŸŒฌ๏ธ Live air quality (NOโ‚‚, Oโ‚ƒ, PM10, PM2.5) with WHO thresholds
  • zurich_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 layers
  • zurich_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 by NNNN/YYYY number

Analysis Tools

  • zurich_analyze_datasets โ€“ Comprehensive analysis: relevance, recency, data structure
  • zurich_catalog_stats โ€“ Catalog overview with statistics
  • zurich_find_school_data โ€“ Curated search for education-related datasets

MCP Resources

  • zurich://dataset/{name} โ€“ Dataset metadata
  • zurich://category/{group_id} โ€“ Category details
  • zurich://parking โ€“ Current parking data
  • zurich://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 rows and limit parameters 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


Download files

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

Source Distribution

zurich_opendata_mcp-0.3.3.tar.gz (190.0 kB view details)

Uploaded Source

Built Distribution

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

zurich_opendata_mcp-0.3.3-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

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

Hashes for zurich_opendata_mcp-0.3.3.tar.gz
Algorithm Hash digest
SHA256 11fae90d47483fa6dd6c66797fa34f03e48a97493a96e24f0c9c4df09430d7c2
MD5 e2d404e0d67f030477c8f2569e57d0de
BLAKE2b-256 8c065abe1e6ac8d3410bd8d7951475618aef607f570abccef78966eb0c636a18

See more details on using hashes here.

File details

Details for the file zurich_opendata_mcp-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for zurich_opendata_mcp-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 06ac0e1a5a43ff6788d58c33e31591b6b766ba83c3603a88426ddb307f4764c0
MD5 35361f45d18099f0f70fcccd332a8ca4
BLAKE2b-256 ecec1877c111a5593852367623934d82a72d0cd65adc0f3664a9b055e691cd68

See more details on using hashes here.

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