Bangalore BMTC Mobility Connectivity Platform

Integrations

  • Manages environment configuration for the BMTC MCP server deployment.

  • Provides version control for the BMTC MCP server codebase.

  • Hosts the repository for the BMTC MCP server code and documentation.

ベンガルール BMTC MCP サーバー

バンガロール都市圏交通公社 (BMTC) のバス サービス用のモール コネクタ プログラム (MCP) サーバーの実装。

建築

BMTC MCPサーバーは、モジュール式の階層化アーキテクチャを採用しており、懸念事項を分離し、保守性を向上させます。このシステムは、バンガロール都市圏交通公社のバスからのリアルタイムの交通データを処理し、標準化されたAPIを通じて提供するように設計されています。

コアコンポーネント

  1. API レイヤー: 認証、ルート、停留所、バスの位置、到着予定時刻情報のための RESTful エンドポイント
  2. サービス層: ビジネスロジック、データ変換、ETA計算
  3. データ アクセス層: Mongoose ODM 経由の MongoDB 統合
  4. キャッシュ層: パフォーマンス向上のためのRedisベースのキャッシュ
  5. 外部統合レイヤー:BMTC API統合

完全なアーキテクチャドキュメントを読む

特徴

  • リアルタイムバス位置追跡
  • ルート情報とスケジュール
  • 停留所の詳細と到着予定時刻(ETA)
  • バンガロールの2,200以上のバス路線と8,400以上のバス停をサポート
  • 認証と承認
  • データのキャッシュと最適化
  • 近くの停留所やバスの地理空間クエリ

前提条件

  • Node.js (v14以降)
  • npmまたはyarn
  • モンゴDB
  • Redis(オプション、キャッシュ用)
  • ギット

インストールとセットアップ

方法1: 標準インストール

  1. リポジトリをクローンする
git clone https://github.com/ajeetraina/bengaluru-bmtc-mcp.git cd bengaluru-bmtc-mcp
  1. 依存関係をインストールする
npm install
  1. 環境変数を設定する
cp .env.example .env

設定に合わせて.envファイルを編集します。

PORT=3000 NODE_ENV=development MONGO_URI=mongodb://localhost:27017/bmtc-mcp REDIS_URI=redis://localhost:6379 API_KEY=your_api_key_here JWT_SECRET=your_jwt_secret_here JWT_EXPIRES_IN=86400 BMTC_API_ENDPOINT=https://bmtc-api-endpoint.example BMTC_API_KEY=your_bmtc_api_key_here CACHE_DURATION=300 LOG_LEVEL=info
  1. データベースに模擬データを入力する(オプション)
node src/scripts/seed.js
  1. サーバーを起動する
npm start

自動再起動を使用した開発の場合:

npm run dev

方法2: Docker Composeを使用する

  1. リポジトリをクローンする
git clone https://github.com/ajeetraina/bengaluru-bmtc-mcp.git cd bengaluru-bmtc-mcp
  1. 環境変数を設定する(オプション)

環境変数はdocker-compose.ymlファイルで直接変更することも、 .envファイルを作成することもできます。

cp .env.example .env
  1. コンテナを構築して起動する
docker-compose up -d

これにより、3 つのコンテナが起動します。

  • bmtc-mcp-api : Node.js API サーバー
  • bmtc-mcp-mongo : MongoDB データベース
  • bmtc-mcp-redis : Redis キャッシュサーバー
  1. データベースに模擬データを入力する(オプション)
docker-compose exec api node src/scripts/seed.js
  1. ログを表示
docker-compose logs -f api
  1. コンテナを停止する
docker-compose down

ボリュームも削除するには:

docker-compose down -v

APIの使用

サーバーが起動したら、次の場所で API にアクセスできます。

http://localhost:3000/api/v1

API ドキュメントについては、以下をご覧ください。

http://localhost:3000/api-docs

APIエンドポイントの例

# Authentication POST /api/v1/auth/login GET /api/v1/auth/me # Routes GET /api/v1/routes GET /api/v1/routes/:routeId GET /api/v1/routes/search?source=Kempegowda&destination=Electronic # Stops GET /api/v1/stops GET /api/v1/stops/:stopId GET /api/v1/stops/near?lat=12.9767&lng=77.5713&radius=500 GET /api/v1/stops/search?query=Lalbagh # Bus Locations GET /api/v1/bus-locations GET /api/v1/bus-locations/:busId GET /api/v1/bus-locations/near?lat=12.9767&lng=77.5713&radius=1000 # ETA GET /api/v1/eta/:stopId GET /api/v1/eta/:stopId/:routeId

APIキー

JWTシークレット

JWTシークレットは認証トークンの署名に使用されます。安全なランダム文字列を生成します。

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

これを.envファイルに追加します:

JWT_SECRET=your_generated_secret_here

BMTC APIキー

開発の場合、実際の BMTC API キーなしでモックデータを使用できます。

BMTC_API_ENDPOINT=https://bmtc-api-endpoint.example BMTC_API_KEY=your_bmtc_api_key_here

本番環境では、BMTC に直接連絡して公式 API アクセスをリクエストする必要があります。

発達

テスト

テストを実行します。

npm test

カバレッジ付きのテストを実行します。

npm run test:coverage

リンティング

コードスタイルを確認します:

npm run lint

コード スタイルの問題を修正します。

npm run lint:fix

プロジェクト構造

bengaluru-bmtc-mcp/ ├── .env.example # Environment variables template ├── .eslintrc.json # ESLint configuration ├── .github/ # GitHub configuration │ └── workflows/ # GitHub Actions workflows ├── .gitignore # Git ignore file ├── CONTRIBUTING.md # Contribution guidelines ├── Dockerfile # Docker configuration ├── LICENSE # MIT License ├── README.md # Project documentation ├── docker-compose.yml # Docker Compose configuration ├── docs/ # Documentation │ ├── api.md # API documentation │ └── setup.md # Setup guide ├── jest.config.js # Jest configuration ├── package.json # Project dependencies └── src/ # Source code ├── config/ # Configuration files ├── controllers/ # Request handlers ├── index.js # Application entry point ├── middlewares/ # Express middlewares ├── models/ # MongoDB models ├── public/ # Static files ├── routes/ # API routes ├── scripts/ # Utility scripts ├── services/ # External service integrations ├── tests/ # Test files └── utils/ # Utility functions

貢献

行動規範とプル リクエストの送信プロセスの詳細については、 CONTRIBUTING.md をお読みください。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

謝辞

-
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.

バスの追跡、スケジュール、ルート、サービス更新など、バンガロールの公共交通機関情報へのリアルタイム アクセスを提供し、乗客の体験を向上させます。

  1. 建築
    1. コアコンポーネント
  2. 特徴
    1. 前提条件
      1. インストールとセットアップ
        1. 方法1: 標準インストール
        2. 方法2: Docker Composeを使用する
      2. APIの使用
        1. APIエンドポイントの例
      3. APIキー
        1. JWTシークレット
        2. BMTC APIキー
      4. 発達
        1. テスト
        2. リンティング
        3. プロジェクト構造
      5. 貢献
        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
              F
              license
              A
              quality
              Facilitates real-time access to Singapore's Land Transport Authority (LTA) transportation data, offering insights into bus arrivals, train services, traffic conditions, and more through integration with the LTA DataMall API.
              Last updated -
              7
              JavaScript
            • -
              security
              A
              license
              -
              quality
              This server enables large language models to access and interact with real-time transport alerts from Transport for NSW's network, supporting filtering by transport mode and returning formatted alert information about disruptions and planned works.
              Last updated -
              11
              5
              JavaScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              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.
              Last updated -
              3
              Python
              • Linux
              • Apple

            View all related MCP servers

            ID: 2l0m5ujizz