elections-canada-mcp-server
This Model Context Protocol (MCP) server provides access to Canadian federal election data. The server exposes resources and tools to query and analyze election results by riding, province, and party.
Documentation
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-serverUsage with Claude Desktop
1. Make sure the server is installed:
uv pip install elections-canada-mcp-server2. 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"]
}
}
}3. Restart Claude Desktop.
4. Now you can ask Claude questions such as:
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-server2. Install MCP CLI:
uv pip install mcp3. Test the server:
mcp dev elections_canada_mcp/server.pyThis 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
Frequently asked questions
What is elections-canada-mcp-server?
elections-canada-mcp-server is This Model Context Protocol (MCP) server provides access to Canadian federal election data. The server exposes resources and tools to query and analyze election results by riding, province, and party.
How do I install elections-canada-mcp-server?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is elections-canada-mcp-server open source?
Yes — it is hosted on GitHub at https://github.com/ThreeFortyThree-Canada/elections-canada-mcp-server and has 2 stars.
Related MCP tools
🙌 OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.
Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.
基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择ChatGPT/Claude/DeepSeek/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to
🚀 The fast, Pythonic way to build MCP servers and clients Trusted by 19900+ developers. Trusted by 19900+ developers. Trusted by 19900+ developers.
🔥 MaxKB is an open-source platform for building enterprise-grade agents. MaxKB 是强大易用的开源企业级智能体平台。 for the Model Context Protocol. Enhance AI assistants with po
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP