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
An implementation of a Mall Connector Program (MCP) server for Bangalore Metropolitan Transport Corporation (BMTC) bus services.
Architecture
The BMTC MCP server follows a modular, layered architecture that separates concerns and promotes maintainability. 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
- 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
- AsecurityAlicenseAqualityProvides professional cycling data from FirstCycling, allowing users to retrieve comprehensive information about cyclists, race results, historical cycling data, and team information through natural language queries.Last updated -18PythonMIT License