NSW Transport

io.github.fisher98kim由 GitHub 账号 fisher98kim 发布v0.3.1更新于 Oct 30, 2026

NSW public transport: trip planning, real-time departures, service alerts, Park&Ride car parks.

已验证STDIO仅桌面位置与生活效率与工作流

概览

AI 生成的概览

新南威尔士州公共交通服务器:规划悉尼行程、查询实时班次、服务通告和 Park&Ride 停车场空位。

可以做什么
  • 按名称搜索火车站、巴士站、码头和轻轨站,返回站点 ID 与所服务的交通方式
  • 查询某站点的下一班车,含实时延误和站台,可按交通方式和时间筛选
  • 规划 A 到 B 的行程,含分段、站台、延误和通告,支持最晚到达时间和交通方式限制
  • 列出当前中断、轨道施工和服务变更,可按交通方式、线路或站点筛选
  • 查询 Park&Ride 停车场实时空位,并查看某停车场指定日期的逐小时占用历史
适用场景
适合需要悉尼地区实时公共交通信息的场景:现在或按截止时间如何从 A 到 B、下一班车何时出发、某条线路是否有中断,或车站停车场是否还有空位。
运行要求
以 Python 包形式通过 uvx 在本地运行(需先安装 uv)。需要免费的 Transport for NSW Open Data Hub API 令牌,通过环境变量 NSW_TRANSPORT_API_KEY 提供,并需能访问 TfNSW 接口的网络。
安装前请注意
需要 NSW_TRANSPORT_API_KEY 密钥,请勿写入共享配置或日志。所有工具均为只读查询,但每次查询都会发送到 Transport for NSW 接口,免费套餐每个应用每月限 2,500 次调用。时间均按悉尼当地时间解释。

安装

在 SourceWeft 中

  1. 打开 控制台中的 NSW Transport,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-au-nsw

MCP servers for NSW Government APIs. Ask Claude (or any MCP client) things like "How do I get from UNSW to Circular Quay right now?", "Any crashes on the M4?", "Is electrician licence 241132C current?" or "Where's the cheapest diesel near Parramatta?" and get live answers.

ServerWhat it coversData sourceKey
transportTrip planning, real-time departures, service alerts (trains, metro, buses, light rail, ferries), Park&Ride car parksTfNSW Open Data HubTfNSW key
roadsLive traffic hazards (crashes, roadworks, floods, fires, events) and toll costsTfNSW Open Data HubTfNSW key (same one)
licencesLicence checks on 15 NSW public registers (tradespeople, property agents, security, liquor, pharmacies, WHS licences, ...)API.NSWOne API.NSW key per register
fuelLive fuel prices for NSW & TASAPI.NSWAPI.NSW key

Each server is a separate subcommand, so you only add the ones you need.

Quick start

1. Get API keys (free)

TfNSW Open Data Hub (for transport and roads; one key covers both)

  1. Register: https://opendata.transport.nsw.gov.au/data/user/register
  2. Log in: https://opendata.transport.nsw.gov.au/data/user/login
  3. Click your profile icon → API Tokens, enter a name and click Create API Token.
  4. Copy the token right away; it can't be viewed again. This is your NSW_TRANSPORT_API_KEY.

Official guide: https://opendata.transport.nsw.gov.au/developers/userguide

API.NSW (for fuel and licences)

  1. Register: https://api.nsw.gov.au/Account/Register (log in: https://api.nsw.gov.au/Account/Login)
  2. Go to My Apps → Add new app: https://api.nsw.gov.au/DeveloperApp/AppCreate and attach one API product. Each app can have only one API product, so create one app per API you want (e.g. one for the Fuel API, one for the Trades register).
  3. Copy each app's API Key and API Secret into the matching environment variables (NSW_FUEL_API_KEY / NSW_FUEL_API_SECRET, NSW_TRADES_API_KEY / NSW_TRADES_API_SECRET, ...; see the licences section for the full list). The free plan allows 2,500 calls per month per app.

2. Install uv (if you don't have it)

bash
curl -LsSf https://astral.sh/uv/install.sh | sh

3. Add the servers to your MCP client

Claude Code

bash
claude mcp add nsw-transport -e NSW_TRANSPORT_API_KEY=your-tfnsw-key -- uvx mcp-au-nsw transportclaude mcp add nsw-roads     -e NSW_TRANSPORT_API_KEY=your-tfnsw-key -- uvx mcp-au-nsw roadsclaude mcp add nsw-fuel      -e NSW_FUEL_API_KEY=your-key -e NSW_FUEL_API_SECRET=your-secret -- uvx mcp-au-nsw fuelclaude mcp add nsw-licences  -e NSW_TRADES_API_KEY=your-key -e NSW_TRADES_API_SECRET=your-secret -- uvx mcp-au-nsw licences

For licences, pass the key pair of every register you subscribed to; registers without keys are simply unavailable.

Claude Desktop / Cursor / other clients: add the servers you want to the MCP config file (claude_desktop_config.json, .cursor/mcp.json, etc.):

json
{  "mcpServers": {    "nsw-transport": {      "command": "uvx",      "args": ["mcp-au-nsw", "transport"],      "env": { "NSW_TRANSPORT_API_KEY": "your-tfnsw-key" }    },    "nsw-roads": {      "command": "uvx",      "args": ["mcp-au-nsw", "roads"],      "env": { "NSW_TRANSPORT_API_KEY": "your-tfnsw-key" }    },    "nsw-fuel": {      "command": "uvx",      "args": ["mcp-au-nsw", "fuel"],      "env": { "NSW_FUEL_API_KEY": "your-key", "NSW_FUEL_API_SECRET": "your-secret" }    },    "nsw-licences": {      "command": "uvx",      "args": ["mcp-au-nsw", "licences"],      "env": {        "NSW_TRADES_API_KEY": "your-key", "NSW_TRADES_API_SECRET": "your-secret",        "NSW_PROPERTY_API_KEY": "your-key", "NSW_PROPERTY_API_SECRET": "your-secret"      }    }  }}

uvx caches the version it first downloads. To pick up a new release, use uvx mcp-au-nsw@latest ... or run uv cache clean mcp-au-nsw.

How the servers behave

  • Places by name. Tools that take a place accept names ("Town Hall", "17 High St Kensington", "Sydney Opera House"), stop IDs, or lat,lng.
  • No guessing. If a name matches several places about equally well (e.g. "UNSW" has two light rail stops, "Sydney Airport" has domestic and international stations), the tool returns the candidates instead of picking one, so the assistant can ask you.
  • Live data, no caching. Every call fetches fresh data. Responses include stable IDs (stop IDs, station codes) so you can build your own lookups for analysis.
  • Sydney local time. All times are YYYY-MM-DD HH:MM in Sydney time.

transport server

ToolWhat it does
plan_tripA-to-B journeys with legs, platforms, real-time delays and alerts. Supports arrive-by times and limiting modes
get_departuresNext departures from a station or stop, with real-time delays and platforms
get_service_alertsCurrent disruptions and trackwork, filtered by mode, line (T1, L2, 333, ...) or stop
find_stopsSearch stations, stops and wharves by name; returns stop IDs and modes
get_car_park_availabilityLive free spaces at Transport Park&Ride car parks, by name or distance from a place
get_car_park_historyHow full a Park&Ride car park was through a given day: hourly occupancy, peak, and when it filled up

Example prompts:

  • "How do I get from UNSW to Circular Quay right now?"
  • "I need to be at Manly Wharf by 6pm. When should I leave Martin Place?"
  • "When's the next train from Town Hall?"
  • "Any problems on the T1 today?"
  • "Are there any spaces left at the Tallawong Park&Ride?"
  • "What time did the Tallawong P1 car park fill up yesterday?"

roads server

ToolWhat it does
get_traffic_hazardsCrashes, breakdowns, roadworks, floods, fires, alpine conditions and major events. Filter by area/road name or distance from a place
calculate_tollToll cost (AUD) and motorways used between two places, compared with the quickest toll-free route

Example prompts:

  • "Anything happening on the M4 right now?"
  • "Any roadworks or events near Parramatta this weekend?"
  • "How much are the tolls from Parramatta to Sydney International Airport, and how much time do they save?"

Toll amounts are estimates from Transport for NSW and may differ from what is actually charged.

licences server

Checks licences on NSW public registers. All registers work the same way: look up a licence number, search by person or business name, and get the full public record.

ToolWhat it does
verify_licenceCheck a licence number: status (Current/Expired/...), expiry, licence type and holder
search_licencesFind licences by person or business name (partial names work), current ones first
get_licence_detailsFull record: licence classes (what work it covers), conditions, history, premises, associated people and licences, and compliance actions (disciplinary actions, suspensions, prosecutions, public warnings, insurance claims)
list_registersWhich registers exist, what they cover, and which are configured
Register (register value)CoversEnvironment variablesSubscribe
tradesBuilding contractors and tradespeopleNSW_TRADES_API_KEY, NSW_TRADES_API_SECRETTrades API
propertyReal estate agents, property and strata managersNSW_PROPERTY_API_*Property API
securitySecurity guards and businessesNSW_SECURITY_API_*Security API
liquorLiquor licences and premisesNSW_LIQUOR_API_*Liquor API
motorMotor dealers, repairers, recyclersNSW_MOTOR_API_*Motor API
conveyancerConveyancersNSW_CONVEYANCER_API_*Conveyancer API
lotteriesTrade promotion lotteries and games of chanceNSW_LOTTERIES_API_*Lotteries API
owner_builderOwner builder permitsNSW_OWNER_BUILDER_API_*Owner Builder Permit API
home_building_compensationHome building compensation certificatesNSW_HOME_BUILDING_COMPENSATION_API_*Home Building Compensation API
building_practitionersDesign and building practitioners, engineersNSW_BUILDING_PRACTITIONERS_API_*Design and Building Practitioners API
asbestosAsbestos removal and demolition licencesNSW_ASBESTOS_API_*Asbestos and Demolition
high_risk_workHigh risk work licences (forklifts, cranes, ...)NSW_HIGH_RISK_WORK_API_*High Risk Work
white_cardsConstruction induction and traffic control cardsNSW_WHITE_CARDS_API_*White Cards
trainersRegistered training organisationsNSW_TRAINERS_API_*Trainers and Providers API
pharmaciesPharmacy premises and financial interest holdersNSW_PHARMACIES_API_*Register of Pharmacies

NSW_X_API_* means NSW_X_API_KEY and NSW_X_API_SECRET.

Example prompts:

  • "Is electrician licence 241132C current, and does it cover electrical work?"
  • "Check whether my builder, Smith Constructions, holds a current licence and has any disciplinary actions."
  • "Is this real estate agent licensed?"

Records come straight from the public registers and can include the names, roles and addresses of licence holders and associated people.

fuel server

ToolWhat it doesAPI calls
find_fuel_pricesCheapest (or nearest) stations for a fuel type around a suburb, postcode or coordinates1 (2 with a suburb/postcode)
get_station_pricesAll current prices at one station1
search_stationsFind stations by name, brand, suburb or postcode1
list_fuel_typesFuel type codes (U91, E10, P98, DL, ...)1

Prices are in cents per litre.

Example prompts:

  • "Where's the cheapest diesel near UNSW?"
  • "What are the prices at BP Redfern right now?"

Development

bash
git clone https://github.com/fisher98kim/mcp-au-nswcd mcp-au-nswuv syncuv run pytest
# run a server locally with keys from .envuv run --env-file .env mcp-au-nsw transport

To try local changes in Claude Code:

bash
claude mcp add nsw-transport-dev -e NSW_TRANSPORT_API_KEY=... \  -- uv run --directory /path/to/mcp-au-nsw mcp-au-nsw transport

Releasing

  1. Bump version in pyproject.toml and in every registry/*.json (a test checks they match).
  2. Create a GitHub Release tagged v<version>. The workflow publishes to PyPI, then updates the MCP Registry entries (one per server).

License

MIT. Not affiliated with or endorsed by the NSW Government or Transport for NSW. Data is provided by API.NSW and the TfNSW Open Data Hub under their own terms of use.

来源:README.md,提交 50ffa0d

工具

6

find_stops

Search train stations, bus stops, wharves and light rail stops by name. Returns stop IDs and the modes served.

输入参数limitquery必填

get_departures

Next departures from a station or stop, with real-time delays and platforms. stop: a stop name (e.g. "Town Hall Station") or stop ID from find_stops. modes: only include these modes (e.g. ["train"]). when: 'HH:MM' or 'YYYY-MM-DD HH:MM' Sydney time; default now.

输入参数stop必填whenlimitmodes

plan_trip

Plan a public transport journey from A to B, using real-time data where available. origin/destination: a place name (station, address, landmark like "UNSW"), stop ID, or 'lat,lng'. when: 'HH:MM' or 'YYYY-MM-DD HH:MM' Sydney time; default now. arrive_by: treat `when` as the arrival deadline. modes: only use these modes (walking is always allowed).

输入参数whenlimitmodesorigin必填arrive_bydestination必填

get_service_alerts

Current disruptions, trackwork and service changes. Filter by mode, line (e.g. "T1", "L2", "333") and/or stop name. There are usually hundreds of current alerts, so always filter when you can.

输入参数linemodestoplimit

get_car_park_availability

Live free spaces at Transport Park&Ride car parks (about 40 car parks at stations across Sydney). query: text matched against car park name and suburb (e.g. "Tallawong", "Penrith"). near: a place name, address or 'lat,lng'; only car parks within radius_km are returned, nearest first. With neither, all are listed.

输入参数nearlimitqueryradius_km

get_car_park_history

How full a Park&Ride car park was through one day: hourly occupancy, the peak, and when it first filled up. facility_id: from get_car_park_availability. date: 'YYYY-MM-DD'. Useful for "what time does it usually fill up?".

输入参数date必填facility_id必填

版本历史

1
  1. v0.3.1最新Oct 22, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分