hk-election-mcp-server
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., "@hk-election-mcp-serverhow many registered electors in Hong Kong between 2009 and 2024?"
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.
Hong Kong Government Election and Legislature MCP Server
This is an MCP server that provides access to government security incident data through a FastMCP interface.
Features
Registered Electors Data: Retrieve the number of registered electors in Hong Kong's geographical constituencies for a specified range of years.
Related MCP server: Hong Kong community and social welfare MCP Server
Data Source
Registered electors data from Registration and Electoral Office (voterregistration.gov.hk)
Examples
List number of registered electors in geographical constituencies in Hong Kong between 2009 and 2024
Setup
Clone this repository
Install Python dependencies:
pip install -r requirements.txtRun the server:
python server.py
Running Options
Default stdio mode:
python server.pySSE mode (port 8000):
python server.py --sse
Cline Integration
To connect this MCP server to Cline using stdio:
Add this configuration to your Cline MCP settings (cline_mcp_settings.json):
{
"hk-election": {
"disabled": false,
"timeout": 3,
"type": "stdio",
"command": "uvx",
"args": [
"hkopenai.hk-election-mcp-server"
]
}
}Testing
Tests are available in the tests/ directory. Run with:
pytestAvailable Tools
1 toolget_gc_registered_electorsGet Gc Registered ElectorsC
Get the number of registered electors in Hong Kong's geographical constituencies by year range
| Name | Required | Description | Default |
|---|---|---|---|
| end_year | Yes | End year for data range | |
| start_year | Yes | Start year for data range |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It does not state that this is a read-only lookup, whether results are cached or current, how the year range is treated (inclusive?), or what happens when no data exists for a year.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence that states verb, resource, and dimension of aggregation with no filler. It is appropriately sized, though minimal.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists so return values need not be explained, and the two required parameters are fully documented in the schema. However, with no annotations and no behavioral notes, the definition is only minimally adequate for invoking the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both start_year and end_year documented in the schema, so the baseline is 3. The description's 'by year range' confirms the two parameters form a range but adds no syntax, inclusive/exclusive, or valid-range detail beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (Get) and resource (number of registered electors) with clear scope (Hong Kong geographical constituencies, by year range). There are no sibling tools to differentiate from, so the only missing point is that no distinction from any related metric is needed or given.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'by year range' implies the two required year parameters must be supplied, but there is no explicit when-to-use guidance, no conditions or prerequisites, and no note on what the data covers or excludes.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.8- First observed
get_gc_registered_electors
TDQS
Scored across 1 tool
With only one tool, there is no possibility of overlap or misselection; its purpose (registered elector counts by year range) is unambiguous.
The single tool follows a clear snake_case verb_noun pattern (get_gc_registered_electors), so there is no inconsistency to penalize, though consistency is trivially satisfied.
A single tool is extremely thin for a server framed as an election data source; while the specific metric is narrow, one read-only lookup does not justify a standalone server.
The surface covers only one metric (registered electors by year range) and lacks obvious election-domain operations such as constituency breakdowns, turnout, candidates, or results, creating dead ends for most queries.
Maintenance
Related MCP Connectors
Hong Kong Census and Statistics Department (C&SD) open-data MCP.
Read-only index to Japanese election data, official sources, relations and scoped search history.
Query UK Parliament, elections, crime stats, ONS census data, and national archives
Hong Kong Companies Registry (香港公司註冊處) open data via data.gov.hk (keyless): search companies by…
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables access to Hong Kong government's official open data portal (DATA.GOV.HK) through natural language queries. Supports searching datasets, browsing categories, and retrieving detailed information about Hong Kong's public data resources.88MIT
- AlicenseAqualityBmaintenanceEnables querying of Hong Kong government data on elderly community care services, such as waiting times and applicant counts.11MIT
- AlicenseBqualityBmaintenanceProvides access to Hong Kong climate and weather data from the Hong Kong Observatory, including current conditions, forecasts, warnings, tides, and more.197MIT
- AlicenseNot gradedqualityBmaintenanceEnables querying Hong Kong Census and Statistics Department open data via natural language or direct tool calls through the Pipeworx gateway.35 npmMIT