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.
Provides data storage for the MCP server, handling transportation data including routes, schedules, and real-time tracking information for the BMTC system.
Serves as the runtime environment for the BMTC MCP server, powering the API and data processing layers.
Manages package dependencies for the BMTC MCP server implementation.
Enables caching and real-time data processing for fast ETA calculations and service alerts distribution across the BMTC transportation network.
Bengaluru BMTC MCP Server
An implementation of a Model Context Protocol (MCP) server for Bangalore Metropolitan Transport Corporation (BMTC) bus services.
Architecture
The BMTC MCP server follows a modular, layered architecture. The system is designed to handle real-time transit data from Bangalore Metropolitan Transport Corporation buses and provide it through a standardized API.
Core Components
- API Layer: RESTful endpoints for authentication, routes, stops, bus locations, and ETA information
- Service Layer: Business logic, data transformation, and ETA calculations
- Data Access Layer: MongoDB integration via Mongoose ODM
- Caching Layer: Redis-based caching for improved performance
- External Integration Layer: BMTC API integration
Read the full architecture documentation
Features
Here're the list of things that you can find using MCP Client or chat window:
- Real-time bus location tracking
- Route information and scheduling
- Stop details and ETA (Estimated Time of Arrival)
- Support for over 2,200 bus routes and 8,400+ bus stops in Bengaluru
- Authentication and authorization
- Data caching and optimization
- GeoSpatial queries for nearby stops and buses
Prerequisites
- Node.js (v14 or later)
- npm or yarn
- MongoDB
- Redis (optional, for caching)
- Git
Installation and Setup
Method 1: Standard Installation
- Clone the repository
- Install dependencies
- Configure environment variables
Edit the .env
file with your configuration:
- Seed the database with mock data (optional)
- Start the server
For development with auto-restart:
Method 2: Using Docker Compose
- Clone the repository
- Configure environment variables (optional)
You can modify the environment variables directly in the docker-compose.yml
file or create a .env
file:
- Build and start the containers
This will start three containers:
bmtc-mcp-api
: The Node.js API serverbmtc-mcp-mongo
: MongoDB databasebmtc-mcp-redis
: Redis cache server
- Seed the database with mock data (optional)
- View logs
- Stop the containers
To remove volumes as well:
Using the API
Once the server is running, you can access the API at:
For API documentation, visit:
Example API Endpoints
API Keys
JWT Secret
The JWT secret is used for signing authentication tokens. Generate a secure random string:
Add this to your .env
file:
BMTC API Key
For development, you can use mock data without an actual BMTC API key:
For production, you would need to contact BMTC directly to request official API access.
Development
Testing
Run the tests:
Run tests with coverage:
Linting
Check code style:
Fix code style issues:
Project Structure
Contributing
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
This server cannot be installed
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.
Provides real-time access to Bangalore's public transportation information including bus tracking, schedules, routes, and service updates to improve passenger experience.
Related MCP Servers
- AsecurityFlicenseAqualityEnables Large Language Models to access real-time data on Vilnius public transport stops and routes through the Model Context Protocol.Last updated -21Python
- AsecurityFlicenseAqualityFacilitates 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 -7JavaScript
- -securityAlicense-qualityThis 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 -115JavaScriptMIT License
- -securityAlicense-qualityA 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 -3PythonApache 2.0