An MCP server for Ontario's open data.

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

uvx ontario-data-mcp
0
datasets
0
tools
0
prompts
0
resources

How it works

Each question triggers a pipeline of tool calls. Here's what runs.

1
Search
Finds relevant datasets across 25 ministries. Keyword, topic, location, 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.

24 tools under the hood

Expand any category to see the individual tools.

Discovery 6 tools
Search by keyword, topic, ministry, or geographic area.
search_datasets, list_organizations, list_topics, get_popular_datasets, search_by_location, 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_data_quality, check_freshness, profile_data
Geospatial 3 tools
Load shapefiles, KML, and GeoJSON into DuckDB. Run spatial queries.
load_geodata, spatial_query, list_geo_datasets

Guided workflows

Built-in prompts that run multi-step tool sequences. Each one searches the live catalogue, checks your cache, and builds context before the LLM responds.

explore_topic
Explore housing data in Ontario
Searches the catalogue for "housing," returns the top results across ministries, inspects metadata on the most relevant datasets, and recommends which to download. Finds 40+ datasets spanning rent tribunals, social housing waitlists, and building permits.
What the prompt triggers
search_datasets โ†’ "housing" (live catalogue search, top 5 shown)
get_dataset_info โ†’ inspects interesting results
list_resources โ†’ checks formats, row counts
Recommends downloads, suggests questions you can answer
Usage: explore_topic(topic="housing")
data_investigation
Investigate the licensed child care facilities dataset
Pulls full metadata, downloads the primary CSV, runs schema inspection, data quality checks, and statistical profiling. Surfaces 12% null rates in postal codes, flags capacity outliers, and suggests spatial joins with census boundaries.
What the prompt triggers
get_dataset_info โ†’ full metadata
list_resources โ†’ finds primary CSV
get_resource_schema โ†’ column types and names
download_resource โ†’ caches in DuckDB
check_data_quality โ†’ nulls, duplicates, freshness
profile_data โ†’ distributions, outliers, patterns
query_cached โ†’ follow-up SQL for time series or correlations
Usage: data_investigation(dataset_id="licensed-child-care-facilities-in-ontario")
compare_data
Compare ambulance response times with ER wait times
Downloads both datasets, profiles each independently, then runs cross-dataset analysis. Finds shared region columns, confirms joinability, and shows regions with slow ambulance response also have 22% longer ER waits.
What the prompt triggers
compare_datasets โ†’ metadata comparison
download_resource ร— 2 โ†’ caches both datasets
profile_data ร— 2 โ†’ structure, size, quality for each
query_cached โ†’ DuckDB SQL to find shared columns and join
Summarizes complementarity and join potential
Usage: compare_data(dataset_ids="ambulance-response-times, ontario-wait-times")
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 4 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://guides/duckdb-sql โ€” SQL tips for Ontario data

Get started

Works with any MCP-compatible client. No API key required.

Add to claude_desktop_config.json

{
  "mcpServers": {
    "ontario-data": {
      "command": "uvx",
      "args": ["ontario-data-mcp"]
    }
  }
}
Or clone from source: git clone https://github.com/sprine/ontario-data-mcp && cd ontario-data-mcp && uv sync
Found a bug or have a feature request? Open an issue ยท Feedback on the data catalogue itself? Let Ontario know