
KMB Bus MCP Server
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.
README
KMB Bus MCP Server
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.
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:
- Base URL: https://data.etabus.gov.hk/v1/transport/kmb
- KMB Open Data API Documentation
Prerequisites
- Python 3.10 or higher
- uv package manager
Installation
- First, install uv if you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Clone the repository:
git clone git@github.com:kennyckk/mcp_hkbus.git
cd mcp_hkbus
- Use uv to handle the python package:
uv sync #using uv.lock
Usage
- 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
}
}
}
- 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 routesget_stop_list()
: Get a list of all bus stopsget_route_stops()
: Get stops for a specific routefind_stops_by_name()
: Search for bus stops by nameget_all_routes_at_stop()
: Get all routes serving a specific stopget_eta()
: Get estimated arrival times
Testing
Run the test suite using pytest:
pytest test/kmb-mcp-tests.py
Dependencies
httpx
: For async HTTP requestsfastmcp
: For MCP server implementationpytest
: 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.