About KMB HK
KMB HK is an MCP server in the Browser category: this project is a FastMCP-based proxy server for Kowloon Motor Bus (KMB) public API, providing tools for route, stop, ETA, fare and more. Easy to extend and suitable for automation, n8n, and AI scenarios.
Install
git clone https://github.com/chiuwa/MCP-KMB-HKThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about KMB HK
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
KMB FastMCP Server
簡介 (Introduction)
本專案是一個基於 FastMCP & 開放數據平台(data.gov.hk) 的九巴(KMB)API 代理伺服器,提供多種巴士路線、站點、即時到站、票價等查詢工具,並可輕鬆擴充。適合自動化、n8n、AI 應用等場景。
This project is a FastMCP-based proxy server & data.gov.hk for Kowloon Motor Bus (KMB) public API, providing tools for route, stop, ETA, fare and more. Easy to extend and suitable for automation, n8n, and AI scenarios.
安裝與啟動 (Install & Run)
- 安裝依賴 (Install dependencies):
- 推薦使用 uv(官方推薦)
uv pip install -r pyproject.toml- 或使用 pip:
pip install -r pyproject.toml - 啟動伺服器 (Start server)-sse:
fastmcp run server.py:mcp --transport sse --port 8080 --host 0.0.0.0 # 或 (or) python server.py
主要工具 (Main Tools)
get_kmb_routes()- 查詢所有九巴路線 (Get all KMB routes)
get_kmb_route_detail(route, direction, service_type)- 查詢指定路線詳細 (Get route detail)
find_routes_by_stop_name(stop_name)- 以站名查詢經過路線 (Find all routes passing a stop by name)
get_stops_by_route(route, direction, service_type)- 查詢路線所有站點 (Get all stops for a route)
get_eta_by_stop(stop_id)- 查詢站點即時到站時間 (Get ETA for all routes at a stop)
get_eta_by_stop_and_route(stop_id, route, service_type)- 查詢某站某路線即時到站時間 (Get ETA for a route at a stop)
get_stop_detail(stop_id)- 查詢站點詳細資料 (Get stop detail)
get_fare_by_route(route, direction, service_type)- 查詢路線票價(如有)(Get fare info for a route, if available)
範例 (Example)
查詢所有路線 (Get all routes)
{
"tool": "get_kmb_routes"
}
以站名查詢經過路線 (Find routes by stop name)
{
"tool": "find_routes_by_stop_name",
"stop_name": "美林"
}
查詢即時到站 (Get ETA)
{
"tool": "get_eta_by_stop",
"stop_id": "A3ADFCDF8487ADB9"
}
其他 (Others)
- 本專案僅用於學術/技術交流,資料來源:KMB 公開 API。
- This project is for academic/technical use only. Data source: KMB Open API.
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.