SERVER STATUS: ONLINE  |  VERSION 0.11.0  |  TOOLS: 18 REGISTERED
MCP SDK SDMX REST WDS REST v0.11.0 Python 3.10+ Stateless HTTP
Announcements:
NEW 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
NEW v0.11.0 — statcan CLI for agents: --json envelopes, stable exit codes with hints, statcan describe; fixes for single-period monthly dates and frequency labels
• v0.10.0 — structured output: SDMX tools publish an outputSchema and return typed structuredContent; failures are flagged isError; responses are 25–40% smaller
• v0.9.0 — query_sdmx on this server: fetch a table slice and run one read-only SQL query server-side; only the answer is returned, with no 500-row cap on the fetch
• v0.8.0 — fetch_sdmx_to_database (local install): store a full SDMX slice in SQLite without passing rows through the model; values stored as numbers
• v0.7.16 — statcan download now requires --key; StatCan SDMX no longer accepts the all shortcut
• v0.7.15 — OAuth 2.1/PKCE support: Claude.ai web connector now routes tool calls correctly
• v0.7.14 — fixed 307 redirect loop on POST /mcp; Claude.ai IPs now receive 200 OK
• v0.7.9 — automated CI/CD: version bumps on push, landing announcement workflow
• v0.7.8 — tool-level request logging and /.well-known/mcp.json discovery
• 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.onrender.com/mcp

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

Claude Desktop (claude_desktop_config.json)

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

Claude Code (.mcp.json)

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

Claude Code (command line)

claude mcp add --transport http statcan https://mcp-statcan.onrender.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 (18)

All tools below are exposed over the /mcp endpoint. The hosted HTTP server 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, use query_sdmx: the SQL runs here and only the answer is sent back to the model.

Tool Name Category Description
search_cubes_by_titleDiscoveryFull-text keyword search across all StatCan tables, capped at 25 results
get_all_cubes_listDiscoveryPaginated inventory of all tables (100/page)
get_all_cubes_list_liteDiscoveryLightweight paginated list, 1-hour TTL cache
get_cube_metadataMetadataFull table structure: dimensions, members, frequencies; summary mode caps members at 10
get_code_setsMetadataWDS attribute decoder tables (scalar type, UOM, frequency, status codes)
get_series_infoSeriesResolve dimension coordinates to vectorId, frequency, UOM
get_series_info_from_vectorSeriesLook up series metadata by vectorId
get_bulk_vector_data_by_rangeVectorFetch multiple vectors filtered by release-date range
get_changed_series_data_from_vectorChange DetectionDetect data changes for a vector since a given date
get_changed_series_data_from_cube_pid_coordChange DetectionDetect changes for a specific series by coordinate
get_changed_cube_listChange DetectionList all tables with data changes since a given date
get_changed_series_listChange DetectionList all series with changes since a given date
get_sdmx_structureSDMXData Structure Definition as JSON: dimension positions and codelists with hierarchy
get_sdmx_dataSDMXServer-side filtered observations by productId + SDMX key string
get_sdmx_rowsSDMXInline tabular rows (up to 500) returned directly in the tool response
query_sdmxSDMX + SQLFetch observations and run one read-only SQL query server-side in a temporary in-memory table; returns only the result (rank, compare, growth)
get_sdmx_vector_dataSDMXSingle vectorId observations via SDMX
get_sdmx_key_for_dimensionSDMXReturns the full OR-key for a large dimension (avoids wildcard sampling errors)

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 all SDMX tools; read-only tools carry readOnlyHint
Max SDMX Rows500 per get_sdmx_data call
Server-side SQLquery_sdmx: 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 get_all_cubes_list_lite
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.