Cover image
Try Now
2025-03-31

Un servidor MCP que puede consultar información del bus, rutas, ETA, etc.

3 years

Works with Finder

1

Github Watches

1

Github Forks

3

Github Stars

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:

Prerequisites

  • Python 3.10 or higher
  • uv package manager

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 git@github.com: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.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • albert tan
  • Japanese education, creating tailored learning experiences.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

  • ravitemer
  • Un poderoso complemento Neovim para administrar servidores MCP (protocolo de contexto del modelo)

  • patruff
  • Puente entre los servidores Ollama y MCP, lo que permite a LLM locales utilizar herramientas de protocolo de contexto del modelo

  • HiveNexus
  • Un bot de chat de IA para equipos pequeños y medianos, que apoyan modelos como Deepseek, Open AI, Claude y Gemini. 专为中小团队设计的 ai 聊天应用 , 支持 Deepseek 、 Open ai 、 Claude 、 Géminis 等模型。

  • av
  • Ejecute sin esfuerzo LLM Backends, API, frontends y servicios con un solo comando.

  • JackKuo666
  • 🔍 Habilitar asistentes de IA para buscar y acceder a la información del paquete PYPI a través de una interfaz MCP simple.

    Reviews

    2 (1)
    Avatar
    user_PgfBfaPf
    2025-04-18

    As a devoted user of the mcp_hkbus application, I find it incredibly useful for navigating Hong Kong's bus system efficiently. The user-friendly interface and real-time updates make planning my trips a breeze. Kudos to kennyckk for developing such an essential tool for daily commuters. Highly recommended for anyone who relies on public transportation in Hong Kong!