mcpField
E
Elections Canada MCP Server

Elections Canada MCP Server

Local
github.com/ThreeFortyThree-CanadaLegal & Government2Updated 77w ago

About Elections Canada MCP Server

Elections Canada MCP Server gives MCP clients access to Canadian federal election data for 2021 and 2025, with queries and summaries organized by riding, province, and party.

Key features

  1. 01Search ridings
  2. 02Retrieve party votes by riding
  3. 03Summarize provincial and national results
  4. 04Find the closest ridings
  5. 05Compare party best and worst results

Use cases

  1. 01Look up an election result for a riding
  2. 02Summarize party results by province or nationally
  3. 03Identify ridings with the narrowest margins

MCP support

The server exposes riding and province resources, along with tools for querying and summarizing election results to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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
  1. Make sure the server is installed:
uv pip install elections-canada-mcp-server
  1. Open your claude_desktop_config.json and 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"]
    }
  }
}
  1. Restart Claude Desktop.

  2. 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:

  1. Clone this repository:

    git clone https://github.com/ThreeFortyThree-Canada/elections-canada-mcp-server.git
    cd elections-canada-mcp-server
    
  2. Install MCP CLI:

    uv pip install mcp
    
  3. Test the server:

    mcp dev elections_canada_mcp/server.py
    

This opens a web UI to test the server locally.


🧰 Tools

ToolDescriptionInputReturns
search_ridingsSearch ridings by name (accent-insensitive)search_term: strList of matching ridings
get_party_votesGet vote share in a riding (optionally by party)riding_code: str, party_code: str (optional)Votes and percentage
get_winning_partyGet the winning party in a ridingriding_code: strWinning party
summarize_province_resultsProvince-wide summary of votes/seatsprovince_name_or_code: strParty results
summarize_national_resultsCanada-wide election summary—National party results
find_closest_ridingsFind most competitive ridingsnum_results: int, party: str (optional)Closest margins
best_and_worst_resultsBest/worst ridings for a partyparty: str, num_entries: int4-category performance summary

📚 Resources

ResourceURI
All ridingselections-canada://ridings
Single ridingelections-canada://riding/{riding_code}
Provinceelections-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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.