Tools

MCP server

Connect your AI assistant to ElectionData.MY and ask questions about Malaysian elections in plain language. The assistant answers by running SQL on the same data that powers this site, so its numbers come from the real results rather than from memory. It works with Claude, ChatGPT, Gemini, GitHub Copilot, Cursor and any other client that supports remote MCP servers over Streamable HTTP.

It's free and non-commercial. There's no API key, sign-up or login. Add this URL to your client:

https://mcp.electiondata.my/mcp

How to connect

Claude (claude.ai and Claude Desktop)

Go to Settings, then Connectors, then Add custom connector. Name it ElectionData.MY and paste this URL:

https://mcp.electiondata.my/mcp

Claude Code

Run this in your terminal:

claude mcp add --transport http electiondata https://mcp.electiondata.my/mcp

Cursor

Add this to ~/.cursor/mcp.json:

{ "mcpServers": { "electiondata": { "url": "https://mcp.electiondata.my/mcp" } } }

VS Code / GitHub Copilot

Add this to .vscode/mcp.json in your project:

{ "servers": { "electiondata": { "type": "http", "url": "https://mcp.electiondata.my/mcp" } } }

Gemini CLI

Add this to ~/.gemini/settings.json:

{ "mcpServers": { "electiondata": { "httpUrl": "https://mcp.electiondata.my/mcp" } } }

ChatGPT

Custom connectors are available through developer mode (Settings, then Apps & Connectors). Add a connector and point it at the same URL.

Client menus change often. If yours looks different, look for the option to add a remote MCP server, which may be called a connector, and give it the URL above.

Things to ask

We checked each answer against the live data.

“Which GE-15 seat contains the point 3.139, 101.687?”

P.121 Lembah Pantai.

“What were the three largest seats by area in GE-15, and who won them?”

Hulu Rajang (PRS), Baram (PDP) and Kinabatangan (UMNO).

“Which seat had the highest turnout in GE-15?”

P.125 Putrajaya (86.2%), then Kuala Selangor (85.2%) and Kepala Batas (84.4%).

“How has each party's vote share in Mas Gading changed since 1990?”

SNAP won GE-08 to GE-10, SPDP GE-11 to GE-13, and DAP GE-14 and GE-15 (55% in GE-15). The answer follows the seat through its renumbering from P.154 to P.166 to P.192.

“Break down Johor SE-16 turnout by polling district.”

About 1,000 polling districts, with overall turnout of 68.7%.

What data it covers

The same data as our public data lake. Results and voter data reach the server within about a minute of an update, and everything else within an hour:

  • Every Parliament and DUN contest since 1955, including by-elections: candidate-level results and seat-level stats.
  • Saluran (polling stream) results for many elections.
  • Anonymised voter rolls, one per election.
  • Seat-level voter demographics by sex, age and ethnicity.
  • Live polling-day turnout by polling district, for recent elections.
  • Lookups for candidates, parties, coalitions and their successions, and the causes of by-elections.
  • Boundary maps for every delimitation since 1954, polling district boundaries for the current delimitation, and the 2026 Sarawak first proposal, with spatial functions.

With the boundary maps, any election's results can be put on a map. You can ask which seat contains a point, which seats are largest by area, or for a seat's boundary as GeoJSON.

Tools the assistant gets

list_tablesLists the tables.
describe_tableShows a table's columns and their valid values.
queryRuns one read-only SQL SELECT.
search_candidates, search_parties, search_seatsFinds candidates, parties or seats by name, tolerating partial names and small spelling differences.

It also gets a guide (edmy://guide) that explains the quirks of the data, such as how to join tables and how seats are numbered.

Limits

Queries are read-only and can't read files or URLs. Each query returns at most 500 rows and about 256 KB, and times out after 10 seconds. When the server is busy, it returns a busy error, and the assistant can simply try again.