Statistics Canada MCP Server
Access Statistics Canada data via the Web Data Services API
Connect it
Settings → Connectors → Add custom connector
URL: https://mcp-statcan.com/mcpSettings → Apps & Connectors → Advanced → Developer mode
Create connector with URL: https://mcp-statcan.com/mcp{
"mcpServers": {
"mcp-statcan": {
"url": "https://mcp-statcan.com/mcp"
}
}
}claude mcp add --transport http mcp-statcan https://mcp-statcan.com/mcp{
"servers": {
"mcp-statcan": {
"type": "http",
"url": "https://mcp-statcan.com/mcp"
}
}
}{
"mcpServers": {
"mcp-statcan": {
"command": "uvx",
"args": [
"statcan-mcp-server"
]
}
}
}claude mcp add mcp-statcan -- uvx statcan-mcp-server17 tools, pulled live
get_code_setsread-onlyDecode StatCan WDS numeric codes (e.g. frequencyCode 6 = Monthly, scalarFactorCode 0 = units). Corresponds to: GET /getCodeSets Without arguments, returns a summary: small code sets (scalar, frequency, symbol, status, ...) in full, and only entry counts for large ones (uom, survey, subject, classificationType). Request a large set with code_set, and narrow it with search: get_code_sets(code_set
get_all_cubes_listread-onlyProvides a complete inventory of data tables available via the API, including dimension-level details. Disables SSL Verification. Corresponds to: GET /getAllCubesList Results are paginated. Default returns first 100 cubes. Use offset/limit to page through. Prefer search_cubes_by_title if you know what you're looking for. IMPORTANT: In your final response to the user, you MUST cite the source of
get_all_cubes_list_literead-onlyProvides a complete inventory of data tables available via the API, excluding dimension or footnote information (lighter version). Disables SSL Verification. Corresponds to: GET /getAllCubesListLite Results are paginated. Default returns first 100 cubes. Use offset/limit to page through. Prefer search_cubes_by_title if you know what you're looking for. IMPORTANT: In your final response to the us
search_cubes_by_titleread-onlySearches for data cubes/tables where the English or French title contains the provided search term (case-insensitive). Multiple keywords use AND logic (e.g., "tobacco smoking age" finds cubes containing ALL three words). Returns max_results matches (default 10) from offset. Returns {"data": [...], "total_matches": N, "showing": M, ?"next_offset"}. Each result has productId, cubeTitleEn, cubeStar
get_cube_metadataread-onlyRetrieves detailed metadata for a specific data table/cube using its ProductId. Includes dimension info, titles, date ranges, codes, etc. Disables SSL Verification. Corresponds to: POST /getCubeMetadata Start with summary=True (default). The summary strips noise (French translations, archive codes, footnotes) and shows only 3 sample members per dimension with _next_steps guidance. Safe for all co
get_changed_series_data_from_cube_pid_coordread-onlyGet the data points of a series (by ProductId + Coordinate) that changed TODAY only. StatCan publishes at 08:30 ET; before then, or on a day the series did not change, this returns changed=false. For past releases use get_changed_cube_list(date). Coordinates are automatically padded to 10 dimensions. Disables SSL Verification. Corresponds to: POST /getChangedSeriesDataFromCubePidCoord Returns:
get_series_inforead-onlyResolve one or more {productId, coordinate} pairs to series metadata (vectorId, titles, frequency, UOM, etc.) in a single API call. Use this to find vectorIds before fetching data with get_sdmx_data or get_sdmx_vector_data. Pass one item or many â same tool either way. Each result already includes vectorId, frequencyCode, scalarFactorCode and memberUomCode, so do not call get_series_info_from_v
get_changed_cube_listread-onlyGet the list of data tables/cubes that were updated on a specific date (YYYY-MM-DD). Disables SSL Verification. Corresponds to: GET /getChangedCubeList/{date} Returns: List[Dict[str, Any]]: A list of dictionaries describing changed cube objects. IMPORTANT: In your final response to the user, you MUST cite the source of your data. For changed cubes, this means including the ProductId (pid) an
get_series_info_from_vectorread-onlyRequest series metadata (productId, coordinate, titles, frequency, etc.) by Vector ID. Use only when you start from a vectorId: get_series_info already returns this metadata for series it resolved. Disables SSL Verification. Corresponds to: POST /getSeriesInfoFromVector Returns: Dict[str, Any]: A dictionary containing the series metadata object. Raises: httpx.HTTPStatusError: If the API r
get_bulk_vector_data_by_rangeread-onlyFetches bulk data for multiple vectors filtered by *release date* range (YYYY-MM-DDTHH:MM), NOT by reference period. Use this when you want data released within a specific date/time window (e.g., "all updates released yesterday"). *** IMPORTANT: release date vs reference period *** - Use THIS tool when you want: "data released between date A and date B" - Use get_sdmx_vector_data (startPeriod/end
get_changed_series_data_from_vectorread-onlyGet the data points of a series (by Vector ID) that changed TODAY only. StatCan publishes at 08:30 ET; before then, or on a day the series did not change, this returns changed=false. For past releases use get_changed_cube_list(date). Disables SSL Verification. Corresponds to: POST /getChangedSeriesDataFromVector Returns: Dict[str, Any]: The changed series data object, or {"vectorId", "changed
get_changed_series_listread-onlyGet the list of series (vectorId, productId, coordinate, releaseTime) updated today. Statistics Canada publishes this list after 08:30 ET; the endpoint does not accept a date. For a historical release date, use get_changed_cube_list(date) to list the cubes updated on that date. Disables SSL Verification. Corresponds to: GET /getChangedSeriesList Returns: List[Dict[str, Any]]: A list of dictio
get_sdmx_structureread-onlyFetch the Data Structure Definition (DSD) for a StatCan table via SDMX REST. Returns dimension codelists with code IDs, names, and parent hierarchy. Use this BEFORE get_sdmx_data to understand the key syntax for that table. Each dimension entry includes: - id: dimension identifier (e.g. "Geography") - position: its slot in the dot-separated key string (1-based) - codelist: the SDMX codelis
get_sdmx_dataread-onlyFetch filtered time-series observations from a StatCan table via SDMX REST. Filtering is done server-side â only the requested slice is returned. Call get_sdmx_structure first to see dimension positions and valid codes. Key syntax (dot-separated codes in dimension position order): "1.2.1" = Geography=1 (Canada), Gender=2 (Men+), Age=1 (All ages) ".2.1" = all geographies, Gender=2, Age
query_sdmxread-onlyFetch SDMX observations and run ONE read-only SQL query over them server-side, returning only the query result. Nothing is stored â the data is loaded into a temporary in-memory table named `data` and discarded after the query. *** Use this for compute/compare/rank questions ("which province grew fastest", "average since 2020", "year-over-year change") instead of pulling raw rows with get_sdmx_
get_sdmx_vector_dataread-onlyFetch time-series observations for a single StatCan vector via SDMX REST. Simpler alternative to get_sdmx_data when you already know the vectorId. Use get_series_info (productId + coordinate) to find vectorIds. Time filtering (use one or the other, not both): lastNObservations=5 â last 5 periods startPeriod="2020-01" â from Jan 2020 (monthly); "2020" for annual endPeriod="2023-12"
get_sdmx_key_for_dimensionread-onlyReturn all leaf member IDs for a single dimension as a ready-to-use OR key string. Use this before get_sdmx_data when a dimension has many codes (e.g. 162 NOC minor groups, hundreds of CMA geographies). Avoids the need to call get_cube_metadata and manually parse a large JSON response. Leaf codes are codes with no children â the lowest-level members in a hierarchy. For flat (non-hierarchical)
Alternatives in Developer Tools
Compare →MLMicrosoft Learn MCPOfficialA
Official Microsoft Learn MCP Server – real-time, trusted docs & code samples for AI and LLMs.
GIGitHubOfficialA
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
GIGitDiagramA
Architecture diagrams, explanations and Mermaid source for public GitHub repositories.
MGMCP GrafanaOfficialA
An MCP server giving access to Grafana dashboards, data and more.
MDMCP Devkit ServerOfficialA
Provides AI assistants with direct access to Mapbox developer APIs and documentation.
Front-End ChecklistA
Review frontend code and live pages against 386 quality-gated web development rules.