π Statistics Canada API MCP Server
About
MCP server + CLI for Statistics Canada (StatCan) β access 7,000+ Canadian statistical tables via WDS and SDMX REST APIs
Details
- License
- MIT
Explore
- Access Statistics Canada WDS and SDMX APIs via MCP
- Search, metadata, and download tools for statistical tables
- Standalone statcan CLI for terminalβbased data downloads
- Five builtβin MCP prompts for guided data lookup
- SQLite database support for local data storage (Option 3)
- Hosted public server available with no local setup
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
π Statistics Canada API MCP ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Pick the option that fits you. You don't need to install anything for Option 1.
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.
---
get_sdmx_structure
Dimension codelists + key syntax for a table. Call before `get_sdmx_data`.
get_sdmx_data
Filtered observations by `productId` + key. Returns a CSV download URL on the hosted server β data stays out of context.
get_sdmx_vector_data
Observations for a single vectorId via SDMX.
get_sdmx_key_for_dimension
All 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).
fetch_vectors_to_database
Fetch vectors by reference period range and store to SQLite.
store_cube_metadata
Fetch full cube metadata into SQLite β browse all members and vectorIds with SQL.
query_database
Read-only SQL against the local SQLite database.
Only the slice you request is returned. No downloading full tables.
| Tool | Description |
|---|---|
| get_sdmx_structure | Dimension codelists + key syntax for a table. Call before get_sdmx_data. |
| get_sdmx_data | Filtered observations by productId + key. Returns a CSV download URL on the hosted server β data stays out of context. |
| get_sdmx_vector_data | Observations for a single vectorId via SDMX. |
| get_sdmx_key_for_dimension | All 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.
These tools are not available on the hosted Render server β SQLite is per-process and not shared across users.
| Tool | Description |
|---|---|
| fetch_vectors_to_database | Fetch vectors by reference period range and store to SQLite. |
| store_cube_metadata | Fetch full cube metadata into SQLite β browse all members and vectorIds with SQL. |
| query_database | Read-only SQL against the local SQLite database. |
| create_table_from_data / insert_data | Create or append to a table. |
| list_tables / get_table_schema / drop_table | Database utilities. |
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"\ud83d\udcca statistics canada api mcp server": {
"mcp-statcan": {
"command": "uv",
"args": [
"pip",
"install",
"fastmcp",
"httpx",
"pydantic"
]
}
}
}
}
McpServers
{
"mcp-statcan": {
"command": "uv",
"args": [
"pip",
"install",
"fastmcp",
"httpx",
"pydantic"
]
}
}
<a href="https://www.statcan.gc.ca/en/start" target="_blank">
</a>
Statistics Canada MCP Server
<a href="https://www.python.org/downloads/" target="_blank"></a>
<a href="https://opensource.org/licenses/MIT" target="_blank"></a>
<a href="https://modelcontextprotocol.io/" target="_blank"></a>
<a href="https://github.com/Aryan-Jhaveri" target="_blank"></a>
<!-- mcp-name: io.github.Aryan-Jhaveri/mcp-statcan -->
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
| Dataset | Query | Demo | Source |
|---|---|---|---|
| Canada's Greenhouse Gas Emissions | "Create a simple visualization for greenhouse emissions for Canada as a whole over the last 4 years" | <a href="https://claude.ai/share/7de892a1-e1d9-410f-96f7-90cd140e5dd9" target="_blank">Chat</a> | <a href="https://www150.statcan.gc.ca/t1/tbl1/en/cv.action?pid=3810009701" target="_blank">Table 38-10-0097-01</a> |
| Canada's International Trade in Services | "Create a quick analysis for international trade in services for the last 6 months with a visualization" | <a href="https://claude.ai/share/c00eba2d-4e86-4405-878a-7ea4110cb7d3" target="_blank">Chat</a> | <a href="https://www150.statcan.gc.ca/t1/tbl1/en/cv.action?pid=1210014401" target="_blank">Table 12-10-0144-01</a> |
| Ontario Building Construction Price Index | "Generate a visualization for Ontario's Building Price index from Q4 2023 to Q4 2024" | <a href="https://claude.ai/share/12ce906f-5a26-4e74-86d9-10451ab5bc4b" target="_blank">Chat</a> | <a href="https://www150.statcan.gc.ca/t1/tbl1/en/cv.action?pid=1810028901" target="_blank">Table 18-10-0289-01</a> |
| Canadian Unemployment Dashboard | "Create a Canadian Unemployment Dashboard using statcan mcp" | <a href="https://claude.ai/share/50d72d90-ec98-463e-88ec-85032edc9c29" target="_blank">Chat</a> | <a href="https://www150.statcan.gc.ca/t1/tbl1/en/tv.action?pid=1410028701&pickMembers%5B0%5D=1.1&pickMembers%5B1%5D=3.1&pickMembers%5B2%5D=4.1&pickMembers%5B3%5D=5.1&cubeTimeFrame.startMonth=04&cubeTimeFrame.startYear=2023&cubeTimeFrame.endMonth=03&cubeTimeFrame.endYear=2026&referencePeriods=20230401%2C20260301" target="_blank">Table 14-10-0287-01</a> |
Dashboard examples
| Title | Link | Source |
|---|---|---|
| Canada's Critical Minerals Economy | <a href="https://claude.ai/public/artifacts/15d289c7-f324-4ced-bcc0-53d6ac3218c9" target="_blank">Dashboard</a> | <a href="https://www150.statcan.gc.ca/t1/tbl1/en/cv.action?pid=3610070801" target="_blank">Table 36-10-0708-01</a> |
| Price of Everything: CPI Dashboard 2015β2026 | <a href="https://claude.ai/public/artifacts/61e99645-934c-4fe2-9693-88dca714a634" target="_blank">Dashboard</a> | <a href="https://www150.statcan.gc.ca/t1/tbl1/en/cv.action?pid=1810000401" target="_blank">Table 18-10-0004-01</a> |
| Canada's Biomedical & Biotech Industries | <a href="https://claude.ai/public/artifacts/749ab9ef-c7a2-4186-8a75-d94a6eb8772e" target="_blank">Dashboard</a> | <a href="https://www150.statcan.gc.ca/t1/tbl1/en/tv.action?pid=2710029701" target="_blank">Table 27-10-0297-01</a> |
---
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)
β¦
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



