mcpField
T
TfNSW Realtime Alerts MCP Server

TfNSW Realtime Alerts MCP Server

Local
github.com/piddlingtunaMaps & Travel7Updated 86w ago

About TfNSW Realtime Alerts MCP Server

TfNSW Realtime Alerts MCP Server connects AI assistants to Transport for NSW's real-time alerts for disruptions and planned works. It offers mode-filtered alerts and a structured prompt for summarizing major disruptions.

Key features

  1. 01Retrieve current transport alerts
  2. 02Filter alerts by transport mode
  3. 03View affected routes, periods, and impacts
  4. 04Provide a disruption-summary prompt

Use cases

  1. 01Check current alerts for a transport mode
  2. 02Review routes affected by planned works
  3. 03Summarize major network disruptions

MCP support

The MCP server exposes TfNSW real-time transport alerts as a tool and resources, with filtering by transport mode. It also provides a prompt for summarizing major disruptions; a TfNSW Open Data API key is required.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"tfnsw-realtime-alerts": {
"command": "npx",
"args": [
"-y",
"tfnsw-realtime-alerts-mcp-server"
],
"env": {
"NSW_TRANSPORT_API_KEY": "<NSW_TRANSPORT_API_KEY>"
}
}
}
}
Run commandnpx -y tfnsw-realtime-alerts-mcp-server
Environment variables to set
NSW_TRANSPORT_API_KEYSecret

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmtfnsw-realtime-alerts-mcp-server

Tools

1

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
modeenumYesTransport mode to get alerts forall | buses | ferries | lightrail | metro | nswtrains | regionbuses | sydneytrains

Details

From the project README

TfNSW Realtime Alerts MCP Server

A Model Context Protocol server for Transport for NSW's (TfNSW) Realtime Alerts API. This server provides tools to access and interact with real-time transport alerts and information via Large Language Models.

Overview

This TypeScript-based MCP server implements integration with Transport for NSW's Realtime Alerts system. It enables AI assistants to access up-to-date information about transport disruptions, planned works, and other important alerts across the NSW transport network.

Features

Resources
  • List and access transport alerts via nsw-transport:// URIs
  • Filter alerts by transport mode (buses, trains, ferries, etc.)
  • Plain text format for easy consumption by AI assistants
Tools
  • get-transport-alerts - Retrieve current transport alerts
    • Filter by transport mode
    • Returns formatted alert information including affected routes, time periods, and impact details
Prompts
  • transport-disruption-summary - Generate a summary of current transport alerts
    • Includes relevant alert details as embedded resources
    • Returns structured prompt for LLM summarisation of major disruptions

Transport Modes

The following transport modes are supported:

  • all - All transport modes
  • buses - Sydney Metro and Outer Metro Bus services
  • ferries - Sydney Ferries and Newcastle Transport ferries
  • lightrail - Light Rail services
  • metro - Sydney Metro
  • nswtrains - NSW Trains regional trains and coaches
  • regionbuses - Regional Bus services
  • sydneytrains - Sydney Trains suburban and intercity network

Authentication

This server requires authentication with the TfNSW Open Data API. You will need to register for an API key at the TfNSW Open Data Hub.

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "tfnsw-realtime-alerts": {
      "command": "npx",
      "args": [
        "-y",
        "tfnsw-realtime-alerts-mcp-server"
      ],
      "env": {
        "NSW_TRANSPORT_API_KEY": "your_api_key_here"
      }
    }
  }
}

Replace "your_api_key_here" with your TfNSW API key from the TfNSW Open Data Hub.

Development

Configure your API key as an environment variable in your .env file:

NSW_TRANSPORT_API_KEY="your_api_key_here"

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch
Debugging

You can use the MCP Inspector for debugging, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.