Skip to main content
Glama
hkopenai

hk-law-mcp-server

by hkopenai

Hong Kong law Data MCP Server

GitHub Repository License: MIT

This is an MCP server that provides access to law and security related data in Hong Kong through a FastMCP interface.

Features

Foreign Domestic Helpers Statistics

  • Get statistics on the number of Foreign Domestic Helpers in Hong Kong by country and year

Related MCP server: Hong Kong Government Data MCP Server

Data Source

  • Foreign Domestic Helpers statistics from Immigration Department

Examples

  • Get Foreign Domestic Helpers statistics for 2023

  • Get all Foreign Domestic Helpers statistics

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-law": {
    "disabled": false,
    "timeout": 3,
    "type": "stdio",
    "command": "uvx",
    "args": [
      "hkopenai.hk-law-mcp-server"
    ]
  }
}

Testing

Tests are available in the tests/ directory. Run with:

pytest

Available Tools

2 tools
get_foreign_domestic_helpers_statisticsB

Statistics on Foreign Domestic Helpers in Hong Kong. Data source: Immigration Department

ParametersJSON Schema
NameRequiredDescriptionDefault
yearNoFilter by specific year

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral details. It only states the topic and the data source ('Immigration Department'), without explaining what statistics are returned, how the year filter behaves, whether data is aggregated annually, or any limitations or update cadence.

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?

The description is a single compact sentence with no filler, and the data source is stated efficiently. It is appropriately front-loaded for a simple tool, though the brevity means some behavioral detail is sacrificed.

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?

With one optional parameter, full schema coverage, and an output schema present, the tool is relatively simple and the description provides some provenance ('Data source: Immigration Department'). However, it does not clarify what happens when no year is provided, which statistics are included, or how this tool fits alongside the sibling student visa statistics tool.

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?

The input schema already fully documents the single optional `year` parameter with a clear description and default null, so schema coverage is 100%. The description adds no additional meaning about how the year parameter affects the results, but the baseline of 3 is appropriate because the schema carries the semantic load.

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?

The description clearly identifies the resource ('Foreign Domestic Helpers in Hong Kong') and the operation type via the tool name and 'Statistics', so an agent can tell what domain it covers. It is not a tautology and names the data source, but it does not explicitly contrast with the student visa sibling tool or use a specific verb in the description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use when the agent needs Hong Kong foreign domestic helper statistics, but it gives no explicit when-to-use/when-not-to-use guidance or alternatives. The presence of the sibling tool get_student_visa_statistics is not leveraged to help an agent choose between them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_student_visa_statisticsA

Statistics on Student Visa / Entry Permit Approved in Hong Kong. Data source: Immigration Department

ParametersJSON Schema
NameRequiredDescriptionDefault
yearNoFilter by specific year

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral burden. It discloses that only approved visas/entry permits are included and attributes the data to the Immigration Department. It does not explicitly state whether the operation is read-only or mention any limitations of the statistics, though that risk is modest for a statistics-retrieval tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one compact sentence plus a source attribution; there is no filler. The core subject is front-loaded and the extra data-source detail is relevant context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity, a single fully-documented optional parameter, and a present output schema, the description covers the essential context. It could mention that omitting the year returns all years, but the schema's default already communicates this, so nothing critical is missing.

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?

There is one optional year parameter and the schema describes it fully. The description adds no parameter-specific detail beyond what the schema already provides, so baseline 3 is appropriate.

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?

The description clearly identifies a specific statistic (approved Student Visa / Entry Permit in Hong Kong) and names the data source. It is distinguishable from the sibling Foreign Domestic Helpers tool by the subject matter, though it does not state a verb like 'retrieves' or 'returns' beyond the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The domain is clear enough that an agent can infer this tool is for Hong Kong student visa statistics, and the sibling name indicates a different domain. However, there is no explicit statement of when to use this tool versus alternatives, and no exclusions are mentioned.

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. 2 tool updatesv0.1.8
    • First observedget_foreign_domestic_helpers_statistics
    • First observedget_student_visa_statistics

TDQS

A3.5/5.0

Scored across 2 tools

Disambiguation5/5

The two tools target clearly distinct statistics topics: Student Visa/Entry Permit versus Foreign Domestic Helpers. There is no overlap in purpose or data source.

Naming Consistency5/5

Both tool names follow the exact same 'get_' + descriptive noun pattern, making the naming convention consistent and predictable.

Tool Count3/5

With only 2 tools, the server feels thin for a domain like Hong Kong law/immigration statistics, but it is not unreasonably small for a focused niche.

Completeness3/5

The tools cover only two specific immigration statistics categories, leaving out many other visa types and legal data that could be expected from a Hong Kong law server. This is a notable gap.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server providing access to Hong Kong transportation data, including passenger traffic statistics at control points and real-time bus arrival information for KMB and Long Win Bus services.
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides access to Hong Kong financial data like business registrations, mortgage statistics, and HIBOR rates through a FastMCP interface.
    12
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP server for discovering, downloading, parsing, and searching Hong Kong listed company announcements from HKEXnews through 6 structured tools.
    6
    3
    MIT