Elections Canada Server
FreeNot checkedProvides access to Canadian federal election data, enabling queries about ridings, parties, vote shares, and close races for the 2021 and 2025 elections.
About
Provides access to Canadian federal election data, enabling queries about ridings, parties, vote shares, and close races for the 2021 and 2025 elections.
README
This is a Model Context Protocol (MCP) server that provides access to Canadian federal election data. It currently supports results from the 2021 and 2025 elections. Future updates will include past elections, census demographics, and ThreeFortyThree real-time projections.
Brought to you by ThreeFortyThree, this server powers ThreeFortyThree Chat and is available for use with MCP clients such as Claude Desktop.
🛠 Setup
Installation (via PyPI)
uv pip install elections-canada-mcp-server
Usage with Claude Desktop
- Make sure the server is installed:
uv pip install elections-canada-mcp-server
- Open your
claude_desktop_config.jsonand add the following block:
uv
{
"mcpServers": {
"elections_canada_data_and_predictions": {
"command": "{PATH_TO_UVX}", // Replace with output of: which uvx
"args": ["elections-canada-mcp"]
}
}
}
Restart Claude Desktop.
Now you can ask Claude questions such as:
- "What were the 2021 election results in Toronto Centre?"
- "Which ridings were closest for the NDP?"
- "Show me the highest-margin wins for the Conservatives in 2021."
Local Development
To test the server using MCP Inspector:
Clone this repository:
git clone https://github.com/ThreeFortyThree-Canada/elections-canada-mcp-server.git cd elections-canada-mcp-serverInstall MCP CLI:
uv pip install mcpTest the server:
mcp dev elections_canada_mcp/server.py
This opens a web UI to test the server locally.
🧰 Tools
| Tool | Description | Input | Returns |
|---|---|---|---|
search_ridings |
Search ridings by name (accent-insensitive) | search_term: str |
List of matching ridings |
get_party_votes |
Get vote share in a riding (optionally by party) | riding_code: str, party_code: str (optional) |
Votes and percentage |
get_winning_party |
Get the winning party in a riding | riding_code: str |
Winning party |
summarize_province_results |
Province-wide summary of votes/seats | province_name_or_code: str |
Party results |
summarize_national_results |
Canada-wide election summary | — | National party results |
find_closest_ridings |
Find most competitive ridings | num_results: int, party: str (optional) |
Closest margins |
best_and_worst_results |
Best/worst ridings for a party | party: str, num_entries: int |
4-category performance summary |
📚 Resources
| Resource | URI |
|---|---|
| All ridings | elections-canada://ridings |
| Single riding | elections-canada://riding/{riding_code} |
| Province | elections-canada://province/{province_code} |
📌 Province Codes
AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT
📌 Party Codes
LPC, CPC, NDP, BQ, GPC, PPC
📄 License
This project is licensed under the MIT License.
© ThreeFortyThree Canada – threefortythree.ca
from github.com/ThreeFortyThree-Canada/elections-canada-mcp-server
Install Elections Canada Server in Claude Desktop, Claude Code & Cursor
unyly install elections-canada-mcp-serverInstalls into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.
First time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Or configure manually
Run in your terminal:
claude mcp add elections-canada-mcp-server -- uvx elections_canada_mcp_serverFAQ
Is Elections Canada Server MCP free?
Yes, Elections Canada Server MCP is free — one-click install via Unyly at no cost.
Does Elections Canada Server need an API key?
No, Elections Canada Server runs without API keys or environment variables.
Is Elections Canada Server hosted or self-hosted?
A hosted option is available: Unyly runs the server in the cloud, no local setup required.
How do I install Elections Canada Server in Claude Desktop, Claude Code or Cursor?
Open Elections Canada Server on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectCompare Elections Canada Server with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
