checking service

Indian Rail MCP

Train schedules, live running status, seat availability and PNR status from Indian Railways’ own enquiry services — as an MCP server for AI assistants, and as a TypeScript library.

npx -y indian-rail-mcp — runs on your machine, all six tools. A hosted endpoint is available too, with four.

What this is

An MCP server. Point an AI assistant at it and the assistant can answer real questions about Indian trains — where a train is right now, which trains run between two stations, whether there are berths free.

It reads from the two services Indian Railways operates publicly: the National Train Enquiry System for running information, and IRCTC’s reservation chart service for seats and PNR. No third-party data vendor sits in between.

Tools

getTrainInfo
both
Full schedule and route — every stop with arrival, departure, halt and distance.
Source · NTES
trackTrain
both
Live running status: scheduled against actual times, delay, platform and coach position.
Source · NTES
searchTrainBetweenStations
both
Direct trains between two stations, with departure, arrival, duration and days of run.
Source · NTES
getLiveStation
both
What is arriving and departing at a station over the next couple of hours.
Source · NTES
getSeatAvailability
stdio only
Coach-by-coach vacancy from the reservation chart, down to individual berths — including berths free on part of a route.
Source · IRCTC
checkPnrStatus
stdio only
Booking status for a PNR: passengers, coach, berth and current state.
Source · IRCTC

both works over stdio and at the hosted URL. stdio only works when you run the server on your own machine — IRCTC refuses requests from datacenters, so the hosted endpoint cannot reach those two. Why.

Connect an assistant

Recommended — run it yourself (all six tools)

Your MCP client launches it as a subprocess. Nothing to host, and the two IRCTC tools work.

{
  "mcpServers": {
    "indian-rail": {
      "command": "npx",
      "args": ["-y", "indian-rail-mcp"]
    }
  }
}

Hosted URL (four of six tools)

No install, but IRCTC refuses this server, so seat availability and PNR are unavailable.

https://indian-rail-mcp.vercel.app/api/mcp
{
  "mcpServers": {
    "indian-rail": {
      "type": "http",
      "url": "https://indian-rail-mcp.vercel.app/api/mcp"
    }
  }
}

Or use it as a library

import { trackTrain } from "indian-rail-mcp";

const status = await trackTrain("12951");

Why running it yourself gets more

IRCTC’s edge blocks datacenter traffic. The same request, with identical headers, seconds apart:

your machine    OK    18 coaches | chart=true | 51 vacant berths listed
hosted server   403   Access Denied — "You don't have permission to access
                      /online-charts/api/trainComposition on this server"

Nothing in the code differs. It is a decision made at their edge about where the request came from, and no amount of header-fiddling changes it. NTES has no such restriction, which is why four tools work everywhere and two do not.

Run the server on your own machine and the requests come from you, so all six work. That is also the better privacy outcome — PNR responses never touch anyone else’s server.

Before you rely on it

This is an independent project. It is not affiliated with, endorsed by, or supported by Indian Railways, CRIS or IRCTC. It is not an official service, and nothing here is an official announcement.
Information is best-effort. Indian Railways’ own enquiry service says the same of its data, including train timings, platform numbers and coach position. Check with the railways before you travel. For official enquiries, dial 139.
PNR data is personal data. PNR lookup returns passenger names, ages and berths. Run it yourself over stdio and that data never leaves your machine. On a hosted server it is disabled unless the caller presents an API key, and it fails closed if no key is configured. Responses are never logged or stored, and there are deliberately no batch lookups. Please keep it that way if you self-host.

Data source and attribution

Running data
National Train Enquiry System — enquiry.indianrail.gov.in
Seats and PNR
IRCTC — irctc.co.in
Operated by
Centre for Railway Information Systems (CRIS), Ministry of Railways
Ownership
All railway data is the property of Indian Railways

This project reads only information those services already publish openly. Responses that do not change during a day are cached, and requests are rate-limited, to keep load off the public services it depends on. Use of this data is subject to the NTES terms of use.