mcpField
K
KMB Bus MCP Server

KMB Bus MCP Server

Local
github.com/kennyckkMaps & Travel4Updated 61w ago

About KMB Bus MCP Server

KMB Bus MCP Server gives language models access to real-time route, stop, and arrival information for Hong Kong's KMB and Long Win Bus services. It includes stop searches and route-stop mappings, with caching to optimize API calls.

Key features

  1. 01Query real-time bus arrival times
  2. 02List and query bus routes
  3. 03List and search bus stops
  4. 04Map routes to stops and stops to routes
  5. 05Cache API results
  6. 06Support English and Traditional Chinese

Use cases

  1. 01Check when a KMB bus is due
  2. 02Find a stop by name
  3. 03See which routes serve a stop
  4. 04Find stops along a specific route

MCP support

Exposes bus route, stop, search, and ETA tools to MCP clients, using the official KMB/LWB Open Data API.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"mcp_hkbus": {
"command": "npx",
"args": [
"-y",
"@smithery/cli"
]
}
}
}
Run commandnpx -y @smithery/cli

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@smithery/cli

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MseeP.ai Security Assessment Badge

KMB Bus MCP Server

smithery badge

A Model Context Protocol (MCP) server that provides real-time access to Hong Kong's KMB (九龍巴士) and Long Win Bus (龍運巴士) route information and arrival times. This server enables Language Models to query Hong Kong bus service information to answer user questions about bus routes, stops, and estimated arrival times.

KMB Bus Server MCP server

Features

  • Real-time bus arrival information (ETA)
  • Comprehensive bus route queries
  • Bus stop information and searches
  • Route-stop mapping
  • Caching system to optimize API calls
  • Bilingual support (English and Traditional Chinese)

Data Source

This project utilizes the official KMB/LWB Open Data API:

Prerequisites

  • Python 3.10 or higher
  • uv package manager

Installation

Installing via Smithery

To install KMB Bus MCP for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @kennyckk/mcp_hkbus --client claude
Manual Installation
  1. First, install uv if you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Clone the repository:
git clone [email protected]:kennyckk/mcp_hkbus.git
cd mcp_hkbus
  1. Use uv to handle the python package:
uv sync #using uv.lock

Usage

  1. Edit the Config in your MCP Client (e.g. Claude Desktop):
{
  "mcpServers": {
    "bus_service": {
      "command": "path/to/uv.exe",
      "args": ["--directory", "path/to/kmb_bus", "run", "kmb_mcp.py"],
      "background": true
    }
  }
}
  1. The server provides several tools that can be used by Language Models to query bus information:
  • get_route_list(): Get a list of all bus routes
  • get_stop_list(): Get a list of all bus stops
  • get_route_stops(): Get stops for a specific route
  • find_stops_by_name(): Search for bus stops by name
  • get_all_routes_at_stop(): Get all routes serving a specific stop
  • get_eta(): Get estimated arrival times

Testing

Run the test suite using pytest:

pytest test/kmb-mcp-tests.py

Dependencies

  • httpx: For async HTTP requests
  • fastmcp: For MCP server implementation
  • pytest: For testing (development only)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

  • KMB/LWB for providing the open data API
  • The MCP protocol developers

Note

This service relies on the KMB/LWB Open Data API. Please be mindful of API rate limits and implement appropriate error handling in production environments.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.