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.

Bengaluru BMTC MCP-Server

Eine Implementierung eines Model Context Protocol (MCP)-Servers für die Busdienste der Bangalore Metropolitan Transport Corporation (BMTC).

Architektur

Der BMTC MCP-Server folgt einer modularen, mehrschichtigen Architektur. Das System ist darauf ausgelegt, Echtzeit-Transitdaten von Bussen der Bangalore Metropolitan Transport Corporation zu verarbeiten und über eine standardisierte API bereitzustellen.

Kernkomponenten

  1. API-Schicht : RESTful-Endpunkte für Authentifizierung, Routen, Haltestellen, Busstandorte und ETA-Informationen
  2. Serviceebene : Geschäftslogik, Datentransformation und ETA-Berechnungen
  3. Datenzugriffsschicht : MongoDB-Integration über Mongoose ODM
  4. Caching-Ebene : Redis-basiertes Caching für verbesserte Leistung
  5. Externe Integrationsschicht : BMTC-API-Integration

Lesen Sie die vollständige Architekturdokumentation

Merkmale

Hier ist die Liste der Dinge, die Sie mit dem MCP-Client oder im Chatfenster finden können:

  • Echtzeit-Ortung von Bussen
  • Streckeninformationen und Fahrpläne
  • Haltestellendetails und ETA (voraussichtliche Ankunftszeit)
  • Unterstützung für über 2.200 Buslinien und mehr als 8.400 Bushaltestellen in Bengaluru
  • Authentifizierung und Autorisierung
  • Daten-Caching und -Optimierung
  • Georäumliche Abfragen für nahegelegene Haltestellen und Busse

Voraussetzungen

  • Node.js (v14 oder höher)
  • npm oder yarn
  • MongoDB
  • Redis (optional, zum Zwischenspeichern)
  • Git

Installation und Einrichtung

Methode 1: Standardinstallation

  1. Klonen Sie das Repository
git clone https://github.com/ajeetraina/bengaluru-bmtc-mcp.git cd bengaluru-bmtc-mcp
  1. Installieren von Abhängigkeiten
npm install
  1. Konfigurieren von Umgebungsvariablen
cp .env.example .env

Bearbeiten Sie die .env Datei mit Ihrer Konfiguration:

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. Füllen Sie die Datenbank mit simulierten Daten (optional).
node src/scripts/seed.js
  1. Starten Sie den Server
npm start

Für die Entwicklung mit automatischem Neustart:

npm run dev

Methode 2: Verwenden von Docker Compose

  1. Klonen Sie das Repository
git clone https://github.com/ajeetraina/bengaluru-bmtc-mcp.git cd bengaluru-bmtc-mcp
  1. Umgebungsvariablen konfigurieren (optional)

Sie können die Umgebungsvariablen direkt in der Datei docker-compose.yml ändern oder eine .env Datei erstellen:

cp .env.example .env
  1. Erstellen und Starten der Container
docker-compose up -d

Dadurch werden drei Container gestartet:

  • bmtc-mcp-api : Der Node.js-API-Server
  • bmtc-mcp-mongo : MongoDB-Datenbank
  • bmtc-mcp-redis : Redis-Cache-Server
  1. Füllen Sie die Datenbank mit simulierten Daten (optional).
docker-compose exec api node src/scripts/seed.js
  1. Protokolle anzeigen
docker-compose logs -f api
  1. Stoppen Sie die Container
docker-compose down

So entfernen Sie auch Volumes:

docker-compose down -v

Verwenden der API

Sobald der Server läuft, können Sie auf die API zugreifen unter:

http://localhost:3000/api/v1

Die API-Dokumentation finden Sie unter:

http://localhost:3000/api-docs

Beispiele für API-Endpunkte

# 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-Schlüssel

JWT-Geheimnis

Das JWT-Geheimnis wird zum Signieren von Authentifizierungstoken verwendet. Generieren Sie eine sichere Zufallszeichenfolge:

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

Fügen Sie dies zu Ihrer .env Datei hinzu:

JWT_SECRET=your_generated_secret_here

BMTC-API-Schlüssel

Für die Entwicklung können Sie Mock-Daten ohne einen tatsächlichen BMTC-API-Schlüssel verwenden:

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

Für die Produktion müssen Sie sich direkt an BMTC wenden, um offiziellen API-Zugriff anzufordern.

Entwicklung

Testen

Führen Sie die Tests aus:

npm test

Führen Sie Tests mit Abdeckung durch:

npm run test:coverage

Fusseln

Codestil prüfen:

npm run lint

Beheben Sie Probleme mit dem Codestil:

npm run lint:fix

Projektstruktur

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

Beitragen

Weitere Informationen zu unserem Verhaltenskodex und zum Verfahren zum Einreichen von Pull Requests finden Sie in CONTRIBUTING.md .

Lizenz

Dieses Projekt ist unter der MIT-Lizenz lizenziert – Einzelheiten finden Sie in der Datei LICENSE .

Danksagung

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

Bietet Echtzeitzugriff auf Informationen zum öffentlichen Nahverkehr in Bangalore, einschließlich Busverfolgung, Fahrplänen, Routen und Service-Updates, um das Fahrgasterlebnis zu verbessern.

  1. Architektur
    1. Kernkomponenten
  2. Merkmale
    1. Voraussetzungen
      1. Installation und Einrichtung
        1. Methode 1: Standardinstallation
        2. Methode 2: Verwenden von Docker Compose
      2. Verwenden der API
        1. Beispiele für API-Endpunkte
      3. API-Schlüssel
        1. JWT-Geheimnis
        2. BMTC-API-Schlüssel
      4. Entwicklung
        1. Testen
        2. Fusseln
        3. Projektstruktur
      5. Beitragen
        1. Lizenz
          1. Danksagung

            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