SERVER STATUS: ONLINE  |  VERSION 0.19.0  |  TOOLS: 5 REGISTERED
MCP SDK SDMX REST WDS REST v0.19.0 Python 3.10+ Stateless HTTP
Announcements:
NEW v0.19.0 — get_sdmx_data(format="csv") returns a compact CSV about 3× smaller to copy into files; key_template on every search result; labels fall back to WDS metadata when StatCan serves an incomplete structure
• v0.18.0 — the 5-tool core toolset is now the default: about 939 tokens in tools/list, down from 17 tools / about 8,044 (STATCAN_TOOLSET=legacy restores the old set); retries for stalled StatCan requests; truncated table structures are no longer cached
• v0.17.0 — search is paged (10 per page, offset) with SDMX key templates; get_sdmx_data summarizes results over 100 observations unless full=true; keys are validated against the table structure, so a bad key fails at once instead of hanging
• v0.16.0 — compact output: observations grouped by series, slimmer search results, get_code_sets summary by default; read-only annotations on every tool; fixes for bulk vector range and changed-series requests
• v0.15.0 — the interactive chart view was removed; agents get full rows; server now at mcp-statcan.com
• v0.14.0 — experimental interactive chart and table view (MCP Apps), removed again in v0.15.0
• v0.12.0 — data correctness: SDMX data now read as XML; wildcards return every series (previously a partial set), and VECTOR_ID, DGUID and UOM are correct per row
• Listed on the MCP server registry
Abstract. This server exposes Statistics Canada’s Web Data Service (WDS) and SDMX REST API as a suite of Model Context Protocol (MCP) tools. Language models connect via the /mcp endpoint and gain structured access to over 7,000 Canadian statistical tables — labour force, GDP, inflation, demographics, health, environment, and more. The server operates in a fully stateless mode: no session state is retained between requests, enabling horizontal scaling and simplified deployment on platforms such as Render.

Connection Instructions

Add this server to your MCP client using the Streamable HTTP transport. No API key is required — Statistics Canada data is publicly available.

MCP Endpoint
https://mcp-statcan.com/mcp

Health Check
https://mcp-statcan.com/health

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "statcan": {
      "type": "http",
      "url": "https://mcp-statcan.com/mcp"
    }
  }
}

Claude Code (.mcp.json)

{
  "mcpServers": {
    "statcan": {
      "type": "http",
      "url": "https://mcp-statcan.com/mcp"
    }
  }
}

Claude Code (command line)

claude mcp add --transport http statcan https://mcp-statcan.com/mcp

Local install (stdio, includes SQLite tools and the statcan CLI)

pip install statcan-mcp-server

CLI for agents with a shell (JSON output, stable exit codes)

statcan describe

statcan --json download 18-10-0004-01 --key "2+3.2" --last 12 --output cpi.csv
Note: This server is deployed on Render’s free tier. The first request after a period of inactivity may take 30–60 seconds while the instance spins up. Subsequent requests are fast.

Command-Line Interface

The statcan CLI ships with the local install and works without an LLM. People can browse tables in the terminal; agents with a shell can use --json for structured output and stable exit codes.

Exploring a table: search, metadata, download

Terminal recording: statcan search, statcan metadata and statcan download for the Consumer Price Index table
statcan search → statcan metadata → statcan download (table output)

Agent mode: JSON envelopes and exit codes

Terminal recording: statcan --json download writes a CSV and prints a summary envelope; a missing product returns a JSON error with exit code 3; statcan describe lists exit codes
--json download writes the file and prints a summary; failures return a typed exit code and a hint

Registered Tools (5)

The hosted server publishes the core toolset below over the /mcp endpoint (about 939 tokens in tools/list, down from about 8,044 for the 17-tool legacy set). It runs in stateless mode — composite and SQLite database tools are intentionally omitted here. To use those, run the server locally over stdio (pip install statcan-mcp-server). For calculations on this server, pass sql to get_sdmx_data: the SQL runs here and only the answer is sent back to the model.

Tool Name Category Description
search_cubes_by_titleDiscoveryFind tables by title keywords (English or French), paged; every result on the page includes the SDMX key template
get_sdmx_structureSDMXDimensions in key order with their codes; search finds codes by label, dimension lists one full dimension plus its leaf_key
get_sdmx_dataSDMX + SQLObservations by productId + key, or one vectorId; summary over 100 observations unless full; format="csv" returns every observation as a compact CSV (about 3× smaller to copy into a file); optional sql runs one read-only query server-side and returns only the result
get_series_infoSeriesproductId + coordinates, or vectorIds: decoded frequency, unit and scalar, titles (English and French), SDMX key
get_changesChange DetectionTables released on a date (default today), or new data points for one series

Set STATCAN_TOOLSET=legacy (or --toolset legacy) on a self-hosted server for the previous tool set.


Technical Specifications

TransportStreamable HTTP (stateless) — MCP 2025-03-26 spec
Upstream APIsStatistics Canada WDS REST + SDMX 2.1 REST (data read as structure-specific XML)
AuthenticationOAuth 2.1/PKCE available (auto-approved, no credentials); open access also supported
SSL VerificationOn by default; STATCAN_VERIFY_SSL=false disables it for broken trust stores
Structured OutputoutputSchema + structuredContent on the SDMX data and structure tools; read-only tools carry readOnlyHint
Max SDMX Rows500 per get_sdmx_data call
Server-side SQLget_sdmx_data with sql: SQLite in-memory, one SELECT per call, 2 s limit, up to 50,000 fetched rows, 500 result rows; nothing stored
Cache1-hour TTL on the cube list and on table structures
Python3.10+ — asyncio, httpx, Starlette, Uvicorn
Installpip install statcan-mcp-server
Sourcegithub.com/Aryan-Jhaveri/mcp-statcan

Known Constraints & Notes


Data Attribution

All data returned by this server originates from Statistics Canada. Users are responsible for complying with Statistics Canada’s Open Licence when using or redistributing data obtained through this server. This MCP server is an independent project and is not affiliated with or endorsed by Statistics Canada or the Government of Canada.