Skip to main content
Glama
hk-election-mcp-server

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

Inputs: end_year (required), start_year (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    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

    ActivitySlowing
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      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
      16 PyPI
      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.
      299 npm
      MIT