Skip to main content
Glama
Hong Kong Bus ETA MCP

Hong Kong Bus ETA MCP

by devanshg03

Hong Kong Bus ETA MCP API Wrapper

This project is a Model Context Protocol (MCP) server built as a wrapper for the Hong Kong government's bus ETA API from data.gov.hk. The MCP server provides tools to search bus routes, stops, and get real-time arrival times for KMB and LWB bus services.

// index.ts - MCP server mounted on /mcp endpoint
app.post('/mcp', async (req: Request, res: Response) => {
  try {
    const transport: StreamableHTTPServerTransport = new StreamableHTTPServerTransport({
      sessionIdGenerator: undefined,
    });
    await server.connect(transport);
    await transport.handleRequest(req, res, req.body);
    ...

// mcp-server.ts - Available MCP tools
server.tool('search_bus_routes', 'Search for bus routes by number or destination', ...)
server.tool('search_bus_stops', 'Search for bus stops by name', ...)
server.tool('get_bus_eta', 'Get real-time bus arrival times for a stop', ...)
server.tool('get_route_stops', 'Get all stops for a specific route', ...)

Quick Start

# Install dependencies
npm install

# Build the project
npm run build

# Run the dev server
npm run dev

Related MCP server: chelaile-api-server

MCP Client Connection

To connect Claude Desktop to this Hong Kong Bus ETA MCP server, add the server to your claude_desktop_config.json file:

{
  "mcpServers": {
    "hk-bus-eta": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:4000/mcp"]
    }
  }
}

Usage Examples

Once connected, you can ask Claude to help with Hong Kong bus information:

"What bus routes go to Central?"

"When is the next bus arriving at Admiralty Station?"

"Show me all stops for bus route 104 going outbound"

"Find bus stops near Times Square"

The MCP tools will automatically fetch real-time data from the Hong Kong government's official bus API.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server that provides real-time access to Hong Kong's KMB and Long Win Bus route information and arrival times, enabling Language Models to answer user questions about bus routes, stops, and ETAs.
      5
      4
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients such as Xiaozhi and Codex to find nearby Hong Kong bus stops, check real-time next-arrival ETAs, and plan verified walk-plus-one-bus trips or report when no direct route exists. Responses include short Cantonese speech plus structured JSON, using keyless government and operator APIs.
      MIT