Indian-Railways-MCP-Server

saurabhkankriya/Indian-Railways-MCP-Server

3.2

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.

Tools
10
Resources
0
Prompts
0

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

Indian Railways MCP Server Demo

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.

StatisticValue (2023–2025)
Daily PassengersA record 30 million passengers traveled on November 4, 2024[1]. Around 23 million passengers on average [2]
Monthly Passengers586–642 million[3]
Annual Passengers6.905 billion[2]
Daily Passenger Trains13,198[2]
Number of Stations7,364[5]
Route Length69,181 km[5]
Total Track Length135,207 km[2]
Employees1.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
  1. Press Release: Press Information Bureau, Nov 2024
  2. Wikipedia: Indian Railways
  3. Dataful Dataset: Ministry of Railways. Year- and Month-wise Total Number of Passengers
  4. Indian Railways Official Website - Employee Statistics
  5. 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

  1. PNR Status: Retrieves the current status of a railway ticket using its PNR (Passenger Name Record) number.
  2. Train Search: Searches for trains between two stations on a specific date.
  3. Station Search: Searches for railway stations in Indian Railways network by name or station code.
  4. Train Name Search: Searches for a train name by its train number.
  5. Train Schedule: Retrieves the complete schedule and route details for a specific train using its number.
  6. Train Classes: Retrieves available travel class categories for a specific train based on its number.
  7. Trains by Station: Retrieves comprehensive information about all trains passing through a specific railway station.
  8. Live Station Update: Retrieves real-time train information and updates for a specific railway station.
  9. Fare Details: Retrieves fare information for a train journey between specified stations.
  10. 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

Running this repo locally

  1. Clone the repository:
    git clone https://github.com/yourusername/indian_railways_mcp.git
    cd indian_railways_mcp
    
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Run the Gradio app:
    python app.py
    
  4. Access the app at http://localhost:7860 in your browser.

Useful resources

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.