Sreejit-Sengupto/IR-MCP
If you are the rightful owner of IR-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
IR-MCP is an Indian Railway utility application that connects Google's Gemini with Indian Railways to provide real-time information regarding trains, PNR status, and more.
IR-MCP
IR-MCP is an Indian Railway utility application that connects Google's Gemini with Indian Railways to provide real-time information regarding trains, PNR status, and more. It uses the Model Context Protocol (MCP) to facilitate seamless communication between the AI model (Gemini) and external services (Indian Railways APIs via RapidAPI).
Features
- Search Train: Find a train by its number.
- Check PNR Status: Retrieve the PNR details of a booked ticket.
- Train Status: Get live status updates of a train.
Installation
-
Clone the repository:
git clone https://github.com/Sreejit-Sengupto/IR-MCP.git cd IR-MCP
-
Install dependencies:
npm install
Usage
-
Build the application:
npm run build
-
Run the server:
Execute the command to start the MCP server:
node build/index.js
Project Structure
src/
: Contains the TypeScript source code.src/index.ts
: Main entry point for the MCP server.src/mcp-server.ts
: Defines the MCP server and its capabilities.src/fns/
: Contains functions for interacting with the Indian Railways APIs.search-train.ts
: Implements the train search functionality.pnr-status.ts
: Implements the PNR status check functionality.train-status.ts
: Implements the live train status functionality.
Dependencies
- @modelcontextprotocol/sdk: MCP SDK for server-client communication.
- axios: HTTP client for making API requests.
- zod: Schema validation library.
Environment Variables
The application requires the following environment variables:
RAPIDAPI_KEY
: Your RapidAPI key for accessing the Indian Railways APIs.
Contributing
Feel free to submit issues or pull requests for improvements and bug fixes.
License
This project is licensed under the ISC License.