
Statcan Mcp
io.github.arose26由 GitHub 帳號 arose26 發布v0.1.1更新於 Oct 26, 2026
Statistics Canada's 8,200+ data tables: CPI, GDP, labour force, housing. No API key.
概覽
本機 MCP 伺服器,讓助理即時存取加拿大統計局的 8,200 多張資料表,例如 CPI、GDP、勞動力與住宅開工資料。
- 可以做什麼
- 以關鍵字搜尋全部加拿大統計局資料表
- 檢視某張表的維度與成員,成員數量受限並可用關鍵字篩選
- 依向量 ID 取得時間序列,可指定日期範圍或最近 N 期
- 依資料表加上每個維度各選一個成員取得時間序列
- 把未知的向量 ID 解析成標題與來源資料表
- 執行時解碼代碼,回傳可讀標籤而非數字列舉值
- 適用情境
- 適合需要助理回答加拿大經濟與社會統計問題的情境,例如失業率走勢、各省汽油價格通膨比較或住宅開工數量,不必手寫 StatCan API 呼叫。
- 執行需求
- 以 stdio 在本機執行,通常透過 npm 套件 statcan-mcp 以 npx 啟動,需要 Node.js 以及連線到加拿大統計局 Web Data Service 的網路。不需要 API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Statcan Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
statcan-mcp
An MCP server that gives Claude and other LLMs live access to Statistics Canada — all 8,200+ data tables from the Web Data Service: CPI, GDP, labour force, housing starts, population, trade, and more.
No API key required.
Sibling project: bank-of-canada-mcp for Bank of Canada rates and FX.
Why this exists
StatCan's API is powerful but hostile: POST-only lookups, opaque numeric vector IDs, 10-position "coordinate" addressing, and numeric code enums everywhere (scalarFactorCode: 3). This server translates it into something an LLM can actually drive:
- Discovery flow built into the tools — search tables → inspect dimensions → fetch data, with each tool description pointing to the next step.
- Context-friendly by default — a CPI dimension has 359 members and a series can span a century; members are capped and keyword-filterable, data defaults to the last 12 periods.
- Codes decoded at runtime via StatCan's own code-set endpoint — responses say
"scale": "thousands"and"note": "use with caution", notscalarFactorCode: 3, statusCode: 5. Nothing hardcoded to go stale. - Forgiving inputs — vector IDs accepted as
v41690973or41690973; coordinates padded automatically.
Quick start
Claude Code
Claude Desktop — add to claude_desktop_config.json:
The same npx invocation works in Cursor, Windsurf, and any other MCP client.
Tools
Example prompts
- "What's Canada's current unemployment rate, and how has it trended over 12 months?"
- "Compare gasoline price inflation in Ontario vs Quebec since 2024."
- "How many housing starts were there in Canada last quarter?"
- "What is vector v41690973?"
Development
Architecture: src/wds.ts is a plain WDS client with pure, unit-tested logic (catalogue search, coordinate padding, code decoding); src/index.ts is the MCP wiring. API failures (unknown vector, bad coordinate) come back as MCP tool errors carrying StatCan's own message so the model can self-correct.
Notes
- Data is © Statistics Canada, used under the Statistics Canada Open Licence. This project is not affiliated with or endorsed by Statistics Canada.
- English output only for now (the API also carries French — see roadmap).
Roadmap
- French-language output (
*Frfields are already in the API responses) - Full-table CSV download for bulk analysis
- Streamable HTTP transport for remote deployment
License
MIT
來源:README.md,提交 b24fa4d
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分