Transport NSW API Client MCP
Transport NSW API クライアント (MCP 実装)
直接 HTTP リクエストを使用して Transport NSW API と対話するための Claude MCP。
について
このプロジェクトは、Transport NSW の API 用のモデル コンテキスト プロトコル (MCP) サービスを実装します。
Related MCP server: openbusdata
設定
このリポジトリをクローンする
uv (高速 Python パッケージ マネージャー) を使用して依存関係をインストールします。
uv venv uv syncAPI キーを使用して
.envファイルを作成します。OPEN_TRANSPORT_API_KEY=your_api_key_here(オプション) MCP インスペクターを実行します。
uv run mcp dev api.pyそして、 http://localhost:5173でサーバーにアクセスします (ポートは異なる場合があります)。
特徴
Stop Finder API : 名前または座標で交通機関の停留所を検索します
Alerts API : 交通警報や交通混乱に関する情報を取得します
出発モニターAPI :交通機関の停留所の出発情報をリアルタイムで取得します
MCP実装:モデルコンテキストプロトコルサービスとして構造化
使用例
MCPの例は近日公開予定です。以下は標準的なPythonの例です。
交通機関の停留所を探す
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)交通アラートを受け取る
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)リアルタイムの出発状況を監視
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 = Trainデモスクリプト
このプロジェクトには、すべての API 機能を紹介する包括的なデモ スクリプトが含まれています。
# 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 demoテスト
ローカルテスト
pytest を使用して完全なテスト スイートを実行します。
uv run pytestカバレッジレポートを使用して実行:
uv run pytest --cov=api継続的インテグレーション
メインブランチへのプッシュリクエストとプルリクエストごとに、GitHub Actionsでテストが自動的に実行されます。ワークフローは以下のとおりです。
Python 3.10をセットアップする
UVとプロジェクトの依存関係をインストールします
カバレッジレポート付きのテストを実行する
この機能を使用するには:
OPEN_TRANSPORT_API_KEYをGitHubリポジトリシークレットとして追加しますコードをGitHubにプッシュする
MCP統合
このプロジェクトはモデルコンテキストプロトコル仕様に準拠しており、AI モデルが標準化されたインターフェースを通じて Transport NSW データにアクセスできるようになります。
パッケージ管理
このプロジェクトでは、Rustで書かれた最新のPythonパッケージマネージャーであるuvを使用しています。依存関係は以下を通じて管理されます。
pyproject.toml: プロジェクトの依存関係を定義するuv.lock: 再現可能な環境の依存関係のバージョンをロックします
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