
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 分