Logo vun MCP Canada

MCP Canada

Organisatioun
ReyemTech

MCP server for Canadian government data — 266 bilingual tools across 9 federal, 7 provincial & 2 municipal open-data APIs (Bank of Canada, StatCan, weather, recalls, drugs, immigration, BC/Alberta/Saskatchewan/Manitoba/Quebec/Ontario + more)

EditeurReyemTech
Repositorymcp-canada
SproochPython
Forks
8
Stären
61
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    MCP Canada stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    61 Stären an 8 Forks aus dem verlinkte Repository.


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.py is 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 via shared/ogc.py, making WFS the third portal technology alongside CKAN and ArcGIS Hub. See docs://bc/wfs-query-guide for the CKAN→WFS two-step workflow.

Quick Start

bash
# Auto-configure your platform (interactive)
uvx mcp-canada install

# Or name platforms directly
uvx mcp-canada install claude-desktop cursor vscode

Supports 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:

json
{
  "mcpServers": {
    "mcp-canada": {
      "command": "uvx",
      "args": ["mcp-canada"]
    }
  }
}
bash
claude mcp add mcp-canada -- uvx mcp-canada
bash
git clone https://github.com/reyemtech/mcp-canada.git
cd mcp-canada
uv run mcp-canada

Options

FlagDescriptionExample
--transportTransport protocol--transport sse
--portPort for SSE/HTTP--port 8000
--modulesLoad only specific modules--modules bank_of_canada,recalls
--verboseINFO-level logging--verbose
--debugDEBUG-level logging--debug

Environment variable: MCP_CANADA_MODULES=bank_of_canada,recalls

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:

ToolPurpose
discover_toolsBM25 natural language search across all tools
call_toolExecute any discovered tool by name
list_modulesList available API modules with tool counts
plan_queryPlan a multi-step query across Canadian government data APIs
execute_batchRun 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.

ModuleLevelToolsPromptsResourcesDescription
Meta / Discovery—5——Always-visible orchestration tools (discover_tools, call_tool, list_modules, plan_query, execute_batch)
Bank of CanadaFederal857Exchange rates, interest rates, commodity prices, inflation — Valet API
CKAN Open DataFederal75780,000+ federal datasets — open.canada.ca
Drug DatabaseFederal857Drug products, ingredients, schedules — Health Canada DPD
IRCC ImmigrationFederal1057PR, study/work permits, Express Entry, asylum — IRCC Open Data
Nutrient FileFederal857Food nutrition data — Canadian Nutrient File
Open ParliamentFederal1057Bills, MPs, votes, ballots, Hansard debates — Open Parliament API
Recalls & SafetyFederal646Food, vehicle, and health product recalls — Healthy Canadians
Statistics CanadaFederal1568Time series, cube metadata, SDMX filtering — StatCan WDS
WeatherFederal3468Conditions, climate, air quality, hydrology, marine, radar — MSC GeoMet
AlbertaProvincial2467CKAN + AER energy + WMBappServices wildfire + AHSGIS health + 511 Alberta — open.alberta.ca
British ColumbiaProvincial2067CKAN + WFS geospatial — BC Data Catalogue
ManitobaProvincial2067ArcGIS Hub + 511 Manitoba — geoportal.gov.mb.ca
SaskatchewanProvincial1367ArcGIS Hub + WSA water + SPSA fire bans — geohub.saskatchewan.ca
New Brunswick (new_brunswick/)Provincial2267Federal CKAN + GeoNB bare ArcGIS Server + gnb.socrata.com Socrata + key-gated 511 NB transport — geonb.snb.ca
Nova ScotiaProvincial1667Socrata SODA portal (aquaculture, environment, health) — data.novascotia.ca
OntarioProvincial6463,000+ provincial datasets — Ontario Open Data
QuebecProvincial1867Federated CKAN (139 orgs) — Données Québec
TorontoMunicipal1268TTC, neighbourhoods, 311, RentSafe — Toronto Open Data
York RegionMunicipal27584 ArcGIS Hub portals (York Region, Markham, Newmarket, Aurora)
Local DatastoreLocal646SQLite persistence for cross-API SQL JOINs — ~/.mcp-canada/datastore.db
Total295~107~141

Response Format

All tools return a consistent envelope:

json
{
  "_meta": {
    "source": {"api": "bank-of-canada-valet", "url": "https://..."},
    "cached": true,
    "lang": "en",
    "timestamp": "2026-04-04T12:00:00Z"
  },
  "data": [ ... ]
}

Errors return:

json
{
  "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 days

Each module follows a 7-file pattern:

FilePurpose
__init__.pyModule name and description
constants.pyBase URL, rate limits, cache TTLs, API mappings
schemas.pyPydantic v2 response models (always flat)
client.pyAsync HTTP functions with caching and rate limiting
tools.py@tool decorated MCP tool functions
prompts.py@prompt functions — guided workflows + quick lookups
resources.py@resource functions — catalogs, docs, templates

New modules are auto-discovered — drop a folder in modules/ and it registers via FileSystemProvider.

Development

bash
# 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=95

Contributing

Each module is self-contained. To add a new API:

  1. Create src/mcp_canada/modules/your_api/ with the 7-file pattern
  2. Add colocated __tests__/ with unit tests
  3. Add integration tests in tests/integration/test_tool_scenarios.py
  4. Add a module doc in docs/modules/ and update the Modules table in this README

See CLAUDE.md for coding conventions.

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

License

MIT — Reyem Tech

Data Attributions

Data from the following government sources is accessed by this library subject to their respective licences:

Star History

Installatioun

TypingMind
{
  "mcpServers": {
    "mcp-canada": {
      "command": "uvx",
      "args": [
        "mcp-canada"
      ]
    }
  }
}

MCP Canada MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal MCP Canada verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

MCP Canada als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu MCP Canada an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "mcp-canada": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu MCP Canada. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu MCP Canada.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat MCP Canada?
MCP Canada
Jo. Ech hunn et gelies.
Dat hunn ech mat MCP Canada fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server MCP Canada benotzt?

MCP Canada ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech MCP Canada MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir MCP Canada mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat MCP Canada MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann MCP Canada verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech MCP Canada MCP mat TypingMind?

MCP Canada leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt MCP Canada MCP an TypingMind zur Verfügung?

MCP Canada stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir MCP Canada MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann MCP Canada eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇