https://github.com/piddlingtuna/tfnsw-realtime-alerts-mcp-server
A Model Context Protocol (MCP) server for TfNSW's realtime alerts API
https://github.com/piddlingtuna/tfnsw-realtime-alerts-mcp-server
Last synced: 14 days ago
JSON representation
A Model Context Protocol (MCP) server for TfNSW's realtime alerts API
- Host: GitHub
- URL: https://github.com/piddlingtuna/tfnsw-realtime-alerts-mcp-server
- Owner: piddlingtuna
- License: mit
- Created: 2025-03-02T11:49:01.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-09T03:02:59.000Z (8 months ago)
- Last Synced: 2025-09-29T19:38:39.381Z (about 1 month ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 7
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mcp-servers - **tfnsw-realtime-alerts-mcp-server** - A Model Context Protocol (MCP) server for TfNSW's realtime alerts API `http` `ai` `llm` `git` `github` `npm install piddlingtuna/tfnsw-realtime-alerts-mcp-server` (📦 Other)
- awesome-mcp-servers - piddlingtuna/tfnsw-realtime-alerts-mcp-server - driven access to real-time transport alerts from Transport for NSW, enhancing LLM capabilities with up-to-date disruption information. (✈️ Travel & Transportation)
- metorial-index - TfNSW Realtime Alerts - Access real-time transport alerts and information, including current disruptions and planned works across the NSW transport network. Retrieve and filter alerts by transport mode for efficient management of transport-related data. (APIs and HTTP Requests)
- toolsdk-mcp-registry - ❌ tfnsw-realtime-alerts - to-date public transport disruptions and alerts across the NSW network. (node) (Travel & Transportation / How to Submit)
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](https://opendata.transport.nsw.gov.au/).
## 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`
```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](https://opendata.transport.nsw.gov.au/).
## Development
Configure your API key as an environment variable in your `.env` file:
```
NSW_TRANSPORT_API_KEY="your_api_key_here"
```
Install dependencies:
```bash
npm install
```
Build the server:
```bash
npm run build
```
For development with auto-rebuild:
```bash
npm run watch
```
### Debugging
You can use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) for debugging, which is available as a package script:
```bash
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.