Get the FREE Ultimate OpenClaw Setup Guide →

tfnsw-realtime-alerts

A Model Context Protocol (MCP) server for TfNSW's realtime alerts API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio piddlingtuna-tfnsw-realtime-alerts-mcp-server npx -y tfnsw-realtime-alerts-mcp-server \
  --env NSW_TRANSPORT_API_KEY="your_api_key_here"

How to use

This MCP server provides tools to access TfNSW Realtime Alerts via the Large Language Model workflow. It exposes a get-transport-alerts tool that can filter current alerts by transport mode (buses, trains, ferries, light rail, etc.) and returns formatted information suitable for embedding in prompts. Alerts are provided as plain text for easy consumption by AI assistants, and the transport-disruption-summary prompt can generate a concise summary of major disruptions with embedded resources for richer context. Use the nsw-transport:// URI scheme to reference specific alerts or routes when composing queries for your LLM-enabled assistant.

To interact with the server tools, you’ll typically call get-transport-alerts with optional filters (e.g., mode=buses) to retrieve up-to-date disruptions, planned works, and impact details. Then, you can request a transport-disruption-summary prompt to obtain a structured summary suitable for summarisation or report generation in your application or conversational agent.

How to install

Prerequisites:\n- Node.js and npm installed on your system\n- Access to a TfNSW Open Data API key (required for authentication)\n\nStep-by-step installation:\n1) Install dependencies (from the MCP server repository or your project directory):\nbash\nnpm install\n\n2) Build the MCP server (if a build script is provided):\nbash\nnpm run build\n\n3) Obtain your TfNSW API key from the TfNSW Open Data Hub and set it as an environment variable (example shown below).\nbash\n# Unix/Linux/macOS\nexport NSW_TRANSPORT_API_KEY=your_api_key_here\n\n# Windows (PowerShell)\n$Env:NSW_TRANSPORT_API_KEY="your_api_key_here"\n\n4) Run the MCP server locally using npx (as configured in the README):\nbash\nnpx -y tfnsw-realtime-alerts-mcp-server\n\n5) Verify the server is running and accessible via the MCP tooling integration you’re using (e.g., Claude Desktop config shown in the README).

Additional notes

Environment variables and configuration:\n- NSW_TRANSPORT_API_KEY is required for authentication with the TfNSW Open Data API. Keep this key secure and do not commit it to source control.\n- The MCP server supports multiple transport modes (all, buses, ferries, lightrail, metro, nswtrains, regionbuses, sydneytrains). Use appropriate filters when querying get-transport-alerts to narrow results.\n- If you encounter rate limits or authentication errors, check your API key validity and ensure it’s transmitted to the running process via the NSW_TRANSPORT_API_KEY environment variable.\n- The nsw-transport:// URI scheme is used to reference alerts or routes within prompts or responses for seamless integration with LLMs.\n- For debugging, you can use MCP Inspector or equivalent tooling to inspect requests and responses, and verify that the API key is being read correctly in the environment where the server runs.

Related MCP Servers

Sponsor this space

Reach thousands of developers