Statistics Canada MCP Server
PYPI · STATCAN-MCP-SERVER · SCANNED SEP 21
Access Statistics Canada data via the Web Data Services API
Available components
How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. How we score → Why this is hard to score →
Supply Chain Security50
- Malware scan not yet available for this package.Unverified
- No known CVEs affecting this package version or its production dependencies.Pass
- Runs hatchling.build at install time, a recognised native-build step with no shell scripting around it. View diagnostics → Pass
- 4 of 40 dependencies flagged as unhealthy. View diagnostics → Partial
Provenance & Transparency32
- Source repository is publicly reachable at the declared URL. View diagnostics → Pass
- Provenance check failed: no build-provenance attestation is published. See how to fix → View diagnostics → Fail
- License check failed: no license is declared. See how to fix → Fail
- Actively maintained (last published 1 days ago).Pass
- Disclosure check failed: no security disclosure policy was found in the source repository. See how to fix → Fail
Schema Quality & AI Usability76
- 100% of prompts and resources have a non-trivial description (not blank, and not just the item's name).Pass
- AI-judged instruction clarity (excellent).Pass
- Context-footprint check failed: tool/resource definitions use about 5954 tokens (~238/item across 25 items; 25 tools + 0 resources), over budget; trim descriptions and params. See how to fix → Fail
- Usage-examples check failed: none of the tools include examples. See how to fix → Fail
Stability & Change Management87
- Stability observed for 26 of 30 days with no destabilising changes; credit accrues until the full window elapses.Partial
Tool Coverage92
- 100% of tools have a non-trivial description (not blank, and not just the tool's name).Pass
- 75% of tool parameters carry a description.Partial
Tool Safety75
- No prompt-injection markers were found in the server instructions, tool names or descriptions we captured.Pass
- 0 of 2 tool(s) whose name or description implies an irreversible operation declare an MCP destructiveHint annotation; "drop_table" implies "drop" and declares no destructiveHint at all, which the MCP spec reads as destructive by default. See how to fix → Fail
- An AI judge read all 25 captured unit(s) of tool text and found none that tries to manipulate the model reading it.Pass
Capabilities100
- Implements a current MCP spec version (2026-07-28).Pass
How do I install the Statistics Canada MCP Server server?
Statistics Canada MCP Server runs locally as a PyPI package, launched with uvx statcan-mcp-server. Ready-made configuration for Claude, Cursor, VS Code, Codex and 5 more is on this page, copied from each client's own documentation.
pypi · statcan-mcp-server
claude mcp add aryan-jhaveri-mcp-statcan -- uvx statcan-mcp-server
{
"mcpServers": {
"aryan-jhaveri-mcp-statcan": {
"command": "uvx",
"args": [
"statcan-mcp-server"
]
}
}
} {
"servers": {
"aryan-jhaveri-mcp-statcan": {
"command": "uvx",
"args": [
"statcan-mcp-server"
]
}
}
} codex mcp add aryan-jhaveri-mcp-statcan -- uvx statcan-mcp-server
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"aryan-jhaveri-mcp-statcan": {
"type": "local",
"command": [
"uvx",
"statcan-mcp-server"
],
"enabled": true
}
}
} openclaw mcp add aryan-jhaveri-mcp-statcan --command uvx --arg statcan-mcp-server
mcp_servers:
aryan-jhaveri-mcp-statcan:
command: "uvx"
args: ["statcan-mcp-server"] {
"McpServers": {
"aryan-jhaveri-mcp-statcan": {
"Transport": "stdio",
"Command": "uvx",
"Arguments": [
"statcan-mcp-server"
]
}
}
} assistant mcp add aryan-jhaveri-mcp-statcan -t stdio -c uvx -a statcan-mcp-server
{
"mcpServers": {
"aryan-jhaveri-mcp-statcan": {
"command": "uvx",
"args": [
"statcan-mcp-server"
]
}
}
} Every change we have recorded for this component, newest first. Security-relevant changes are always shown. ▲ marks a change for the better, ▼ a change for the worse; unmarked changes are neutral.
- 20 Sept 26 −14
- Malware scan: pass → unverified ▼ security
- 19 Sept 26 +15
- Stability: 0.77 → unverified ▼ security
- Tool safety: pass → unverified ▼ security
- Malware scan: unverified → pass ▲ security
- Capabilities: pass → unverified ▼ functional
- Tool coverage: 100 → unverified ▼ functional
- Schema quality: 100 → unverified ▼ functional
- MCP protocol: Implements a current MCP spec version (2026-07-28). functional
- Package version: 0.7.15 → 0.7.17 functional
- 18 Sept 26 −3
- Stability: pass → 0.77 functional
- 17 Sept 26 0
- Stability: 0.97 → pass security
- 16 Sept 26 +1
No change was recorded against any check on this day. Stability & Change Management went from 93 to 97. That category is still filling its 30-day observation window: 28 days of observed history at the previous scan, 29 at this one. The score rises as the window fills, whether or not the server changes.
- 15 Sept 26 −15
- Malware scan: pass → unverified ▼ security
- 14 Sept 26 +16
- Malware scan: unverified → pass ▲ security
- 12 Sept 26 −2
- Stability: pass → 0.83 functional
Diagnostic detail from the automated scan of this channel: what the scanner observed at each step, so you can see exactly where a check passed or failed. It is informational only and never changes the trust score.
Captured 21 Sept 2026 · Analysed pypi/statcan-mcp-server@0.7.17
Provenance No attestation
The registry publishes no build provenance for this version, so there is nothing to verify.
| Result | No attestation |
|---|---|
| Ecosystem | pypi |
Background: How many MCP packages publish verified provenance →
Install scripts 1 script
| Hook | Tier | Command |
|---|---|---|
| build_backend | allowlisted | hatchling.build |
Background: Why install scripts are a supply-chain risk →
Dependencies 40 packages
| Packages resolved | 40 |
|---|---|
| Stale | 3 |
| No linked repository | 1 |
| Tree resolution | Complete |
Background: SBOMs and build attestations, explained →
The tools this component advertises to a client, with an estimated token cost for each. Expand a tool to see its parameters and schema. The per-tool counts are indicative and are not scored directly; the schema's total context footprint is one signal in Schema Quality & AI Usability. A tool's description is untrusted text the model reads on every call, which is what makes this list a security surface and not just an inventory: how tool poisoning works →
create_table_from_data ~196
Creates a new SQLite table from the provided data AND immediately inserts all rows. Infers column names and types from the first item in the data list. WARNING: Overwrites the table if it already exists. Use this as a single step to store fetched API data — no need to call insert_data_into_table afterwards. Use insert_data_into_table only to append more rows to an already-existing table. Args: table_input: Object containing table_name and data (list of dicts). Returns: Dict[str, Any]: A summary with table name, columns created, and rows inserted. IMPORTANT: The database is persistent and does NOT clean itself automatically. This tool overwrites the table if it exists, giving you a clean slate each call.
| Name | Type | Req | Description |
|---|---|---|---|
| data | array | yes | Data to insert, as a list of dictionaries. |
| table_name | string | yes | Name for the SQL table (alphanumeric and underscores recommended). |
No output schema declared.
No examples provided.
drop_table ~95
Permanently deletes (drops) a table from the SQLite database. Use this to free up space or remove tables that are no longer needed. This action is irreversible — all data in the table will be lost. Args: table_name_input: Object containing the table_name to drop. Returns: Dict[str, Any]: A dictionary indicating success or an error message.
| Name | Type | Req | Description |
|---|---|---|---|
| table_name | string | yes | Name of the SQL table. |
No output schema declared.
No examples provided.
fetch_vectors_to_database ~483
PREFERRED tool for multi-series analysis. Fetches data for multiple StatCan vector IDs in a single API call and immediately stores the results in a SQLite table — no separate create/insert steps needed. *** USE THIS TOOL whenever you need data for multiple provinces, age groups, industries, or any other breakdown. It replaces the slow pattern of calling get_data_from_cube_pid_coord_and_latest_n_periods once per series. *** Typical workflow: 1. search_cubes_by_title("unemployment rate") → find productId 2. get_cube_metadata(productId=...) → find vectorIds for each series you want 3. fetch_vectors_to_database( vectorIds=["v111","v222","v333"], table_name="unemployment_by_province", startRefPeriod="2023-01-01", endRefPeriod="2024-12-31" ) ← single call fetches + stores everything 4. query_database("SELECT * FROM unemployment_by_province") → analyze Args: input_data.vectorIds: List of vector IDs to fetch (strings, e.g. ["111","222"]). input_data.table_name: SQLite table to create and populate. input_data.startRefPeriod: Optional start date (YYYY-MM-DD). input_data.endRefPeriod: Optional end date (YYYY-MM-DD). Returns: Dict with table name, columns, rows_inserted, and a 5-row sample so you can verify the data looks right before querying. IMPORTANT: In your final response cite the vectorIds and reference period used.
| Name | Type | Req | Description |
|---|---|---|---|
| endRefPeriod | – | – | End of the reference period to fetch, inclusive. Format: YYYY-MM-DD. |
| sample_size | – | – | Number of sample rows to include in the response preview. Default 5. |
| startRefPeriod | – | – | Start of the reference period to fetch, inclusive. Format: YYYY-MM-DD. |
| table_name | string | yes | Name of the SQLite table to create and populate. Use snake_case, e.g. 'unemployment_by_province'. |
| vectorIds | array | yes | List of StatCan vector IDs to fetch (e.g. ['111', '222', '333']). Get these from get_cube_metadata → dimension members → vectorId field. |
No output schema declared.
No examples provided.
get_all_cubes_list ~149
Provides 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.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer | – | Max cubes to return. Default 100. |
| offset | integer | – | Number of cubes to skip (for pagination). Default 0. |
No output schema declared.
No examples provided.
get_all_cubes_list_lite ~157
Provides 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.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer | – | Max cubes to return. Default 100. |
| offset | integer | – | Number of cubes to skip (for pagination). Default 0. |
No output schema declared.
No examples provided.
get_bulk_vector_data_by_range ~427
Fetches 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/endPeriod) when you want: "data for the time period YYYY to YYYY" get_sdmx_vector_data is more reliable and filters by reference period, not release date. *** LARGE RESPONSE WARNING *** This tool can return hundreds of flattened data points. If the response exceeds context limits, narrow the request: use fewer vectorIds, or use offset/limit pagination to page through results in smaller chunks. Response is pre-flattened: each element is one data point with vectorId, productId, coordinate, and all value fields injected at the top level. Disables SSL Verification. Corresponds to: POST /getBulkVectorDataByRange Returns: List[Dict[str, Any]]: Flat list of data point dicts, each tagged with vectorId, productId, and coordinate. Raises: httpx.HTTPStatusError: If the API returns an error status code. ValueError: If the API response format is unexpected or no vectors return 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 vector data, this means including the VectorId and Release Time.
| Name | Type | Req | Description |
|---|---|---|---|
| endDataPointReleaseDate | – | – | – |
| limit | – | – | Max rows to return. Default 50. Set higher to get more rows. |
| offset | – | – | Number of rows to skip (for pagination). Default 0. |
| startDataPointReleaseDate | – | – | – |
| vectorIds | array | yes | List of integer vector IDs (e.g. [42076, 41690973]). |
No output schema declared.
No examples provided.
get_changed_cube_list ~110
Get 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) and Title.
| Name | Type | Req | Description |
|---|---|---|---|
| date | string | yes | – |
No output schema declared.
No examples provided.
get_changed_series_data_from_cube_pid_coord ~198
Retrieves 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.
| Name | Type | Req | Description |
|---|---|---|---|
| coordinate | string | yes | Coordinate string (e.g., '1.1'). Padding to 10 dimensions is handled automatically. |
| productId | integer | yes | – |
No output schema declared.
No examples provided.
get_changed_series_data_from_vector ~151
Get changed series data (data points that have changed) for a series identified by Vector ID. Disables SSL Verification. Corresponds to: POST /getChangedSeriesDataFromVector 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.
| Name | Type | Req | Description |
|---|---|---|---|
| vectorId | integer | yes | – |
No output schema declared.
No examples provided.
get_changed_series_list ~158
Get the list of series (vectorId, productId, coordinate, releaseTime) that were updated on a specific date (YYYY-MM-DD). Disables SSL Verification. Corresponds to: GET /getChangedSeriesList/{date} Returns: List[Dict[str, Any]]: A list of dictionaries describing changed series objects. Raises: httpx.HTTPStatusError: If the API returns an error status code. ValueError: If date format is invalid or 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 changed series, this means including the VectorId.
| Name | Type | Req | Description |
|---|---|---|---|
| date | string | yes | – |
No output schema declared.
No examples provided.
get_code_sets ~136
Retrieves 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.
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
get_cube_metadata ~305
Retrieves 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.
| Name | Type | Req | Description |
|---|---|---|---|
| productId | integer | yes | – |
| summary | boolean | – | When True (default), returns a compact summary: essential cube metadata, dimension names, 3 sample members per dimension, and _next_steps guidance. Set to False only when you need the full raw member… |
No output schema declared.
No examples provided.
get_sdmx_data ~700
Fetch 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=1 (wildcard — preferred for multi-geo) "1+2.2.1" = Geography 1 or 2, Gender=2, Age=1 (OR) IMPORTANT — key position codes: - Use member IDs from get_cube_metadata(), NOT SDMX codelist positions from get_sdmx_structure(). Member IDs and SDMX codelist codes are the same numbers. - Wildcard (omit a position) returns a SPARSE SAMPLE for large dimensions — do NOT use wildcard for dimensions with >30 codes (e.g. NOC occupations, CMA geographies). Use explicit member IDs joined with '+' instead. - To get all leaf IDs for a large dimension as a ready-to-use OR string, call get_sdmx_key_for_dimension(productId, dimension_position) first. Time filtering (use one or the other, not both): lastNObservations=12 → last 12 periods (e.g. 1 year of monthly data) startPeriod="2020" → from 2020 onwards (annual); "2020-01" for monthly endPeriod="2023-12" → up to Dec 2023 LIMITATION: StatCan rejects combining lastNObservations with startPeriod/endPeriod (returns 406). NOTE: OR syntax (+) triggers a StatCan SDMX-JSON encoding bug (non-positional series keys). This is automatically corrected before rows are returned, so all OR-ed dimension labels should be present. Output rows contain: dimension values, "period", "value", SCALAR_FACTOR, UOM, VECTOR_ID, STATUS, and other SDMX attributes. Rows are returned inline, capped at MAX_SDMX_ROWS (500). For larger result sets, narrow the key or use startPeriod/endPeriod/lastNObservations. IMPORTANT: In your final response to the user, you MUST cite the source of your data. This means including the _sdmx_url, tabl…
| Name | Type | Req | Description |
|---|---|---|---|
| endPeriod | – | – | End period in YYYY or YYYY-MM format. |
| key | string | yes | Dot-separated dimension codes in position order (e.g. '1.2.1'). Use '+' for OR ('1+2.2.1' = Geography 1 or 2). Omit a value for wildcard ('.2.1' = all geographies, Gender=2, Age=1). Code numbers matc… |
| lastNObservations | – | – | Return only the last N observations per series (e.g. 12 for one year of monthly data). |
| productId | integer | yes | – |
| startPeriod | – | – | Start period in YYYY or YYYY-MM format. |
No output schema declared.
No examples provided.
get_sdmx_key_for_dimension ~326
Return 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) codelists every code is a leaf. Example: get_sdmx_key_for_dimension(productId=98100452, dimension_position=6) → { "dimension_id": "Occupation_...", "dimension_name": "Occupation - Minor group - NOC 2021", "position": 6, "leaf_count": 162, "total_count": 309, "or_key": "7+11+12+13+16+18+21+23+...", "note": "Paste or_key at position 6 in your get_sdmx_data key." } Then use the or_key directly: get_sdmx_data(productId=98100452, key="7.3.1.1.1.<or_key>.1", ...)
| Name | Type | Req | Description |
|---|---|---|---|
| dimension_position | integer | yes | 1-based position of the dimension in the SDMX key (use get_sdmx_structure to find positions). E.g. position=6 for the 6th dot-separated slot. |
| productId | integer | yes | – |
No output schema declared.
No examples provided.
get_sdmx_rows ~327
Fetch SDMX observations and always return rows inline — use this when you need to embed data in an artifact or widget. Use this tool when you need rows embedded directly in an artifact or widget: - Building a chart, table, or widget artifact that needs data at construction time - Sorting/filtering a small result set before embedding Same key syntax and time parameters as get_sdmx_data — see that tool's description for key construction rules and wildcard warnings. Rows are capped at MAX_SDMX_ROWS. For large dimensions use get_sdmx_key_for_dimension to build a precise OR key before calling this. IMPORTANT: In your final response to the user, cite the _sdmx_url, table productId, and key used.
| Name | Type | Req | Description |
|---|---|---|---|
| endPeriod | – | – | End period in YYYY or YYYY-MM format. |
| key | string | yes | Dot-separated dimension codes in position order (e.g. '1.2.1'). Use '+' for OR ('1+2.2.1' = Geography 1 or 2). Omit a value for wildcard ('.2.1' = all geographies, Gender=2, Age=1). Code numbers matc… |
| lastNObservations | – | – | Return only the last N observations per series (e.g. 12 for one year of monthly data). |
| productId | integer | yes | – |
| startPeriod | – | – | Start period in YYYY or YYYY-MM format. |
No output schema declared.
No examples provided.
get_sdmx_structure ~301
Fetch 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 codelist ID (e.g. "CL_Geography") - codes: list of {id, name, ?parent} — truncated to 10 for large codelists - _code_count / _truncated: total size and truncation flag Key construction rules: - "1.2.1" = position-1 code 1, position-2 code 2, position-3 code 1 - ".2.1" = wildcard position 1 (all geographies), Gender=2, Age=1 - "1+2.2.1" = Geography 1 or 2 (OR syntax) - WDS memberIds == SDMX codelist codes — no translation needed IMPORTANT: In your final response to the user, you MUST cite the source of your data. This means including the _sdmx_url.
| Name | Type | Req | Description |
|---|---|---|---|
| productId | integer | yes | – |
No output schema declared.
No examples provided.
get_sdmx_vector_data ~278
Fetch 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_from_cube_pid_coord or get_cube_metadata 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" → up to Dec 2023 LIMITATION: StatCan rejects combining lastNObservations with startPeriod/endPeriod (returns 406). Output rows contain: dimension values, "period", "value", SCALAR_FACTOR, UOM, VECTOR_ID, STATUS, and other SDMX attributes. IMPORTANT: In your final response to the user, you MUST cite the source of your data. This means including the _sdmx_url,and vectorId in your response.
| Name | Type | Req | Description |
|---|---|---|---|
| endPeriod | – | – | End period in YYYY or YYYY-MM format. |
| lastNObservations | – | – | Return only the last N observations (e.g. 5 for last 5 periods). |
| startPeriod | – | – | Start period in YYYY or YYYY-MM format. |
| vectorId | integer | yes | – |
No output schema declared.
No examples provided.
get_series_info ~288
Resolve 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. Coordinates are automatically padded to 10 dimensions. Corresponds to: POST /getSeriesInfoFromCubePidCoord (accepts array) NOTE: Response fields like scalarFactorCode, frequencyCode, and memberUomCode use StatCan numeric codes. Call get_code_sets() to decode them (e.g. frequencyCode 6 = "Monthly", scalarFactorCode 0 = "Units"). Returns: List of series metadata dicts, paginated with _guidance if >50 results. Raises: httpx.HTTPStatusError: If the API returns an error status code. ValueError: If no items return SUCCESS. Exception: For other network or unexpected errors. IMPORTANT: In your final response cite the ProductId and Coordinate for each series.
| Name | Type | Req | Description |
|---|---|---|---|
| items | array | yes | List of {productId, coordinate} pairs to fetch series info for in a single batch call. |
| limit | – | – | Max results to return. Default 50. |
| offset | – | – | Number of results to skip (for pagination). Default 0. |
No output schema declared.
No examples provided.
get_series_info_from_vector ~154
Request series metadata (productId, coordinate, titles, frequency, etc.) by Vector ID. Disables SSL Verification. Corresponds to: POST /getSeriesInfoFromVector Returns: Dict[str, Any]: A dictionary containing the series metadata 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 series info, this means including the VectorId, ProductId (pid), and Coordinate.
| Name | Type | Req | Description |
|---|---|---|---|
| vectorId | integer | yes | – |
No output schema declared.
No examples provided.
get_table_schema ~66
Retrieves the schema (column names and types) for a specific table. Args: table_name_input: Object containing the table_name. Returns: Dict[str, Any]: Dictionary describing the schema or an error message.
| Name | Type | Req | Description |
|---|---|---|---|
| table_name | string | yes | Name of the SQL table. |
No output schema declared.
No examples provided.
insert_data_into_table ~240
Appends rows (list of dicts) into an ALREADY EXISTING SQLite table. Use this only to add more data to a table that was previously created. For the common "fetch API data then store" workflow, use create_table_from_data or fetch_vectors_to_database instead — both create the table AND insert data in a single call, so you do NOT need to call this tool after them. This tool is useful when: - You want to merge data from multiple API calls into one table - You're appending new time periods to an existing dataset Args: table_input: Object containing table_name and data (list of dicts). Returns: Dict[str, str]: A dictionary indicating success (with row count) or failure. IMPORTANT: In your final response to the user, you MUST cite the source of the data you are inserting if it comes from an API call (e.g., "Data from Product ID 123456").
| Name | Type | Req | Description |
|---|---|---|---|
| data | array | yes | Data to insert, as a list of dictionaries. |
| table_name | string | yes | Name for the SQL table (alphanumeric and underscores recommended). |
No output schema declared.
No examples provided.
list_tables ~57
Lists all user-created tables in the SQLite database. Returns: Dict[str, Any]: Dictionary containing a list of table names or an error message. IMPORTANT: The database is persistent. Use this to check for old tables that might need cleaning.
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
query_database ~166
Executes a read-only SQL query (SELECT or PRAGMA) against the database and returns the results. WARNING: Potential security risk! Avoid using this tool with untrusted input or queries that modify data (INSERT, UPDATE, DELETE). Prefer more specific tools like list_tables or get_table_schema when possible. Results may be truncated. Args: query_input: Object containing the sql_query string. Returns: Dict[str, Any]: Dictionary with 'columns', 'rows' (list of dicts), and optionally a 'message', or an error message. IMPORTANT: In your final response to the user, you MUST cite the source of your data (e.g., "Query results from table 'my_analysis'").
| Name | Type | Req | Description |
|---|---|---|---|
| sql_query | string | yes | The SQL query to execute. |
No output schema declared.
No examples provided.
search_cubes_by_title ~192
Searches 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.
| Name | Type | Req | Description |
|---|---|---|---|
| max_results | integer | – | Max matching cubes to return. Default 25. |
| search_term | string | yes | Text to search for in cube titles. Multiple keywords use AND logic. |
No output schema declared.
No examples provided.
store_cube_metadata ~294
Fetches FULL metadata for a cube and stores it into two normalized SQLite tables (_statcan_dimensions, _statcan_members) without returning the full data to the context window. Use this when you need to browse all dimension members or look up vectorIds. The summary returned by get_cube_metadata only shows 5 members per dimension — call this tool first, then use SQL to drill into specific dimensions. Typical workflow: 1. store_cube_metadata(productId=1234567) → stores all members + vectorIds, returns compact summary 2. query_database("SELECT * FROM _statcan_dimensions WHERE pid = 1234567") → see all dimension names and member counts 3. query_database("SELECT member_name_en, vector_id FROM _statcan_members WHERE pid = 1234567 AND dim_index = 2") → browse all members for a specific dimension 4. fetch_vectors_to_database(vectorIds=[...], ...) → fetch the data Tables are shared across multiple pids — calling this for a new pid adds rows without affecting data for other pids already stored. Returns a compact summary: dimension names + member counts + example SQL. IMPORTANT: Cite the productId and cubeTitleEn in your final response.
| Name | Type | Req | Description |
|---|---|---|---|
| productId | integer | yes | The StatCan cube ProductId whose full metadata to fetch and store. |
No output schema declared.
No examples provided.
What is the Statistics Canada MCP Server server?
Statistics Canada MCP Server is listed in the public MCP registry as io.github.Aryan-Jhaveri/mcp-statcan. Access Statistics Canada data via the Web Data Services API. This page covers its PyPI package (statcan-mcp-server).
Is the Statistics Canada MCP Server server safe to use?
Statistics Canada MCP Server scores 63 out of 100 on VerifyMCP. We found no known CVEs affecting it as of 21 September 2026. That is a record of what we were able to check automatically, not an endorsement. The category breakdown on this page shows every signal behind the number, including the ones we could not confirm.
What tools does the Statistics Canada MCP Server server expose?
Statistics Canada MCP Server exposes 25 tools: get_code_sets, get_all_cubes_list, get_all_cubes_list_lite, search_cubes_by_title, get_cube_metadata, and 20 more. Their descriptions and schemas cost roughly 5,954 tokens of context every time the server is loaded.
Is the Statistics Canada MCP Server server still maintained?
Statistics Canada MCP Server is still listed as active in the MCP registry. We last reached this channel on 21 September 2026. Those dates come from our own scans of the registry and the channel itself, not from anything the publisher announced.