Skip to main content
Glama
TfNSW Trip Planner MCP Server

TfNSW Trip Planner MCP Server

by 3bobchen

TfNSW Trip Planner MCP Server

This project lets you ask Claude (Anthropic's AI assistant) about real-time NSW public transport — things like trip planning, live departures, and service alerts — by connecting it to the Transport for NSW Open Data APIs.

It works as an MCP server, which is a way to give Claude access to external tools and data sources.

What can it do?

Once set up, you can ask Claude things like:

  • "When is the next train from Central to Parramatta?"

  • "Are there any service alerts on the T1 line?"

  • "What buses leave from Town Hall in the next 30 minutes?"

  • "Plan a trip from Bondi Junction to Circular Quay"

  • "What stops are near me?" (using coordinates)

Behind the scenes, Claude uses these tools:

Tool

What it does

tfnsw_stop_finder

Searches for stops, stations, and places by name

tfnsw_trip

Plans a journey between two locations

tfnsw_departures

Shows the live departure board for a stop

tfnsw_service_alerts

Shows current service disruptions and alerts

tfnsw_coord_request

Finds stops near a geographic coordinate

Related MCP server: TfNSW Trip Planner MCP Server

Prerequisites

  • Node.js (version 18 or higher) — download here if you don't have it. To check, run node --version in your terminal.

  • Claude Desktop or Claude Code — you'll connect the server to one of these.

Setup

Get a free TfNSW API key

You need an API key to access Transport for NSW data. It's free.

  1. Go to opendata.transport.nsw.gov.au

  2. Click Sign up (top-right) and create an account

  3. Once logged in, click your username in the top-right header

  4. Click the API tokens tab

  5. Copy your API key — you'll use it below

Add to Claude

Choose one of the options below depending on which Claude app you use. Replace your_key with the API key you copied above.

Option A: Claude Code (terminal)

claude mcp add tfnsw-tripplanner -s user -e TFNSW_API_KEY=your_key -- npx tfnsw-tripplanner-mcp

Option B: Claude Desktop (app)

Open the Claude Desktop config file:

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

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

Add the following (replace your_key with your actual API key):

{
  "mcpServers": {
    "tfnsw-tripplanner": {
      "command": "npx",
      "args": ["tfnsw-tripplanner-mcp"],
      "env": {
        "TFNSW_API_KEY": "your_key"
      }
    }
  }
}

Restart Claude Desktop after saving the file.

That's it — no need to clone or build anything. npx will download and run the server automatically.

Available Tools

5 tools
tfnsw_coord_requestA

Find public transport stops and stations near a geographic coordinate in NSW. Returns nearby locations with names, distances, and available transport modes.

Inputs: latitude (required), longitude (required), type, radius.

tfnsw_departuresA

Get real-time departure board for a specific public transport stop in NSW. Shows upcoming services with line numbers, destinations, and real-time delays. Use tfnsw_stop_finder first to get the stop ID.

Inputs: stopId (required), date, time, limit.

tfnsw_service_alertsA

Get current service alerts and disruptions for NSW public transport. Shows planned works, delays, cancellations, and other disruptions. Can filter by date or stop.

Inputs: date, stopId.

tfnsw_stop_finderA

Search for public transport stops, stations, platforms, or points of interest in NSW by name or keyword. Returns matching locations with IDs (needed for other tools), coordinates, and available transport modes.

Inputs: query (required), maxResults.

tfnsw_tripA

Plan a public transport journey between two locations in NSW. Returns trip options with detailed legs including real-time departure/arrival times, line numbers, transfers, and walking directions.

Inputs: origin (required), destination (required), date, time, +2 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 5 tools

    Disambiguation4/5

    The five tools have mostly distinct purposes: trip planning, departure boards, service alerts, and two location lookup modes. The main overlap is between tfnsw_stop_finder and tfnsw_coord_request, but their descriptions clearly distinguish name/keyword search from coordinate-based nearby search.

    Naming Consistency4/5

    All tools use a consistent tfnsw_ prefix and snake_case, making the set predictable. However, the suffixes mix noun phrases and action-like forms (tfnsw_trip, tfnsw_departures, tfnsw_coord_request), so the pattern is not as uniform as verb_noun.

    Tool Count5/5

    Five tools is well-scoped for a transit trip-planning server. Each tool covers a distinct transit need without excessive surface area.

    Completeness4/5

    Core workflows are covered: finding stops by name or coordinate, planning trips, checking real-time departures, and viewing service alerts. Minor gaps remain around fares, accessibility details, or deeper trip metadata, but the essential lifecycle is present.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables journey planning, live departures, service alerts, and commuter car-park occupancy for Sydney and New South Wales across trains, metro, buses, ferries, and light rail, accessible via natural language queries.
      67 npm
      MIT