saurabhkankriya/Indian-Railways-MCP-Server
If you are the rightful owner of Indian-Railways-MCP-Server 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.
The Indian Railways MCP Server provides a standardized interface to access real-time railway data, facilitating integration with AI applications and tools.
title: Indian Railways MCP Server Demo emoji: 🚆 colorFrom: blue colorTo: green sdk: gradio app_file: app.py pinned: false tags: ["mcp-server-track"]
Indian Railways MCP Server for the HuggingFace MCP hackathon.
One protocol. 🇮🇳 Billions of 🚆 journeys
This is a HuggingFace Space running Gradio!
Demo video
Motivation for creating the Indian Railways MCP Server
Indian Railways is the fourth-largest railway network globally and the largest under single management[source]. It remains a vital part of India's transportation infrastructure, moving millions of passengers daily. Despite its massive scale, accessing real-time railway data programmatically has been challenging for developers and AI applications. This MCP server aims to bridge this gap by providing a standardized interface to Indian Railways' vast data ecosystem, enabling seamless integration with modern AI applications and tools.
Statistic | Value (2023–2025) |
---|---|
Daily Passengers | A record 30 million passengers traveled on November 4, 2024[1]. Around 23 million passengers on average [2] |
Monthly Passengers | 586–642 million[3] |
Annual Passengers | 6.905 billion[2] |
Daily Passenger Trains | 13,198[2] |
Number of Stations | 7,364[5] |
Route Length | 69,181 km[5] |
Total Track Length | 135,207 km[2] |
Employees | 1.2 million+[4] |
The Indian Railways MCP Server was developed to:
✅ Provide AI applications like Claude Desktop, AI Agents etc. a connector to access realtime Indian Railways data.
✅ Enable developers to quickly build applications and prototypes.
✅ Facilitate innovation and experimentation with railway data.
Statistic Citations
- Press Release: Press Information Bureau, Nov 2024
- Wikipedia: Indian Railways
- Dataful Dataset: Ministry of Railways. Year- and Month-wise Total Number of Passengers
- Indian Railways Official Website - Employee Statistics
- Wikipedia: Rail Transport in India
Integrate this Indian Railways MCP server with Cline:
{
"mcpServers": {
"gradio": {
"url": "https://agents-mcp-hackathon-mcp-indian-railways.hf.space/gradio_api/mcp/sse"
}
}
}
Integrate this Indian Railways MCP server with Claude Desktop:
{
"mcpServers": {
"gradio": {
"command": "npx",
"args": [
"mcp-remote",
"https://agents-mcp-hackathon-mcp-indian-railways.hf.space/gradio_api/mcp/sse",
"--transport",
"sse-only"
]
}
}
}
Available Tools
- PNR Status: Retrieves the current status of a railway ticket using its PNR (Passenger Name Record) number.
- Train Search: Searches for trains between two stations on a specific date.
- Station Search: Searches for railway stations in Indian Railways network by name or station code.
- Train Name Search: Searches for a train name by its train number.
- Train Schedule: Retrieves the complete schedule and route details for a specific train using its number.
- Train Classes: Retrieves available travel class categories for a specific train based on its number.
- Trains by Station: Retrieves comprehensive information about all trains passing through a specific railway station.
- Live Station Update: Retrieves real-time train information and updates for a specific railway station.
- Fare Details: Retrieves fare information for a train journey between specified stations.
- Seat Availability: Retrieves real-time seat availability information for a specific train journey.
Get the API from RAPIDAPI
You can access the Indian Railways API via RAPIDAPI. Search for "Indian Railways IRCTC" and subscribe to the API to get your key and usage details.
Gradio documentation
- Refer to the official Gradio documentation: Building MCP Server with Gradio
Running this repo locally
- Clone the repository:
git clone https://github.com/yourusername/indian_railways_mcp.git cd indian_railways_mcp
- Install dependencies:
pip install -r requirements.txt
- Run the Gradio app:
python app.py
- Access the app at
http://localhost:7860
in your browser.
Useful resources
- https://huggingface.co/blog/gradio-mcp
- https://www.gradio.app/guides/building-mcp-server-with-gradio
- https://github.com/modelcontextprotocol/python-sdk
Thanks to the sponsors of this hackathon
Special thanks to HuggingFace, OpenAI, Anthropic etc. for supporting this hackathon and providing the platform and resources to build and showcase innovative projects.