Skip to main content
Glama
hkopenai

hk-election-mcp-server

by hkopenai

Hong Kong Government Election and Legislature MCP Server

GitHub Repository License: MIT

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

  1. Clone this repository

  2. Install Python dependencies:

    pip install -r requirements.txt
  3. Run the server:

    python server.py

Running Options

  • Default stdio mode: python server.py

  • SSE mode (port 8000): python server.py --sse

Cline Integration

To connect this MCP server to Cline using stdio:

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

pytest

Available Tools

1 tool
get_gc_registered_electorsGet Gc Registered ElectorsC

Get the number of registered electors in Hong Kong's geographical constituencies by year range

ParametersJSON Schema
NameRequiredDescriptionDefault
end_yearYesEnd year for data range
start_yearYesStart year for data range

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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. 1 tool updatev0.1.8
    • First observedget_gc_registered_electors

TDQS

B3.1/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of overlap or misselection; its purpose (registered elector counts by year range) is unambiguous.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness2/5

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

ActivityMaintained
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables 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.
    8
    8
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables querying Hong Kong Census and Statistics Department open data via natural language or direct tool calls through the Pipeworx gateway.
    35 npm
    MIT