CAT
/MCP
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Cross AI Tools

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by @mertduzgun

Independent project, not affiliated with Anthropic

Statistics Canada MCP Server

aryan-jhaveri/mcp-statcan
515 toolsSTDIOregistry active
Summary

Gives Claude direct access to Statistics Canada's Web Data Service and SDMX REST APIs for retrieving official Canadian economic, demographic, and social statistics. You get tools to search datasets by keyword, fetch time series data with configurable date ranges, and pull metadata for tables and indicators. Comes with a standalone CLI if you want to download CSV exports without an LLM in the loop. The developer hosts a public HTTP endpoint on Render, so most users can connect without installing anything locally. Stdio mode adds SQLite tools for storing and querying datasets with SQL. Useful when you need authoritative Canadian data for analysis, dashboards, or fact checking economic claims without manually browsing StatCan's web interface.

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →

Tools

Public tool metadata for what this MCP can expose to an agent.

15 tools
list_cubesSearch Statistics Canada datasets by keyword. Returns a list of cubes (datasets) from StatsCan. If a keyword is provided, filters results by searching in the English dataset titles. Results are limited to prevent overwhelming responses. :param keyword: Optional search term to...2 params

Search Statistics Canada datasets by keyword. Returns a list of cubes (datasets) from StatsCan. If a keyword is provided, filters results by searching in the English dataset titles. Results are limited to prevent overwhelming responses. :param keyword: Optional search term to...

Parameters* required
keywordvalue
default_limitvalue
default: 50
list_cubes_fullSearch Statistics Canada datasets by keyword (full metadata). Returns a list of cubes with complete metadata including dimensions, frequencies, and survey information. Use list_cubes for a lightweight version with minimal fields. :param keyword: Optional search term to filter...2 params

Search Statistics Canada datasets by keyword (full metadata). Returns a list of cubes with complete metadata including dimensions, frequencies, and survey information. Use list_cubes for a lightweight version with minimal fields. :param keyword: Optional search term to filter...

Parameters* required
keywordvalue
default_limitvalue
default: 50
get_cube_metadataGet detailed metadata for a Statistics Canada dataset. Returns structure information including dimensions, members, and date ranges. :param product_id: The StatsCan product/cube ID (e.g., 18100004) :type product_id: int :return: Dictionary with cube metadata or error details :...1 params

Get detailed metadata for a Statistics Canada dataset. Returns structure information including dimensions, members, and date ranges. :param product_id: The StatsCan product/cube ID (e.g., 18100004) :type product_id: int :return: Dictionary with cube metadata or error details :...

Parameters* required
product_idinteger
get_vector_data_by_rangeFetch time series data for a specific Statistics Canada vector. Returns actual data values over time for the specified vector. :param vector_id: The vector ID number (e.g., 41690973) :type vector_id: int :param start_date: Start date in YYYY-MM-DD format (e.g., 2020-01-01) :ty...3 params

Fetch time series data for a specific Statistics Canada vector. Returns actual data values over time for the specified vector. :param vector_id: The vector ID number (e.g., 41690973) :type vector_id: int :param start_date: Start date in YYYY-MM-DD format (e.g., 2020-01-01) :ty...

Parameters* required
end_datestring
vector_idinteger
start_datestring
get_tableGet rectangular data slice from a Statistics Canada dataset. Fetches the latest N periods of data for specific dimension coordinates. :param product_id: The StatsCan product/cube ID (e.g., 35100003) :param coordinate: Dimension coordinate string (e.g., "1.12.0.0.0.0.0.0.0.0")...3 params

Get rectangular data slice from a Statistics Canada dataset. Fetches the latest N periods of data for specific dimension coordinates. :param product_id: The StatsCan product/cube ID (e.g., 35100003) :param coordinate: Dimension coordinate string (e.g., "1.12.0.0.0.0.0.0.0.0")...

Parameters* required
latest_ninteger
coordinatestring
product_idinteger
get_vector_infoGet metadata for a specific Statistics Canada vector. Returns information about the vector including its parent cube, coordinates, frequency, title, and other metadata (not the actual data). :param vector_id: The vector ID number (e.g., 41690973) :type vector_id: int :return:...1 params

Get metadata for a specific Statistics Canada vector. Returns information about the vector including its parent cube, coordinates, frequency, title, and other metadata (not the actual data). :param vector_id: The vector ID number (e.g., 41690973) :type vector_id: int :return:...

Parameters* required
vector_idinteger
get_series_infoGet metadata for a specific series within a Statistics Canada dataset. Returns series information based on cube product ID and dimension coordinates. :param product_id: The StatsCan product/cube ID (e.g., 35100003) :param coordinate: Dimension coordinate string (e.g., "1.12.0....2 params

Get metadata for a specific series within a Statistics Canada dataset. Returns series information based on cube product ID and dimension coordinates. :param product_id: The StatsCan product/cube ID (e.g., 35100003) :param coordinate: Dimension coordinate string (e.g., "1.12.0....

Parameters* required
coordinatestring
product_idinteger
get_changed_cubesGet list of Statistics Canada cubes/datasets changed on a specific date. Returns cubes that were updated or released on the specified date. :param date: Date to check for changes in YYYY-MM-DD format (e.g., "2024-01-15") :return: Dictionary with list of changed cubes or error...1 params

Get list of Statistics Canada cubes/datasets changed on a specific date. Returns cubes that were updated or released on the specified date. :param date: Date to check for changes in YYYY-MM-DD format (e.g., "2024-01-15") :return: Dictionary with list of changed cubes or error...

Parameters* required
datestring
get_changed_seriesGet list of Statistics Canada series updated today. Returns all series that have been updated on the current day. This endpoint has no parameters - it always returns today's changes. :return: Dictionary with list of changed series or error details

Get list of Statistics Canada series updated today. Returns all series that have been updated on the current day. This endpoint has no parameters - it always returns today's changes. :return: Dictionary with list of changed series or error details

No parameter schema in public metadata yet.

get_changed_vector_dataGet changed/updated data for a specific Statistics Canada vector. Returns the latest changes for a vector if it was updated today. :param vector_id: The vector ID number (e.g., 32164132) :return: Dictionary with changed vector data or error details1 params

Get changed/updated data for a specific Statistics Canada vector. Returns the latest changes for a vector if it was updated today. :param vector_id: The vector ID number (e.g., 32164132) :return: Dictionary with changed vector data or error details

Parameters* required
vector_idinteger
get_changed_series_dataGet changed/updated data for a specific series within a Statistics Canada dataset. Returns the latest changes for a series identified by cube ID and coordinates, if it was updated today. :param product_id: The StatsCan product/cube ID (e.g., 35100003) :param coordinate: Dimens...2 params

Get changed/updated data for a specific series within a Statistics Canada dataset. Returns the latest changes for a series identified by cube ID and coordinates, if it was updated today. :param product_id: The StatsCan product/cube ID (e.g., 35100003) :param coordinate: Dimens...

Parameters* required
coordinatestring
product_idinteger
get_vectors_latestGet latest N periods of data for multiple Statistics Canada vectors. Fetches the most recent data points for one or more vectors in a single request. :param vector_ids: List of vector ID numbers (e.g., [32164132, 41690973]) :param latest_n: Number of latest periods to retrieve...2 params

Get latest N periods of data for multiple Statistics Canada vectors. Fetches the most recent data points for one or more vectors in a single request. :param vector_ids: List of vector ID numbers (e.g., [32164132, 41690973]) :param latest_n: Number of latest periods to retrieve...

Parameters* required
latest_ninteger
vector_idsarray
get_bulk_vectorsGet bulk vector data by release date range for multiple Statistics Canada vectors. Fetches data for multiple vectors based on when the data points were released. :param vector_ids: List of vector ID numbers (e.g., [74804, 1]) :param start_release_date: Start datetime in ISO fo...3 params

Get bulk vector data by release date range for multiple Statistics Canada vectors. Fetches data for multiple vectors based on when the data points were released. :param vector_ids: List of vector ID numbers (e.g., [74804, 1]) :param start_release_date: Start datetime in ISO fo...

Parameters* required
vector_idsarray
end_release_datestring
start_release_datestring
get_full_table_csvGet download URL for full Statistics Canada table in CSV format. Returns a URL to a downloadable ZIP file containing the complete table data. :param product_id: The StatsCan product/cube ID (e.g., 14100287) :param language: Language code - "en" for English or "fr" for French (...2 params

Get download URL for full Statistics Canada table in CSV format. Returns a URL to a downloadable ZIP file containing the complete table data. :param product_id: The StatsCan product/cube ID (e.g., 14100287) :param language: Language code - "en" for English or "fr" for French (...

Parameters* required
languagevalue
default: en
product_idinteger
get_full_table_sdmxGet download URL for full Statistics Canada table in SDMX format. Returns a URL to a downloadable ZIP file containing the complete table data in SDMX (Statistical Data and Metadata eXchange) format. This is a bilingual XML format used for international statistical data exchang...1 params

Get download URL for full Statistics Canada table in SDMX format. Returns a URL to a downloadable ZIP file containing the complete table data in SDMX (Statistical Data and Metadata eXchange) format. This is a bilingual XML format used for international statistical data exchang...

Parameters* required
product_idinteger

Statistics Canada MCP Server

Statistics Canada MCP Server

Python 3.10+ License: MIT MCP GitHub SafeSkill 93/100

MCP server and CLI for Statistics Canada's Web Data Service (WDS) and SDMX REST API. Gives any MCP client — Claude, Cursor, VS Code Copilot, Gemini — structured access to Canadian statistical data. Includes a standalone statcan CLI for direct downloads without an LLM.

Hosted on Render — no install required for most users. See Quick Start.

⚠️ LLMs may fabricate data. Always verify important figures against official Statistics Canada sources.


Table of Contents

  • Quick Start
  • Examples
  • Setup by Client
  • How Claude.ai Uses This Server
  • MCP Prompts
  • statcan CLI
  • Features & Tools
  • Project Structure
  • Known Issues

Quick Start

Pick the option that fits you. You don't need to install anything for Option 1.

Option 1 — Use the hosted server (recommended)

Connect directly to the public server on Render. No uv, no terminal, no local setup.

Claude Desktop / Claude.ai

  1. Open Settings → Connectors → Add Custom Connector
  2. Name: mcp-statcan
  3. URL: https://mcp-statcan.onrender.com/mcp
  4. Save and restart

Claude Code

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

The hosted server provides all WDS + SDMX tools. Database tools (SQLite) require local setup (Option 3) — they are intentionally excluded from the shared server.


Option 2 — Self-host HTTP (WDS + SDMX, no DB)

Run a local server with the same tools as the hosted version.

Step 1 — Install uv:

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Step 2 — Start the server:

uvx statcan-mcp-server --transport http
# Listening at http://localhost:8000

Step 3 — Connect your client to http://localhost:8000/mcp.


Option 3 — Full local setup (WDS + SDMX + SQLite)

Everything from Option 2, plus database tools for storing and querying data with SQL. Runs via stdio.

Step 1 — Install uv (same as above).

Step 2 — Configure your client with the stdio snippets in Setup by Client below.

uvx downloads and runs the server automatically on first use.


Option 4 — statcan CLI (no LLM needed)

Download StatCan data directly from the terminal. See statcan CLI.

uvx statcan-mcp-server        # installs the package
statcan search "labour force"
statcan download 14-10-0287-01 --last 12 --output lfs.csv

Examples

Chat examples

DatasetQueryDemoSource
Canada's Greenhouse Gas Emissions"Create a simple visualization for greenhouse emissions for Canada as a whole over the last 4 years"ChatTable 38-10-0097-01
Canada's International Trade in Services"Create a quick analysis for international trade in services for the last 6 months with a visualization"ChatTable 12-10-0144-01
Ontario Building Construction Price Index"Generate a visualization for Ontario's Building Price index from Q4 2023 to Q4 2024"ChatTable 18-10-0289-01
Canadian Unemployment Dashboard"Create a Canadian Unemployment Dashboard using statcan mcp"ChatTable 14-10-0287-01

Dashboard examples

TitleLinkSource
Canada's Critical Minerals EconomyDashboardTable 36-10-0708-01
Price of Everything: CPI Dashboard 2015–2026DashboardTable 18-10-0004-01
Canada's Biomedical & Biotech IndustriesDashboardTable 27-10-0297-01

Setup by Client

Hosted server (Option 1)

Claude Desktop — Settings → Connectors → Add Custom Connector

  • Name: mcp-statcan
  • URL: https://mcp-statcan.onrender.com/mcp

Claude Code

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

Cursor — .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

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

VS Code (GitHub Copilot) — .vscode/mcp.json:

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

Self-hosted HTTP (Option 2)

Start uvx statcan-mcp-server --transport http first, then configure your client.

Most clients need mcp-proxy to bridge stdio ↔ HTTP. Claude Code connects natively.

Claude Desktop — Settings → Developer → Edit Config:

{
  "mcpServers": {
    "statcan": {
      "command": "uvx",
      "args": ["mcp-proxy", "--transport", "streamablehttp", "http://localhost:8000/mcp"]
    }
  }
}

Claude Code

claude mcp add statcan --transport http http://localhost:8000/mcp --scope global

Cursor / VS Code / Gemini — same mcp-proxy wrapper, pointing to http://localhost:8000/mcp.


Full local / stdio (Option 3)

Claude Desktop — Settings → Developer → Edit Config:

{
  "mcpServers": {
    "statcan": {
      "command": "uvx",
      "args": ["statcan-mcp-server", "--db-path", "/Users/<you>/.statcan-mcp/statcan_data.db"]
    }
  }
}

Pass --db-path with an absolute path. Claude Desktop overrides the subprocess HOME env var, which can break default path resolution.

Claude Code

claude mcp add statcan --scope global -- uvx statcan-mcp-server

Cursor / VS Code / Gemini — use uvx statcan-mcp-server as the stdio command.


How Claude.ai Uses This Server

Claude.ai (web) has no bash sandbox — it can't run shell commands. Instead, it uses MCP tools for discovery and its Python script tool to fetch data without bloating the context window.

The pattern:

1. MCP tools (small payloads — metadata only):
   search_cubes_by_title("labour force")  → productId
   get_sdmx_structure(productId=...)      → dimension layout + codes
   get_sdmx_key_for_dimension(...)        → OR key for large dimensions

2. Python script (data never enters context):
   url = "https://mcp-statcan.onrender.com/files/sdmx/<pid>/<key>?lastNObservations=12"
   → validate URL domain → write to ./statcan_<pid>.csv → print summary only

3. Follow-up script (analysis from local file):
   rows = list(csv.DictReader(open("./statcan_<pid>.csv")))
   → filter / sort / aggregate → print only the result

get_sdmx_data on the hosted server always returns a download_csv URL instead of inline data — data stays out of the context window regardless of response size.

Claude Code (bash sandbox) uses the statcan CLI instead:

statcan search "labour force"
statcan download 14-10-0287-01 --last 12 --output ./lfs.csv
awk -F',' 'NR>1 && $1=="Canada"' ./lfs.csv | sort -t',' -rn -k5 | head -10

MCP Prompts

The server ships five prompts accessible as slash commands in supported clients. Each has dual instructions — Claude Code (bash) and Claude.ai web (Python script).

PromptWhat it teaches
/statcan-data-lookupEnd-to-end: search → structure → build key → fetch to local file → analyze
/sdmx-key-builderSDMX key syntax: wildcards, OR keys, time parameters, download URL format
/statcan-downloadDownload a specific table: CLI commands + Python script alternative
/statcan-exploreSample before committing: 3-period fetch, column layout, size estimate
/statcan-vector-pipelineMulti-series download and cross-series comparison

Usage in Claude Code:

/statcan-data-lookup topic="consumer price index" analysis_goal="trend last 5 years"
/statcan-download product_id=18100004 last_n=24

statcan CLI

A standalone CLI for downloading StatCan data without an LLM. Outputs pipe-friendly CSV/JSON to stdout; progress and errors go to stderr.

Install:

pip install statcan-mcp-server   # or: uvx statcan-mcp-server (no install)

Commands:

statcan search <term>            Search tables by keyword
statcan metadata <product-id>    Show table structure (dimensions + members)
statcan download <product-id>    Download observations via SDMX
statcan vector <vector-id>...    Download one or more vector series
statcan codeset                  Show StatCan code definitions (UOM, frequency, etc.)

Common usage:

# Find a table
statcan search "consumer price index"
statcan search "labour force" --max-results 10 --format json

# Inspect structure before downloading
statcan metadata 18-10-0004-01
statcan metadata 18100004 --full        # show all dimension members

# Download data
statcan download 18-10-0004-01 --last 12 --output cpi.csv
statcan download 18-10-0004-01 --key "1.1.1" --start 2020-01 --end 2024-12
statcan download 18-10-0004-01 --last 5 --dry-run   # preview SDMX URL

# Download by vector ID
statcan vector v41690973 --last 24 --output series.csv
statcan vector v41690973 v41690974 --last 12 --output multi.csv

# Decode numeric codes
statcan codeset --type uom
statcan codeset --type frequency --format json

Output formats: csv (default for download/vector), table (default for search/metadata/codeset), json

Pipe patterns:

# Top 10 by value
statcan download 14-10-0287-01 --last 1 --format csv \
  | awk -F',' 'NR>1' | sort -t',' -k5 -rn | head -10

# Extract unique geographies
statcan download 14-10-0287-01 --last 1 --format csv \
  | awk -F',' 'NR>1 {print $1}' | sort -u

# Chain search → download
PID=$(statcan search "CPI" --format json | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['Product ID'])")
statcan download $PID --last 12 --output cpi.csv

For the complete CLI reference see cli.md.


Features & Tools

SDMX Tools — server-side filtered data fetch

Only the slice you request is returned. No downloading full tables.

ToolDescription
get_sdmx_structureDimension codelists + key syntax for a table. Call before get_sdmx_data.
get_sdmx_dataFiltered observations by productId + key. Returns a CSV download URL on the hosted server — data stays out of context.
get_sdmx_vector_dataObservations for a single vectorId via SDMX.
get_sdmx_key_for_dimensionAll leaf member IDs for a large dimension as a ready-to-paste OR key. Use when a dimension has >30 codes (e.g. NOC, CMAs).

Key syntax (passed to get_sdmx_data):

  • "1.2.1" — Geography=1, Gender=2, Age=1
  • ".2.1" — all geographies (wildcard), Gender=2, Age=1
  • "1+2.2.1" — Geography 1 or 2, Gender=2, Age=1

Note: Wildcard (.) on dimensions with >30 codes returns a sparse, unpredictable sample. Use get_sdmx_key_for_dimension to get the correct OR key.

WDS Discovery & Metadata

ToolDescription
search_cubes_by_titleFull-text search across all StatCan tables. AND logic, capped at 25 results.
get_all_cubes_list / _litePaginated table inventory (offset/limit, default 100/page).
get_cube_metadataDimension info, member lists, date ranges. summary=True caps members at 10 per dimension.
get_code_setsDecode StatCan numeric codes (frequency, UOM, scalar factor, status).

WDS Series Resolution & Change Detection

ToolDescription
get_series_infoResolve {productId, coordinate} pairs to vectorId + metadata.
get_series_info_from_vectorResolve a vectorId to productId, coordinate, titles, frequency.
get_changed_cube_listTables updated on a specific date.
get_changed_series_listSeries updated on a specific date.
get_changed_series_data_from_cube_pid_coordData points that changed for a coordinate.
get_changed_series_data_from_vectorData points that changed for a vectorId.
get_bulk_vector_data_by_rangeMultiple vectors filtered by release date range.

Composite & Database Tools (local/stdio mode only)

These tools are not available on the hosted Render server — SQLite is per-process and not shared across users.

ToolDescription
fetch_vectors_to_databaseFetch vectors by reference period range and store to SQLite.
store_cube_metadataFetch full cube metadata into SQLite — browse all members and vectorIds with SQL.
query_databaseRead-only SQL against the local SQLite database.
create_table_from_data / insert_dataCreate or append to a table.
list_tables / get_table_schema / drop_tableDatabase utilities.

Typical workflow

Claude.ai web (hosted server):

1. search_cubes_by_title("unemployment rate")
   → productId e.g. 14100287

2. get_sdmx_structure(productId=14100287)
   → dimension positions + sample codes

3. get_sdmx_key_for_dimension(productId=14100287, dimension_position=3)
   → or_key for large dimensions

4. get_sdmx_data(productId=14100287, key=".2.1", lastNObservations=24)
   → returns download_csv URL

5. Python script: validate URL domain → write to ./statcan_14100287.csv → analyze → print summary

Claude Code (bash sandbox):

statcan search "unemployment rate"
statcan metadata 14100287
statcan download 14-10-0287-01 --last 24 --output ./lfs.csv
awk -F',' 'NR>1 && $1=="Canada"' ./lfs.csv | sort -t',' -rn -k5 | head -10

Project Structure

src/
├── api/
│   ├── cube/
│   │   ├── discovery.py         # search_cubes_by_title, get_all_cubes_list
│   │   ├── metadata.py          # get_cube_metadata
│   │   └── series.py            # get_series_info, change detection
│   ├── vector/
│   │   └── vector_tools.py      # vector series, bulk range fetch
│   ├── sdmx/
│   │   └── sdmx_tools.py        # get_sdmx_structure, get_sdmx_data, get_sdmx_key_for_dimension
│   ├── composite_tools.py       # fetch_vectors_to_database, store_cube_metadata (stdio only)
│   └── metadata_tools.py        # get_code_sets
├── cli/
│   ├── main.py                  # statcan CLI entry point (Typer app)
│   ├── output.py                # write_output, format helpers
│   └── commands/
│       ├── search.py            # statcan search
│       ├── metadata.py          # statcan metadata
│       ├── download.py          # statcan download
│       ├── vector.py            # statcan vector
│       └── codeset.py           # statcan codeset
├── db/                          # SQLite connection, schema, queries (stdio only)
├── models/                      # Pydantic input models
├── util/
│   ├── registry.py              # ToolRegistry — @decorator → MCP Tool schema
│   ├── truncation.py            # Response truncation + pagination guidance
│   ├── sdmx_json.py             # SDMX-JSON → tabular rows
│   └── cache.py                 # 1-hour TTL cache for cube list
├── config.py                    # BASE_URL, SDMX_BASE_URL, RENDER_BASE_URL, TRANSPORT, PORT
└── server.py                    # create_server(), MCP Prompts, HTTP routes (/files/sdmx/), CLI

Known Issues

IssueStatusWorkaround
"Unable to open database file" on Claude DesktopActivePass --db-path /Users/<you>/.statcan-mcp/statcan_data.db in your config
SSL verification disabledActiveVERIFY_SSL = False in all API calls — StatCan cert issues made this necessary
lastNObservations + startPeriod/endPeriod → 406ActiveUse one or the other, not both
OR syntax for Geography dimension unreliableActiveUse wildcard (.) for Geography; OR works fine for other dimensions
Wildcard returns sparse data for large dimensionsMitigatedUse get_sdmx_key_for_dimension to get the full OR key (e.g. NOC, CMAs)
Context overflow may cause data fabricationMitigatedHosted server returns download_csv URL — data processed via script, not context

Made with ❤️❤️❤️ for Statistics Canada
GitHub • Report Bug • Statistics Canada
Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Categories
Data & Analytics
Registryactive
Packagestatcan-mcp-server
TransportSTDIO
UpdatedMay 27, 2026
View on GitHub

Related Data & Analytics MCP Servers

View all →
Google Sheets

com.mcparmory/google-sheets

Create, read, and modify spreadsheet data, formatting, and sheets
25
Google Sheets

domdomegg/google-sheets-mcp

Allow AI systems to read, write, and query spreadsheet data via Google Sheets.
2
Google Sheets Mcp

henilcalagiya/google-sheets-mcp

Powerful tools for automating Google Sheets using Model Context Protocol (MCP)
14
Futuristic Risk Intelligence

cct15/war-dashboard-data

Geopolitical conflict risk, political events, and maritime traffic data for AI agents
1
Mcp Google Sheets Full

moooonad/mcp-google-sheets-full

Full Google Sheets MCP: 26 tools + run_sheets_script escape hatch. User OAuth, no service account.
CSV to JSON API

io.github.br0ski777/csv-to-json

Parse CSV to JSON array. Auto-detect delimiter, headers. x402 micropayment.