- Explore MCP Servers
- elections-canada-mcp-server
Elections Canada Mcp Server
What is Elections Canada Mcp Server
The elections-canada-mcp-server is a Model Context Protocol (MCP) server that provides access to Canadian federal election data, specifically results from the 2021 and 2025 elections. It allows users to query and analyze election results by riding, province, and party.
Use cases
Use cases for the elections-canada-mcp-server include analyzing election results for specific ridings, comparing party performance across different provinces, and generating real-time projections for upcoming elections.
How to use
To use the elections-canada-mcp-server, first install it via PyPI using the command ‘uv pip install elections-canada-mcp-server’. Then, configure it in your MCP client, such as Claude Desktop, by adding the necessary command and arguments in the configuration file. After restarting the client, you can query election data.
Key features
Key features of the elections-canada-mcp-server include access to federal election results, support for querying by riding, province, and party, and future updates that will include past elections and real-time projections.
Where to use
The elections-canada-mcp-server is primarily used in the fields of political analysis, data journalism, and civic technology, where access to election data is crucial for research and reporting.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Elections Canada Mcp Server
The elections-canada-mcp-server is a Model Context Protocol (MCP) server that provides access to Canadian federal election data, specifically results from the 2021 and 2025 elections. It allows users to query and analyze election results by riding, province, and party.
Use cases
Use cases for the elections-canada-mcp-server include analyzing election results for specific ridings, comparing party performance across different provinces, and generating real-time projections for upcoming elections.
How to use
To use the elections-canada-mcp-server, first install it via PyPI using the command ‘uv pip install elections-canada-mcp-server’. Then, configure it in your MCP client, such as Claude Desktop, by adding the necessary command and arguments in the configuration file. After restarting the client, you can query election data.
Key features
Key features of the elections-canada-mcp-server include access to federal election results, support for querying by riding, province, and party, and future updates that will include past elections and real-time projections.
Where to use
The elections-canada-mcp-server is primarily used in the fields of political analysis, data journalism, and civic technology, where access to election data is crucial for research and reporting.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Elections Canada MCP Server
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
-
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-server -
Install MCP CLI:
uv pip install mcp -
Test 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
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










