Skip to main content
Glama

🚂 irctc-mcp — Indian Railways Model Context Protocol (MCP) Server

irctc.dev MCP Protocol Zero Dependency

Official Model Context Protocol (MCP) server for irctc.dev. Connects Cursor, Windsurf, Claude Code, and Claude Desktop to authoritative Indian Railways real-time telemetry with sub-second execution.

When you ask your AI IDE:

"Check if my train 12557 is on time" or "Are there vacant seats on Rajdhani from Delhi to Patna?"

Your AI agent automatically invokes irctc-mcp tools to inspect live PRS reservation charts, seat availability forecasts, and GPS delay metrics.


⚡ 1-Minute Quickstart

1. Cursor IDE Integration (.cursor/mcp.json)

Add the following to your project's .cursor/mcp.json or global Cursor settings:

{
  "mcpServers": {
    "irctc": {
      "command": "npx",
      "args": ["-y", "irctc-mcp"],
      "env": {
        "IRCTC_API_KEY": "YOUR_IRCTC_DEV_API_KEY"
      }
    }
  }
}

(Get 10,000 Free Credits in 5 seconds at https://irctc.dev/dashboard)

2. Claude Desktop (claude_desktop_config.json)

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "indian-railways": {
      "command": "npx",
      "args": ["-y", "irctc-mcp"],
      "env": {
        "IRCTC_API_KEY": "YOUR_IRCTC_DEV_API_KEY"
      }
    }
  }
}

3. Claude Code CLI

claude mcp add irctc-mcp -- npx -y irctc-mcp

4. Windsurf / Cascade

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "irctc": {
      "command": "npx",
      "args": ["-y", "irctc-mcp"],
      "env": {
        "IRCTC_API_KEY": "YOUR_IRCTC_DEV_API_KEY"
      }
    }
  }
}

Related MCP server: db-mcp

🛠️ Available Agent Tools (14 Production Tools)

Tool Name

Parameters

Capabilities

check_pnr

pnr (10-digit string)

Real-time passenger manifest, coach & berth allocations (S4 65 LOWER), confirmation probability, and chart status.

get_live_running_status

train_no (string), date? (YYYY-MM-DD)

Live GPS train running position, current delay in minutes, next halt, platform numbers, and estimated timings.

search_trains

from (station code), to (station code), date?

Direct trains between any two stations with duration, distance in km, running days, and base fares.

check_seat_availability

train_no, from, to, date (DD-MM-YYYY), class_code?, quota?

Official 14-day continuous calendar forecast across travel classes (3A, 2A, SL) and quotas (GN, TQ, PT).

get_vacant_berths_post_chart

train_no, boarding_station, date?, class_code?

Post-charting vacant berths from online reservation charts for Current Booking and TTE allocation.

get_train_fare

train_no, from, to, class_code?, quota?

Calculate official IRCTC train fare breakdown across travel classes (1A, 2A, 3A, 3E, SL, CC, 2S) and quotas.

get_train_schedule

train_no

Full train route schedule, intermediate halt stations, arrival/departure timings, stop durations, and distance.

get_train_by_number

train_no

Quick train basic details by train number, including train name, type, origin, destination, and running days.

search_trains_by_name

name (min 2 chars)

Partial name train search (e.g., "Rajdhani", "Vande Bharat", "Shatabdi", "Garib Rath").

get_station_timetable

station_code, date

Station timetable: arrivals & departures board of all trains passing through a station on a given date.

search_stations

query

Fast autocomplete search for Indian Railways stations by station code or city name.

get_station_by_code

station_code

Detailed station information by station code (e.g. "NDLS"), including station name, state, and railway division.

get_cancelled_trains

none

Real-time list of today's cancelled, fully cancelled, and partially cancelled Indian Railways trains.

get_engine_health

none

Check irctc.dev Rail Engine health, offline corpus status, and in-memory index performance.


💡 Example Prompts to Ask Your AI Agent

  • "Is PNR 2265248473 confirmed? What are the coach and berth numbers?"

  • "What is the current delay and next station for train 12557 today?"

  • "Find all trains from New Delhi (NDLS) to Patna (PNBE) for this Friday."

  • "Check 14-day 3A seat availability for train 12557 from NKE to ANVT starting 17-11-2026."

  • "Are there any vacant berths on Vande Bharat 26501 departing Gorakhpur?"


🔐 Environment Variables

Variable

Description

Default

IRCTC_API_KEY

Your secret API key from irctc.dev. If omitted, checks ~/.irctc/config.json or uses anonymous free daily quota.

null

IRCTC_API_BASE_URL

Production Rail Engine Gateway.

https://api.irctc.dev


📄 License

MIT © IRCTC API Platform

Available Tools

14 tools
check_pnrA

Check real-time Indian Railways PNR status, passenger manifest, coach & berth allocations (e.g. S4 65 LOWER BERTH), confirmation probability, and chart preparation status.

Inputs: pnr (required).

check_seat_availabilityA

Fetch official 14-day continuous seat availability calendar forecast across travel classes (1A, 2A, 3A, 3E, SL) and quotas (GN, TQ, PT, LD) directly from PRS.

Inputs: to (required), date (required), from (required), train_no (required), +2 more.

get_cancelled_trainsA

Get real-time list of today's cancelled, fully cancelled, and partially cancelled Indian Railways trains.

Inputs: no named parameters.

get_engine_healthA

Check irctc.dev Rail Engine health, offline corpus status, and in-memory index performance.

Inputs: no named parameters.

get_live_running_statusA

Get real-time live running GPS status of any Indian Railways train, including current delay in minutes, last crossed station, upcoming halts, platform numbers, and estimated arrival/departure times.

Inputs: train_no (required), date.

get_station_by_codeB

Get detailed station information by station code, including station name, state, and railway division.

Inputs: station_code (required).

get_station_timetableA

Get all trains passing through, arriving at, or departing from a station on a given date (station timetable / arrivals & departures board).

Inputs: date (required), station_code (required).

get_train_by_numberA

Get quick train basic details by train number, including official train name, train type, origin, destination, running days, and total distance.

Inputs: train_no (required).

get_train_fareA

Calculate official IRCTC train fare breakdown across travel classes (1A, 2A, 3A, 3E, SL, CC, 2S) and quotas between origin and destination stations.

Inputs: to (required), from (required), train_no (required), quota, +1 more.

get_train_scheduleA

Get full train route schedule, intermediate halt stations, arrival/departure timings, stop durations, and total distance in km.

Inputs: train_no (required).

get_vacant_berths_post_chartB

Find real-time vacant berths and seats after chart preparation from online reservation charts for Current Booking and TTE allocation onboard.

Inputs: train_no (required), boarding_station (required), date, class_code.

search_stationsA

Autocomplete search Indian Railways stations by station code or partial city name (e.g. "NDLS", "delhi", "patna").

Inputs: query (required).

search_trainsA

Search running trains between any two Indian Railways station codes with departure/arrival times, travel duration, distance in kilometers, running days, and base fare estimates.

Inputs: to (required), from (required), date.

search_trains_by_nameA

Search Indian Railways trains by train name query (partial match, e.g. "Rajdhani", "Shatabdi", "Vande Bharat", "Garib Rath").

Inputs: name (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool targets a clearly distinct railway query: PNR status, train details, live running, route search, seat availability, vacant berths, fare, schedule, station timetable, station lookup, cancellations, and engine health. The few superficially similar tools (search_trains vs. search_trains_by_name, get_train_by_number vs. get_train_schedule) are cleanly separated by their descriptions.

    Naming Consistency5/5

    All names use consistent snake_case with a clear verb prefix (check_, get_, search_) followed by the resource or action. No mixed casing or conflicting verb styles appear across the set.

    Tool Count5/5

    With 14 tools, the server stays within a well-scoped range for an Indian Railways information service. Each tool covers a distinct query type and none appear redundant or unnecessary.

    Completeness4/5

    The surface covers most core railway inquiry workflows: PNR, train search, schedules, live status, fares, availability, station data, and cancellations. Minor gaps exist for adjacent cases like rescheduled/diverted trains or booking-related actions, but the core informational lifecycle is strong.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables real-time Indian Railways information retrieval, including live train running status, station schedules, and upcoming arrivals/departures.
      ISC
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that exposes the Deutsche Bahn public transport API to any MCP-compatible client (Claude Desktop, Cursor, Cline, Continue, etc.). Five tools cover station search, departures, journey planning, trip details, and nearby stations.
      6
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An (unofficial) MCP server for the Deutsche Bahn Timetables API — station search, planned departures, and real-time changes (delays, platform changes, cancellations) as tools for Claude and other MCP clients.
      4
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for Indian Railways data, enabling AI agents to search trains, get schedules, live status, PNR info, and more without an API key.
      11
      7 npm
      MIT