Transport NSW API Client MCP
References swagger-client as a local dependency for integration with the Transport NSW API, enabling structured API access.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Transport NSW API Client MCPfind transport stops near Central Station"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Transport NSW API Client (MCP Implementation)
A Claude MCP for interacting with the Transport NSW API using direct HTTP requests.
About
This project implements a Model Context Protocol (MCP) service for Transport NSW's API.
Related MCP server: openbusdata
Setup
Clone this repository
Install dependencies using uv (fast Python package manager):
uv venv uv syncCreate a
.envfile with your API key:OPEN_TRANSPORT_API_KEY=your_api_key_here(Optional) Run the MCP Inspector:
uv run mcp dev api.pyAnd visit the server at http://localhost:5173 (port might be different).
Features
Stop Finder API: Find transport stops by name or coordinates
Alerts API: Get information about transport alerts and disruptions
Departure Monitor API: Get real-time departure information for transport stops
MCP Implementation: Structured as a Model Context Protocol service
Usage Examples
MCP Examples coming soon. Standard Python examples below:
Find Transport Stops
from api import find_transport_stops
# Search by name
stops = find_transport_stops(stop_name="Central Station")
# Search by coordinates (Central Station area)
central_station = '151.206290:-33.884080:EPSG:4326'
stops = find_transport_stops(coord=central_station, radius=500)Get Transport Alerts
from api import get_transport_alerts
# Get all current alerts
alerts = get_transport_alerts()
# Get alerts for a specific date
date_alerts = get_transport_alerts(date='22-03-2025')
# Get train alerts only (mot_type=1)
train_alerts = get_transport_alerts(mot_type=1)Monitor Real-time Departures
from api import get_departure_monitor
# Get departures from Central Station
departures = get_departure_monitor("200060") # Central Station ID
# Get departures for a specific time
from datetime import datetime
time_departures = get_departure_monitor("200060", time="15:30")
# Get only train departures
train_departures = get_departure_monitor("200060", mot_type=1) # 1 = TrainDemo Script
The project includes a comprehensive demo script that showcases all API functionality:
# Run the full demo
python demo.py
# Run specific sections
python demo.py --stops # Stop finder demo
python demo.py --alerts # Transport alerts demo
python demo.py --departures # Departure monitoring demoTesting
Local Testing
Run the complete test suite with pytest:
uv run pytestRun with coverage reporting:
uv run pytest --cov=apiContinuous Integration
Tests automatically run on GitHub Actions for every push and pull request to the main branch. The workflow:
Sets up Python 3.10
Installs uv and project dependencies
Runs tests with coverage reporting
To use this feature:
Add your
OPEN_TRANSPORT_API_KEYas a GitHub repository secretPush your code to GitHub
MCP Integration
This project follows the Model Context Protocol specification, allowing AI models to access Transport NSW data through a standardized interface.
Package Management
This project uses uv, a modern Python package manager written in Rust. Dependencies are managed through:
pyproject.toml: Defines project dependencies
License
This project is licensed under the MIT License.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server for interacting with the Berlin Public Transport (BVG) API to search for locations and plan journeys. It provides real-time access to departures, arrivals, trip details, and vehicle tracking within Berlin's transit network.MIT
- AlicenseCqualityBmaintenanceMCP server for the UK Bus Open Data Service, enabling timetable queries, stop search, route discovery, journey planning, and real-time bus tracking.16MIT
- Flicense-qualityDmaintenanceMCP server for real-time German public transport data (HAFAS/VBN network). Enables querying departures, arrivals, journeys, and nearby stops using natural language.
- Alicense-qualityBmaintenanceMCP server that integrates with the transport12 API to provide tools for searching stops, routes, arrivals, and vehicle forecasts, enabling natural language interaction with public transport data.9MIT
Related MCP Connectors
Swiss Transport MCP — wraps Transport Open Data API (free, no auth)
TomTom MCP — wraps the TomTom Search & Routing APIs (api.tomtom.com)
Real-time transit stops, routes, arrivals, vehicle positions, and schedules via OneBusAway APIs.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/danhussey/transportnsw-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server