
kmb_mcp
提供九龙巴士路线、站点和预计到达时间信息的MCP服务器。
Repository Info
About This Server
提供九龙巴士路线、站点和预计到达时间信息的MCP服务器。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Kowloon Motor Bus (KMB) MCP Server
A Model Context Protocol (MCP) server that provides KMB route, stop, and ETA information from https://data.etabus.gov.hk/
Features
- Get Routes List and information
- Get Stops List and information
- Get ETA information
Data Source
This project utilizes the official ETA Bus API: BASE_URL = "https://data.etabus.gov.hk/"
Prerequisites
- Python 3.10 or higher
requestslibraryfastmcplibrary
Installation
-
Install Python
-
Install required dependencies:
pip install requests fastmcp
- Clone this repository:
git clone https://github.com/pongiotdevelop/kmb_mcp.git
Usage
- Add the below to your MCP configuration
{
"mcpServers": {
"kmb_mcp": {
"command": "python",
"args": [
"<directory of the project>/kmb_mcp.py"
]
}
}
}
- The server provides several tools that can be used by Language Models to Query the ETA bus information
get_Route_List(): Get the list of KMB bus routes.get_Route_API(route: str, direction: str = "outbound", Path: str = "1"): Get the route information for a specific KMB bus route.get_Stop_List(): Get the list of KMB bus stops.get_Stop_API(stop_id: str): Get the information for a specific KMB bus stop.get_Route_Stop_List(): Get the list of KMB bus stops for a specific route.get_Route_Stop_API(route: str, direction: str = "outbound", Path: str = "1"): Get the list of KMB bus stops for a specific route and direction.get_ETA_API(stop_id: str, route: str, service_type: str = "1"): Get the ETA for KMB bus routes.get_Stop_ETA_API(stop_id: str): Get the ETA for KMB bus routes.get_Route_ETA_API(route: str, service_type: str = "1"): Get the ETA for KMB bus routes.
Testing
Run the test.py for testing the API functions of MCP server:
python test.py
Dependencies
requests: For HTTP requestsfastmcp: For MCP server implementation
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Acknowledgments
- Real-time Arrival Information of The Kowloon Motor Bus Company (1933) Limited API Specifications
- The MCP protocol developers
Quick Start
Clone the repository
git clone https://github.com/pongiotdevelop/kmb_mcpInstall dependencies
cd kmb_mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.