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.
Setup
- Clone this repository
- Install dependencies using uv (fast Python package manager):
- Create a
.env
file with your API key: - (Optional) Run the MCP Inspector:And 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
Get Transport Alerts
Monitor Real-time Departures
Demo Script
The project includes a comprehensive demo script that showcases all API functionality:
Testing
Local Testing
Run the complete test suite with pytest:
Run with coverage reporting:
Continuous 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_KEY
as a GitHub repository secret - Push 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.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Transport NSW の API と対話するための MCP サービス。これにより、ユーザーは場所周辺の交通機関の停留所を検索したり、交通警報や交通混乱に関する情報を取得したりできます。
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server that provides access to NS (Dutch Railways) travel information.Last updated -81339TypeScriptMIT License
- -securityAlicense-qualityThis server enables large language models to access and interact with real-time transport alerts from Transport for NSW's network, supporting filtering by transport mode and returning formatted alert information about disruptions and planned works.Last updated -37JavaScriptMIT License
- -securityFlicense-qualityAn MCP Server that enables interaction with Maharashtra's Motor Vehicle Department API, allowing users to access transportation-related services through natural language requests.Last updated -Python
- -securityFlicense-qualityA MCP server that uses Amap API to provide location-based services, allowing users to get geographic information based on IP addresses and search for nearby points of interest.Last updated -10Python