mcp-canada
This server gives AI agents structured access to Canadian government data by discovering, planning, and executing tool calls across many federal, provincial, and municipal APIs.
Search for relevant tools using natural language (
discover_tools).List available API modules, data sources, and tool counts (
list_modules).Plan multi-step, cross-API queries from natural-language questions (
plan_query).Execute any discovered tool by name (
call_tool).Run multiple tool calls in parallel with per-step error isolation (
execute_batch).Access data such as exchange rates, Parliament, recalls, drugs, immigration, StatCan, weather, provincial open data, Toronto/York Region data, and more.
Use bilingual English/French responses and local SQLite persistence for cross-API SQL joins.
Provides access to ArcGIS Hub portals for municipal data, enabling queries of geospatial datasets from Canadian municipalities like York Region, Markham, Newmarket, and Aurora.
Provides a local SQLite datastore for persistent storage and cross-API SQL JOINs, enabling agents to store and query data across multiple Canadian government APIs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-canada show me recent product recalls in Canada"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
295 tools, ~107 prompts, and ~141 resources across 9 federal APIs + 9 provincial APIs + 2 municipal APIs + 1 local SQLite datastore — exchange rates, parliamentary data, product recalls, drug information, 80K+ open datasets, food nutrition data, real-time weather, immigration statistics, Ontario provincial data, Toronto municipal data, York Region ArcGIS Hub data, British Columbia CKAN + WFS geospatial data, Quebec Données Québec CKAN + ArcGIS IQA data, Alberta open data + AER energy + WMBappServices wildfire + AHSGIS health + 511 Alberta transport, Manitoba geoportal (ArcGIS Hub) + 511 Manitoba transport, Saskatchewan geoportal (ArcGIS Hub) + WSA water infrastructure + SPSA fire bans, Nova Scotia Socrata SODA portal (data.novascotia.ca), New Brunswick federal-CKAN discovery + GeoNB bare ArcGIS Server geospatial data + gnb.socrata.com Socrata portal + key-gated 511 NB transport, and persistent local storage. All bilingual (English/French).
First ArcGIS Hub module — shared infrastructure in
shared/arcgis_hub.pyis reusable for future Canadian municipal modules (BC, Calgary, Edmonton, and other cities publishing via ArcGIS Hub). First OGC WFS module — BC introduces WFS 2.0 (OGC) support viashared/ogc.py, making WFS the third portal technology alongside CKAN and ArcGIS Hub. Seedocs://bc/wfs-query-guidefor the CKAN→WFS two-step workflow.
Quick Start
# Auto-configure your platform (interactive)
uvx mcp-canada install
# Or name platforms directly
uvx mcp-canada install claude-desktop cursor vscodeSupports 14 platforms: Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Zed, Codex CLI, Gemini CLI, Amazon Q, OpenCode, Cline, Roo Code, Goose CLI, Junie CLI.
Manual Setup
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"mcp-canada": {
"command": "uvx",
"args": ["mcp-canada"]
}
}
}claude mcp add mcp-canada -- uvx mcp-canadagit clone https://github.com/reyemtech/mcp-canada.git
cd mcp-canada
uv run mcp-canadaOptions
Flag | Description | Example |
| Transport protocol |
|
| Port for SSE/HTTP |
|
| Load only specific modules |
|
| INFO-level logging |
|
| DEBUG-level logging |
|
Environment variable: MCP_CANADA_MODULES=bank_of_canada,recalls
Related MCP server: canlii-mcp
Examples
See the documentation site for cross-API intelligence scenarios — from tracing prairie drought to the Canadian dollar, to building pharmaceutical safety audits, to assembling MP accountability briefs, to joining data from multiple APIs in a single SQL query. Each example includes the exact prompt and tool chain you can run today. The source remains in EXAMPLES.md.
How Discovery Works
With 250 tools, listing all of them would consume half an agent's context window. Instead, BM25 search lets agents find exactly what they need:
Agent: "What tools do you have for exchange rates?"
→ discover_tools("exchange rate CAD")
→ Returns: boc_get_exchange_rates, boc_get_observations
→ call_tool("boc_get_exchange_rates", {"currency": "USD", "recent": 3})
→ Returns: {"_meta": {...}, "data": [{"date": "2026-04-02", "value": 1.3918, ...}]}Agents see 5 always-visible tools:
Tool | Purpose |
| BM25 natural language search across all tools |
| Execute any discovered tool by name |
| List available API modules with tool counts |
| Plan a multi-step query across Canadian government data APIs |
| Run multiple tool calls in parallel with per-step error isolation |
Modules
All tools accept lang: "en" | "fr" for bilingual support. Responses include a _meta envelope with source attribution and cache status. Browse the complete, searchable tool reference for current tool parameters and source APIs.
Module | Level | Tools | Prompts | Resources | Description |
— | 5 | — | — | Always-visible orchestration tools ( | |
Federal | 8 | 5 | 7 | Exchange rates, interest rates, commodity prices, inflation — Valet API | |
Federal | 7 | 5 | 7 | 80,000+ federal datasets — open.canada.ca | |
Federal | 8 | 5 | 7 | Drug products, ingredients, schedules — Health Canada DPD | |
Federal | 10 | 5 | 7 | PR, study/work permits, Express Entry, asylum — IRCC Open Data | |
Federal | 8 | 5 | 7 | Food nutrition data — Canadian Nutrient File | |
Federal | 10 | 5 | 7 | Bills, MPs, votes, ballots, Hansard debates — Open Parliament API | |
Federal | 6 | 4 | 6 | Food, vehicle, and health product recalls — Healthy Canadians | |
Federal | 15 | 6 | 8 | Time series, cube metadata, SDMX filtering — StatCan WDS | |
Federal | 34 | 6 | 8 | Conditions, climate, air quality, hydrology, marine, radar — MSC GeoMet | |
Provincial | 24 | 6 | 7 | CKAN + AER energy + WMBappServices wildfire + AHSGIS health + 511 Alberta — open.alberta.ca | |
Provincial | 20 | 6 | 7 | CKAN + WFS geospatial — BC Data Catalogue | |
Provincial | 20 | 6 | 7 | ArcGIS Hub + 511 Manitoba — geoportal.gov.mb.ca | |
Provincial | 13 | 6 | 7 | ArcGIS Hub + WSA water + SPSA fire bans — geohub.saskatchewan.ca | |
New Brunswick ( | Provincial | 22 | 6 | 7 | Federal CKAN + GeoNB bare ArcGIS Server + gnb.socrata.com Socrata + key-gated 511 NB transport — geonb.snb.ca |
Provincial | 16 | 6 | 7 | Socrata SODA portal (aquaculture, environment, health) — data.novascotia.ca | |
Provincial | 6 | 4 | 6 | 3,000+ provincial datasets — Ontario Open Data | |
Provincial | 18 | 6 | 7 | Federated CKAN (139 orgs) — Données Québec | |
Municipal | 12 | 6 | 8 | TTC, neighbourhoods, 311, RentSafe — Toronto Open Data | |
Municipal | 27 | 5 | 8 | 4 ArcGIS Hub portals (York Region, Markham, Newmarket, Aurora) | |
Local | 6 | 4 | 6 | SQLite persistence for cross-API SQL JOINs — | |
Total | 295 | ~107 | ~141 |
Response Format
All tools return a consistent envelope:
{
"_meta": {
"source": {"api": "bank-of-canada-valet", "url": "https://..."},
"cached": true,
"lang": "en",
"timestamp": "2026-04-04T12:00:00Z"
},
"data": [ ... ]
}Errors return:
{
"error": {
"code": "INVALID_SERIES",
"message": "Series 'FXXYZCAD' not found.",
"suggestions": ["FXUSDCAD", "FXEURCAD"]
}
}Architecture
src/mcp_canada/
├── server.py # FastMCP entry point, transport, module loading
├── shared/ # Cross-module utilities
│ ├── cache.py # TTL-based in-memory cache (aiocache)
│ ├── envelope.py # Response/error envelope (make_response/make_error)
│ ├── http.py # Shared HTTP client with retry (tenacity)
│ ├── rate_limiter.py # Per-source token bucket
│ └── i18n.py # Bilingual error messages
├── meta/
│ └── list_modules.py # list_modules meta-tool
└── modules/
├── bank_of_canada/ # 8 tools — Valet API
├── open_parliament/ # 10 tools — Parliament API
├── recalls/ # 6 tools — Healthy Canadians API
├── drug_database/ # 8 tools — Health Canada DPD
├── ckan/ # 7 tools — Open Data Portal
├── nutrient_file/ # 8 tools — Canadian Nutrient File
├── datastore/ # 6 tools — local SQLite persistence
├── ircc/ # 10 tools — IRCC Immigration Open Data
├── ontario/ # 6 tools — Ontario Open Data Catalogue
├── toronto/ # 12 tools — City of Toronto Open Data Portal
├── york_region/ # 27 tools — York Region ArcGIS Hub (4 portals)
├── british_columbia/ # 20 tools — BC Data Catalogue + WFS
├── manitoba/ # 20 tools — geoportal.gov.mb.ca ArcGIS Hub + 511 Manitoba
├── saskatchewan/ # 13 tools — geohub.saskatchewan.ca ArcGIS Hub + WSA water + SPSA fire bans
├── quebec/ # 18 tools — Données Québec CKAN
├── alberta/ # 24 tools — open.alberta.ca CKAN + AER + WMB + AHSGIS + 511
├── nova_scotia/ # 16 tools — data.novascotia.ca Socrata SODA
├── statcan/ # 15 tools — Statistics Canada WDS + SDMX
└── weather/ # 34 tools — MSC GeoMet OGC API
├── current/ # 5 tools — realtime conditions, forecast, alerts
├── climate/ # 7 tools — daily/monthly/normals/trends
├── aqhi/ # 3 tools — air quality health index
├── hydro/ # 5 tools — water levels, flow, flood risk
├── marine/ # 3 tools — marine forecasts, hurricane tracks
├── severe/ # 3 tools — radar, lightning, UV index
├── snow/ # 2 tools — snow depth, snow water equivalent
├── collections/ # 2 tools — collection browser and direct query
└── summary/ # 4 tools — composite summary, extremes, growing season, degree daysEach module follows a 7-file pattern:
File | Purpose |
| Module name and description |
| Base URL, rate limits, cache TTLs, API mappings |
| Pydantic v2 response models (always flat) |
| Async HTTP functions with caching and rate limiting |
|
|
|
|
|
|
New modules are auto-discovered — drop a folder in modules/ and it registers via FileSystemProvider.
Development
# Install dependencies
uv sync
# Run tests (~2000 unit tests, ~15s)
uv run pytest
# Run integration tests against live APIs (~2min)
uv run pytest tests/integration/ -v -m integration --timeout=120
# Type check and lint
uv run pyright
uv run ruff check src/ tests/
# Coverage (must be ≥95%)
uv run pytest --cov=src/mcp_canada --cov-fail-under=95Contributing
See CONTRIBUTING.md for setup, required checks, the module pattern, MCP integration tests, pagination and parameter contracts, and generated catalog updates. Every PR includes a checklist and receives check results and advisory review feedback; the maintainer decides what to merge.
Before submitting, run lint, type checks, unit tests with at least 95% coverage,
and uv run python scripts/generate_catalog.py --check. See
PR automation for maintainer setup.
Changelog
See CHANGELOG.md for version-by-version changes, or browse GitHub Releases.
Security
Found a vulnerability? Please do not open a public issue. Email contact@reyem.tech with details and reproduction steps. We support the latest minor version on PyPI.
Community
Questions & ideas: GitHub Discussions
Bugs & feature requests: GitHub Issues
Contact: contact@reyem.tech
License
Data Attributions
Data from the following government sources is accessed by this library subject to their respective licences:
Nova Scotia Open Data — Licensed under the Open Government Licence – Nova Scotia v1.1. Contains public sector information provided by the Province of Nova Scotia.
Star History
Available Tools
5 toolscall_toolA
Call a tool by name with the given arguments.
Use this to execute tools discovered via search_tools.
Inputs: name (required), arguments.
discover_toolsA
Search for tools using natural language.
Returns matching tool definitions ranked by relevance, in the same format as list_tools.
Inputs: query (required). Returns: result
execute_batchA
Execute multiple tool calls in parallel and return aggregated results.
Accepts either a plan_query output (dict with 'steps' key) or a raw list of tool call objects. Runs all valid steps in parallel using asyncio.gather with per-step error isolation — one failed step does not cancel others.
Use for: running multiple tool calls at once, executing a plan from plan_query, batch queries across multiple APIs, parallel data fetching, multi-source aggregation.
Keywords: batch, execute, parallel, multiple tools, run plan, aggregate, multi-step, concurrent, simultaneous, gather, dispatch, bulk, workflow
Inputs: calls (required), lang. Returns: object
list_modulesA
List all registered API modules with tool counts and descriptions.
Use this to understand what data sources are available before calling discover_tools for specific queries. Keywords: modules, APIs, data sources, available tools, capabilities.
Inputs: no named parameters. Returns: object
plan_queryA
Plan a multi-step query across Canadian government data APIs.
Returns a structured execution plan with the most relevant tool names for the given natural language question. Use execute_batch to run the plan.
Use for: orchestrating queries that span multiple data sources, finding which tools to use for a complex question, multi-API planning, cross-module queries, batch query preparation.
Keywords: plan, query, multi-step, orchestrate, batch, cross-module, execution plan, tool selection, NL query, natural language, discover, which tools, what tools, how to query, planning, workflow
Inputs: query (required), lang, top_k. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Tools have distinct purposes: call_tool vs execute_batch differ in batching; discover_tools vs plan_query both find tools but plan_query adds orchestration. Minor overlap but descriptions clarify.
All tool names follow a consistent verb_noun snake_case pattern (call_tool, discover_tools, execute_batch, list_modules, plan_query). No deviations.
5 tools is appropriate for a meta-server that provides discovery and execution. Not too few or too many for the gateway purpose, but could include a direct browse tool.
Covers the discovery-to-execution pipeline well: list modules, discover tools, plan queries, execute. Missing a tool for inspecting tool details directly, but discover_tools suffices.
Maintenance
Related MCP Connectors
Hosted MCP server for live public-data APIs and Skills for AI agents.
Agent-native MCP server over 49M+ US public and government records, privacy-first, always current.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Canadian sovereign AI over MCP: ask rosedale-1 and ossington-5 with data residency in Canada.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides tools for intelligently querying, analyzing, and retrieving datasets from Toronto's CKAN-powered open data portal. It enables AI assistants to perform natural language searches, inspect data structures, and track dataset update frequencies across the city's open data catalog.12-
- AlicenseAqualityCmaintenanceAn MCP server providing AI assistants access to Canadian case law and legislation metadata from CanLII across all jurisdictions, supporting search and citation relationships.732 npm7MIT
- AlicenseAqualityDmaintenanceMCP Server for accessing 36 Brazilian public data sources and 1 agent, enabling AI agents to query government data on economy, legislation, transparency, judiciary, elections, environment, health, and more.6MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for Canadian procurement intelligence, enabling unified search of federal and Alberta tender opportunities, deadline tracking, profile-based matching, daily briefs, and AI-assisted bid analysis.-