An MCP server for
Ontario's open data

Search, cache, and query 0 government datasets.
Cross-dataset joins, iterative analysis, DuckDB-backed local storage.
No API key required.

Add via Claude Code CLI

claude mcp add ontario-data -- uvx ontario-data-mcp
Or clone from source: git clone https://github.com/sprine/ontario-data-mcp && cd ontario-data-mcp && uv sync

How it works

Each question triggers a pipeline of tool calls.

1
Search
Finds relevant datasets across Ontario, Toronto, Ottawa, Waterloo, Kitchener, and Region of Waterloo open data portals. Keyword, topic, or related-dataset lookup.
2
Retrieve
Downloads CSVs, XLSX, shapefiles, GeoJSON. Parses and caches locally in DuckDB.
3
Analyze
Runs SQL against cached data. Aggregations, joins, window functions โ€” results come back as insight.
4
Validate
Cross-checks every claim against the underlying query. Catches hallucinations before they reach you.

23 tools under the hood

Expand any category to see the individual tools.

Discovery 5 tools
Search by keyword, topic, ministry, or geographic area.
search_datasets, list_portals, list_organizations, list_topics, find_related_datasets
Metadata 4 tools
Inspect schemas, resources, and compare datasets side by side.
get_dataset_info, list_resources, get_resource_schema, compare_datasets
Retrieval 4 tools
Download and cache datasets locally in DuckDB for fast, offline access.
download_resource, cache_info, cache_manage, refresh_cache
Querying 4 tools
Run SQL against remote or cached data. Preview rows or run custom queries.
query_resource, sql_query, query_cached, preview_data
Data Quality 3 tools
Freshness checks, completeness analysis, and statistical profiles.
check_freshness, profile_data, validate_result
Geospatial 3 tools
Load shapefiles, KML, and GeoJSON into DuckDB. Run spatial queries.
load_geodata, spatial_query, list_geo_datasets
Prompts 3 prompts
Context-aware guided workflows with live catalogue data.
explore_topic โ€” guided exploration of any topic
data_investigation โ€” deep dive: schema, quality, stats
compare_data โ€” side-by-side dataset analysis
Resources 5 resources
Read-only context for the LLM: cache status, metadata, SQL tips.
ontario://cache/index โ€” cached datasets with freshness
ontario://dataset/{id} โ€” full dataset metadata
ontario://portal/stats โ€” catalogue overview
ontario://schema/{table_name} โ€” column schema and type warnings
ontario://guides/duckdb-sql โ€” SQL tips for Ontario data
Found a bug or have a feature request? Open an issue ยท Feedback on the data catalogue itself? Let Ontario know