Queries Statistics Canada tables, metadata, SDMX observations, changed data, and local SQLite datasets through MCP.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Statistics Canada MCP Server.
get_code_setsRetrieves definitions for various code sets used by the API (e.g., frequency, units of measure). Corresponds to: GET /getCodeSets Returns: Dict[str, Any]: Dictionary containing code set definitions (scalar, frequency, etc.). Raises: httpx.HTTPStatusError: If the API returns an error status code. ValueError: If the API response format is unexpected. Exception: For other network or unexpected errors. IMPORTANT: In your final response to the user, you MUST cite the source of your data. For code sets, this means specifying which code set table or definition is being used.
get_all_cubes_listProvides 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 your data. For cubes, this means including the ProductId (pid) and the Title.
get_all_cubes_list_liteProvides 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 user, you MUST cite the source of your data. For cubes, this means including the ProductId (pid) and the Title.
search_cubes_by_titleSearches for data cubes/tables where the English or French title contains the provided search term (case-insensitive). Returns a list of matching cubes in the 'lite' format (excluding dimensions/footnotes). Multiple keywords use AND logic (e.g., "tobacco smoking age" finds cubes containing ALL three words). Results are capped at max_results (default 25). IMPORTANT: In your final response to the user, you MUST cite the source of your data. For cubes, this means including the ProductId (pid) and the Title. Raises: httpx.HTTPStatusError: If the underlying API call fails. Exception: For other network or unexpected errors during the fetch.
get_cube_metadataRetrieves 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 context window sizes. Set summary=False only if you need the full raw member list or all API fields. To browse dimension codes for get_sdmx_data key construction, use get_sdmx_structure. To resolve a coordinate to a vectorId, use get_series_info. Returns: Dict[str, Any]: The metadata object for the specified cube on success. Raises: httpx.HTTPStatusError: If the API returns an error status code. ValueError: If the API response format is unexpected or status is not SUCCESS. Exception: For other network or unexpected errors. IMPORTANT: In your final response to the user, you MUST cite the source of your data. For cubes, this means including the ProductId (pid) and the Title.
get_changed_series_data_from_cube_pid_coordRetrieves changed series data (data points that have changed) using Cube ProductId and Coordinate string. Coordinates are automatically padded to 10 dimensions. Disables SSL Verification. Corresponds to: POST /getChangedSeriesDataFromCubePidCoord Returns: Dict[str, Any]: A dictionary containing the changed series data object. Raises: httpx.HTTPStatusError: If the API returns an error status code. ValueError: If the API response format is unexpected or status is not SUCCESS. Exception: For other network or unexpected errors. IMPORTANT: In your final response to the user, you MUST cite the source of your data. For changed series data, this means including the VectorId, ProductId (pid), and Coordinate.
Statistics Canada MCP Server MCP server gives MCP clients structured access to Statistics Canada datasets through the Web Data Services API and SDMX REST API. It can search table titles in English or French, list available cubes, retrieve cube metadata, resolve series identifiers, fetch observations, and identify tables or series updated on a particular date.
The server also supports local data workflows. A local deployment can fetch multiple vectors into SQLite, persist full cube metadata in normalized tables, create tables from returned data, append rows, inspect schemas, list tables, run read-only SQL queries, and drop tables. The hosted deployment provides WDS and SDMX tools but does not include the SQLite tools.
A typical discovery flow starts with search_cubes_by_title, followed by get_cube_metadata or get_sdmx_structure. Metadata exposes dimensions, member codes, date ranges, and series information. For large dimensions, get_sdmx_key_for_dimension produces a ready-to-use OR key containing leaf member IDs.
Once the required dimensions are known, get_sdmx_data retrieves a filtered slice using a dot-separated SDMX key, while get_sdmx_vector_data handles a known vector. get_sdmx_rows is intended when rows must be embedded directly into an artifact or widget. Time filters can use a reference-period range or a count of recent observations, but those modes cannot be combined.
For multi-series work, the Statistics Canada MCP Server MCP server can fetch vectors directly into a named SQLite table. This avoids returning every observation to the model context and allows subsequent SQL analysis. Release-date queries use get_bulk_vector_data_by_range; reference-period queries use the SDMX tools instead.
The repository documents a hosted endpoint at https://mcp-statcan.onrender.com/mcp, which can be added as a custom HTTP connector. It also documents local HTTP startup with:
For full local functionality, run the package through stdio:
A custom SQLite location can be supplied with --db-path when configuring a local client. The project requires Python 3.10 or newer. No API key or other credential is specified in the supplied material.
The Statistics Canada MCP Server MCP server includes tools for:
Responses have context and size limits. SDMX row results are capped at 500 rows, and large vector responses should be narrowed or paginated. Wildcards on dimensions with more than 30 codes may return sparse samples; explicit member IDs joined with + are recommended for those dimensions. StatCan rejects requests that combine lastNObservations with startPeriod or `endPeriod.
Several tools disable SSL verification according to their documented behavior. The local SQLite database is persistent, and table-dropping is irreversible. Read-only SQL is supported by query_database; untrusted SQL should not be passed to it.
Data provenance is part of the tool contract. Cube results should identify the ProductId and title; series results should include the vector ID, product ID, and coordinate; SDMX results should include the _sdmx_url, product ID or vector ID, and key where applicable. For authoritative verification, consult Statistics Canada at https://www.statcan.gc.ca/ and the documented WDS and SDMX sources: https://www.statcan.gc.ca/eng/developers/wds and https://www150.statcan.gc.ca/t1/wds/sdmx/statcan/rest/.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/statistics-canada-mcp-server)<a href="https://allmcps.com/mcp/statistics-canada-mcp-server"><img src="https://allmcps.com/api/badge/statistics-canada-mcp-server?style=directory" alt="Statistics Canada MCP Server on AllMCPs" /></a>