Skip to main content
Glama

KMB Bus MCP Server

KMBバスMCPサーバー

香港のKMB(九龍巴士)とLong Win Bus(龍運巴士)の路線情報と到着時刻にリアルタイムでアクセスできるモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、言語モデルは香港のバスサービス情報を照会し、バスの路線、停留所、到着予定時刻に関するユーザーの質問に答えることができます。

特徴

  • リアルタイムのバス到着情報(ETA)
  • 包括的なバス路線検索
  • バス停情報と検索
  • ルート停留所マッピング
  • API呼び出しを最適化するキャッシュシステム
  • バイリンガルサポート(英語と中国語(繁体字))

データソース

このプロジェクトでは、公式の KMB/LWB オープン データ API を利用しています。

前提条件

  • Python 3.10以上
  • UVパッケージマネージャー

インストール

  1. まず、まだインストールしていない場合は uv をインストールします。
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. リポジトリをクローンします。
git clone git@github.com:kennyckk/mcp_hkbus.git cd mcp_hkbus
  1. uv を使用して Python パッケージを処理します。
uv sync #using uv.lock

使用法

  1. MCP クライアント (例: Claude Desktop) で構成を編集します。
{ "mcpServers": { "bus_service": { "command": "path/to/uv.exe", "args": ["--directory", "path/to/kmb_bus", "run", "kmb_mcp.py"], "background": true } } }
  1. サーバーは、言語モデルがバス情報を照会するために使用できるいくつかのツールを提供します。
  • get_route_list() : すべてのバス路線のリストを取得する
  • get_stop_list() : すべてのバス停のリストを取得する
  • get_route_stops() : 特定のルートの停留所を取得する
  • find_stops_by_name() : バス停を名前で検索する
  • get_all_routes_at_stop() : 特定の停留所を通るすべてのルートを取得する
  • get_eta() : 到着予定時刻を取得する

テスト

pytest を使用してテスト スイートを実行します。

pytest test/kmb-mcp-tests.py

依存関係

  • httpx : 非同期HTTPリクエスト用
  • fastmcp : MCPサーバーの実装用
  • pytest : テスト用(開発のみ)

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

謝辞

  • オープンデータAPIを提供するKMB/LWB
  • MCPプロトコル開発者

注記

このサービスはKMB/LWB Open Data APIに依存しています。APIのレート制限に留意し、本番環境では適切なエラー処理を実装してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

香港の KMB と Long Win バスのルート情報と到着時刻にリアルタイムでアクセスできるモデル コンテキスト プロトコル サーバー。これにより、言語モデルがバスのルート、停留所、到着予定時刻に関するユーザーの質問に答えることができます。

  1. 特徴
    1. データソース
      1. 前提条件
        1. インストール
          1. 使用法
            1. テスト
              1. 依存関係
                1. 貢献
                  1. 謝辞
                    1. 注記

                      Related MCP Servers

                      • A
                        security
                        F
                        license
                        A
                        quality
                        Enables Large Language Models to access real-time data on Vilnius public transport stops and routes through the Model Context Protocol.
                        Last updated -
                        2
                        1
                        Python
                      • A
                        security
                        A
                        license
                        A
                        quality
                        A Model Context Protocol server providing utility tools for development and testing, offering functionalities like personalized greetings, random card drawing, and datetime formatting with an extensible architecture.
                        Last updated -
                        19
                        215
                        2
                        TypeScript
                        MIT License
                        • Apple
                        • Linux
                      • -
                        security
                        F
                        license
                        -
                        quality
                        A Model Context Protocol server that enables Large Language Models to access and interact with database connections, including viewing schemas and performing CRUD operations on connected databases.
                        Last updated -
                        • Apple
                      • A
                        security
                        F
                        license
                        A
                        quality
                        An implementation of the Model Context Protocol (MCP) server using Server-Sent Events (SSE) for real-time communication, providing tools for calculations and dynamic resource templates.
                        Last updated -
                        1
                        JavaScript

                      View all related MCP servers

                      MCP directory API

                      We provide all the information about MCP servers via our MCP API.

                      curl -X GET 'https://glama.ai/api/mcp/v1/servers/kennyckk/mcp_hkbus'

                      If you have feedback or need assistance with the MCP directory API, please join our Discord server