Bangalore BMTC Mobility Connectivity Platform
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
API-Schicht : RESTful-Endpunkte für Authentifizierung, Routen, Haltestellen, Busstandorte und ETA-Informationen
Serviceebene : Geschäftslogik, Datentransformation und ETA-Berechnungen
Datenzugriffsschicht : MongoDB-Integration über Mongoose ODM
Caching-Ebene : Redis-basiertes Caching für verbesserte Leistung
Externe Integrationsschicht : BMTC-API-Integration
Lesen Sie die vollständige Architekturdokumentation
Related MCP server: poa-bus-mcp
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
Klonen Sie das Repository
git clone https://github.com/ajeetraina/bengaluru-bmtc-mcp.git
cd bengaluru-bmtc-mcpInstallieren von Abhängigkeiten
npm installKonfigurieren von Umgebungsvariablen
cp .env.example .envBearbeiten 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=infoFüllen Sie die Datenbank mit simulierten Daten (optional).
node src/scripts/seed.jsStarten Sie den Server
npm startFür die Entwicklung mit automatischem Neustart:
npm run devMethode 2: Verwenden von Docker Compose
Klonen Sie das Repository
git clone https://github.com/ajeetraina/bengaluru-bmtc-mcp.git
cd bengaluru-bmtc-mcpUmgebungsvariablen konfigurieren (optional)
Sie können die Umgebungsvariablen direkt in der Datei docker-compose.yml ändern oder eine .env Datei erstellen:
cp .env.example .envErstellen und Starten der Container
docker-compose up -dDadurch werden drei Container gestartet:
bmtc-mcp-api: Der Node.js-API-Serverbmtc-mcp-mongo: MongoDB-Datenbankbmtc-mcp-redis: Redis-Cache-Server
Füllen Sie die Datenbank mit simulierten Daten (optional).
docker-compose exec api node src/scripts/seed.jsProtokolle anzeigen
docker-compose logs -f apiStoppen Sie die Container
docker-compose downSo entfernen Sie auch Volumes:
docker-compose down -vVerwenden der API
Sobald der Server läuft, können Sie auf die API zugreifen unter:
http://localhost:3000/api/v1Die API-Dokumentation finden Sie unter:
http://localhost:3000/api-docsBeispiele 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/:routeIdAPI-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_hereBMTC-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_hereFü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 testFühren Sie Tests mit Abdeckung durch:
npm run test:coverageFusseln
Codestil prüfen:
npm run lintBeheben Sie Probleme mit dem Codestil:
npm run lint:fixProjektstruktur
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 functionsBeitragen
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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides real-time bus and train information across 10+ cities in Malaysia, including live vehicle tracking, arrival predictions, stop search, and route discovery for public transit systems.3MIT
- AlicenseNot gradedqualityDmaintenanceAccess bus stops, routes, and real-time information for Porto Alegre's public transportation system.3MIT
- FlicenseNot gradedqualityDmaintenanceProvides real-time and scheduled bus information for Montevideo's public transport system.1
- AlicenseNot gradedqualityDmaintenanceProvides Estonian public transport timetables, trip planning, stop search, and real-time vehicle tracking.MIT
Related MCP Connectors
Real-time transit stops, routes, arrivals, vehicle positions, and schedules via OneBusAway APIs.
Lviv public transport MCP: stops, timetables, routes, and live vehicle positions. No API key.
MBTA MCP — Boston real-time transit via the MBTA v3 API (api-v3.mbta.com)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/ajeetraina/bengaluru-bmtc-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server