election-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@election-mcp What were the 2024 Lok Sabha results in Karnataka?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
election-mcp
A Model Context Protocol (MCP) server for Indian Election Commission (ECI) data. It lets Claude Code, Claude Desktop, Cline, and any other MCP client query Lok Sabha election results, validate voter IDs, and search candidates — all from a self-contained, static sample dataset. No API key or network access is required.
What it does
Three tools:
election_results— search Lok Sabha (parliament) results by year (2014, 2019 or 2024) and/or state. Returns the constituency, winning party, winning candidate, votes, and the runner-up for each matching seat.voter_lookup— validate a voter ID card number and/or find the state Election Commission office.candidate_search— search candidates / MPs by name or by constituency.
Data is sample data. The constituencies, candidates, parties and vote counts in this package are plausible but fabricated for demonstration. They are not real Election Commission of India results. For authoritative results, see https://eci.gov.in
Related MCP server: Situação Eleitoral (TSE)
Quick start
Requires Node.js 18+ (uses the built-in global fetch). No API key is needed.
# from the monorepo root
npm install # installs @modelcontextprotocol/sdk
npm run test --workspace election-mcp # run the testsRun the server directly (stdio transport):
node server.jsMCP client configuration
Add it to your MCP client's configuration as a stdio server:
{
"mcpServers": {
"election": {
"command": "node",
"args": ["/absolute/path/to/india-mcp/election-mcp/server.js"]
}
}
}Or, from inside the package folder:
{
"mcpServers": {
"election": {
"command": "node",
"args": ["server.js"]
}
}
}Tool examples
election_results — arguments:
argument | type | required | description |
| string | no | Election year: |
| string | no | Indian state, e.g. |
Example call:
{ "name": "election_results", "arguments": { "state": "Karnataka", "year": "2024" } }Example response (trimmed):
{
"ok": true,
"results": [
{
"constituency": "Bengaluru North",
"state": "Karnataka",
"year": "2024",
"winnerName": "Anusha Kumar",
"winnerParty": "Bharatiya Janata Party",
"winnerVotes": 234560,
"runnerUpName": "Prakash Hampe",
"runnerUpParty": "Indian National Congress",
"runnerUpVotes": 210880
}
],
"count": 1,
"note": "year=2024 & state=Karnataka"
}voter_lookup — arguments:
argument | type | required | description |
| string | no | Voter ID, e.g. |
| string | no | State to look up the Election Commission office for |
Example call:
{ "name": "voter_lookup", "arguments": { "cardNumber": "ABC1234567" } }A malformed card number is rejected locally:
{ "name": "voter_lookup", "arguments": { "cardNumber": "123" } }{ "ok": false, "valid": false, "message": "Invalid voter ID format. Expected 3 uppercase letters followed by 8 digits (e.g. ABC1234567)." }candidate_search — arguments:
argument | type | required | description |
| string | no | Candidate / MP name (partial match) |
| string | no | Constituency name (partial match) |
Example call:
{ "name": "candidate_search", "arguments": { "constituency": "Chennai Central" } }Data source
There is no external data source — this package ships with a bundled, static sample dataset (lib/election.js) covering Lok Sabha results for Maharashtra, Karnataka and Tamil Nadu across the 2014, 2019 and 2024 general elections (5–7 constituencies each).
The data is intentionally fabricated and labeled as sample data. Do not use it for any real electoral decision-making. For official results, refer to the Election Commission of India.
Scripts
script | description |
| run the server ( |
| run the server ( |
| run the tests ( |
License
Available Tools
3 toolscandidate_searchA
Search Lok Sabha candidates / MPs by name or by constituency. Returns the year, constituency, winning party and votes for every matching seat in the sample data.
Inputs: name, constituency.
election_resultsA
Search Indian Lok Sabha (parliament) election results by year (2014, 2019 or 2024) and/or state. Returns constituency, winning party, winning candidate, votes, and the runner-up for each matching seat. Data is sample data.
Inputs: year, state.
voter_lookupB
Validate a voter ID card number and/or look up the state Election Commission office. The standard voter ID format is 3 uppercase letters followed by 8 digits (e.g. ABC1234567). Sample voter records are only returned for the few IDs in the demo dataset.
Inputs: state, cardNumber.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
voter_lookup is clearly distinct from the two search tools. election_results and candidate_search overlap somewhat because both can return winning candidate, party, votes, and constituency, though their primary search dimensions differ (year/state vs. candidate name/constituency).
All three names use a consistent snake_case noun_phrase pattern: election_results, voter_lookup, candidate_search. There is no mixing of casing styles or vague verb conventions.
Three tools is lean but reasonable for a focused election-data server, and each tool covers a distinct access path. It is on the low end, but not so thin that the set feels incomplete for the stated scope.
The surface covers results by year/state, candidate search by name/constituency, and voter ID lookup/validation. Minor gaps exist, such as party-based search or broader constituency metadata, but the main read-only workflows are represented.
Maintenance
Related MCP Connectors
Query UK Parliament, elections, crime stats, ONS census data, and national archives
Free Indian data and AI: pincode, IFSC, GSTIN, holidays, GST invoice, OCR, calculators, translation.
Indian government statistics and public data: economy, elections, health, agriculture and more
Search MPs and Lords, fetch profiles, synopses, and Westminster constituencies
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables querying Brazilian electoral data through TSE's official API. Supports candidate searches, election information, and campaign finance records for municipalities and states.72MIT
- AlicenseNot gradedqualityDmaintenanceEnables querying a person's electoral situation in Brazil (TSE) using name, birth date, CPF and voter ID. Allows checking if the voter registration is regular or irregular.MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to query and compare Indian MPs using parliamentary records, attendance, affidavits, and election results, including topic search, report cards, rankings, and source-backed answers.-
- AlicenseAqualityBmaintenanceEnables AI agents to validate Indian identifiers (GSTIN, PAN, Aadhaar format, IFSC) and look up pincodes, state/GST codes, Central Government holidays, and compliance due dates entirely offline. Every result is deterministic and carries its data source and freshness, while making clear that a well-formed number is not proof of registration.834 npmMIT