Taiwan TDX transport

Registre officiel Cartes, voyage et météo

Taiwan transport via TDX: YouBike, buses, rail, flights, ferries, road traffic, parking, EV

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

NPM package tdx-taiwan-mcp
Claude Code
claude mcp add taiwan-tdx-transport -e 'TDX_CLIENT_ID=<TDX_CLIENT_ID>' -e 'TDX_CLIENT_SECRET=<your tdx_client_secret>' -e 'TDX_REQUESTS_PER_SECOND=5' -e 'TDX_MAX_ITEMS=200' -- npx -y tdx-taiwan-mcp@0.3.0
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "taiwan-tdx-transport": {
            "command": "npx",
            "args": [
                "-y",
                "tdx-taiwan-mcp@0.3.0"
            ],
            "env": {
                "TDX_CLIENT_ID": "<TDX_CLIENT_ID>",
                "TDX_CLIENT_SECRET": "<your tdx_client_secret>",
                "TDX_REQUESTS_PER_SECOND": "5",
                "TDX_MAX_ITEMS": "200"
            }
        }
    }
}

Variables d'environnement

  • TDX_CLIENT_ID obligatoire TDX API key Client Id (tdx.transportdata.tw → 會員中心 → 資料服務 → API金鑰).
  • TDX_CLIENT_SECRET obligatoire secret TDX API key Client Secret.
  • TDX_REQUESTS_PER_SECOND Client-side rate limit; match it to your TDX plan (0 turns it off).
  • TDX_MAX_ITEMS Most items any tool returns.

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. tdx-taiwan-mcp
  2. Get TDX keys
  3. Set up
  4. Tools
  5. MCP registry
  6. Use as a library
  7. Rate limits and billing
  8. Data source
  9. License

tdx-taiwan-mcp

An unofficial MCP server for Taiwan's TDX (Transport Data eXchange) API, built on the tdx-taiwan SDK. It lets Claude and other MCP clients answer questions such as "where is the nearest YouBike with bikes?", "when does the 307 reach Ximen?", "which high speed trains to Zuoying still have seats tonight?", "is CI100 delayed?" or "where can I charge a CCS2 car near Taipei Main Station?".

  • Task-shaped tools: search by name (Chinese or English, 台/臺 folded) or by location, with readable output ("4 min", "last bus has passed") instead of raw status codes
  • City names as TDX codes or in Chinese (Taipei, 臺北市, 台北)
  • Results capped in size; static lists cached, live data cached for 15 s
  • tdx_get for any TDX endpoint the tools do not cover yet
  • Runs over stdio; Node.js 20+

Get TDX keys

Register at tdx.transportdata.tw, then copy the Client Id and Client Secret from 會員中心 → 資料服務 → API金鑰.

Set up

Claude Code
claude mcp add tdx \
  -e TDX_CLIENT_ID=your-client-id -e TDX_CLIENT_SECRET=your-client-secret \
  -- npx -y tdx-taiwan-mcp
Claude Desktop and other clients

Add the server to the client's MCP configuration (for Claude Desktop, claude_desktop_config.json):

{
  "mcpServers": {
    "tdx": {
      "command": "npx",
      "args": ["-y", "tdx-taiwan-mcp"],
      "env": {
        "TDX_CLIENT_ID": "your-client-id",
        "TDX_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}
Environment
VariableDefaultMeaning
TDX_CLIENT_IDrequiredTDX API key Client Id
TDX_CLIENT_SECRETrequiredTDX API key Client Secret
TDX_REQUESTS_PER_SECOND5Client-side rate limit; match it to your TDX plan (0 turns it off)
TDX_MAX_ITEMS200Most items any tool returns

A .env file in the working directory is read too; variables already set take precedence.

Tools

YouBike and buses
ToolWhat it answers
youbike_nearbyNearest YouBike / Moovo stations to a coordinate with bikes (or empty docks) right now
youbike_stationYouBike stations by name or address, with live bikes, e-bikes and empty docks
bus_stops_nearbyBus stops near a coordinate, with their heading and the city and coach routes there
bus_stop_arrivalsEvery bus due at one stop, all routes at once, soonest first
bus_route_searchBus routes by name or terminal stop, with endpoints, operators and fare
bus_route_stopsThe stops of a route in order, per direction and sub-route
bus_etaLive arrival estimates at the stops of a route, optionally at one stop
bus_timetableScheduled departures of a route on a day, or how often it runs
bus_alertsCurrent and upcoming detours, suspensions and moved stops, with the latest news
bus_positionsWhere the buses on a route are now, with speed and status

Bus tools take a city (Taipei, NewTaipei, ...) or InterCity for 公路客運 / 國道客運 coaches.

Rail
ToolWhat it answers
thsr_timetableHigh speed rail (高鐵) trains between two stations on a day
thsr_seatsStandard and business seat availability for those trains
thsr_fareTHSR fares per car and passenger type
thsr_trainEvery stop of one THSR train
tra_timetableTaiwan Railway (臺鐵) trains between two stations, with train type
tra_live_boardTrains about to arrive at or leave a TRA station, with delays
tra_trainOne TRA train today: stops, current position and delay
tra_fareTRA fares per train type and passenger type
metro_live_boardMinutes to the next metro trains (Kaohsiung, Taoyuan; Taipei arrivals only)
metro_fareMetro fares between two stations
metro_first_last_trainFirst and last trains at a metro station
afr_timetableAlishan Forest Railway (阿里山林業鐵路) regular timetable
rail_station_searchStations of any rail system by name, or nearest to a coordinate
rail_alertsService status and disruptions of THSR, TRA or a metro

Rail tools take station names in Chinese or English (台北, Taipei, 台北車站) or station IDs. For today, timetables start from the current time in Taiwan.

Flights
ToolWhat it answers
flight_statusTimes, delay, gate and status of a flight (CI100)
flight_boardA Taiwan airport's departure or arrival board, with the current weather
flight_scheduleDomestic flights between two Taiwan airports on a day (華信, 立榮, 德安), with fares

Airports are IATA codes or names (TSA, 松山, Kinmen).

Ferries
ToolWhat it answers
ferry_timetableSailings between two ports on a day, with live status and alerts (typhoons) today
ferry_live_boardA port's departures and arrivals today, with delays and cancellations
ferry_fareFares between two ports per ticket, cabin and passenger type
ferry_alertsCurrent suspensions and changes to ferry service

Ports are names (富岡, 綠島, 小琉球) or port IDs. Lines run by a county (Penghu inter-island boats, 旗津, 淡水) need city, e.g. PenghuCounty.

Roads
ToolWhat it answers
traffic_liveLive speed and congestion per road section, worst first, with a count per level
traffic_travel_timeCar travel time between two freeway interchanges now, from live eTag data, per segment
traffic_eventsAccidents, roadworks, closures and announced events (parades) with where they are

Road tools take a network: freeway (國道), highway (省道) or a city; traffic_travel_time takes freeway interchange names in Chinese (林口, 新竹). Freeway sections are named after interchanges, so search them by keyword (林口).

Parking and EV charging
ToolWhat it answers
parking_nearbyNearest car parks and on-street parking with free car or scooter spaces now
parking_searchCar parks and on-street parking by name, address or road, with free spaces
ev_charger_nearbyNearest EV chargers with a free connector (CCS2, Tesla, ...), AC or DC, prices

Coverage differs per city: NewTaipei has on-street parking only, and not every car park publishes live spaces (those show "no live data"). ev_charger_nearby takes freeway for the freeway service areas.

Other
ToolWhat it answers
tdx_getAny TDX API path with OData filter, select, orderBy, top, skip

MCP registry

The server is listed in the MCP registry as io.github.amangeldievkuu/tdx-taiwan-mcp, so clients that browse the registry can install it with the two TDX variables above.

Use as a library

import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { TdxClient } from 'tdx-taiwan';
import { createServer } from 'tdx-taiwan-mcp';

const tdx = new TdxClient({ clientId: '…', clientSecret: '…', cache: true });
await createServer({ tdx }).connect(new StdioServerTransport());

Rate limits and billing

TDX limits requests per second by plan and bills by call count and response size. The server caches static lists (stations, routes) for an hour and live data for 15 seconds, and spaces requests at TDX_REQUESTS_PER_SECOND. When TDX still answers 429 (the basic plan also limits calls per minute), the server waits as TDX asks and retries, so a tool call can take up to a minute during a burst of questions.

Data source

資料來源:交通部 TDX 運輸資料流通服務平臺 (MOTC Transport Data eXchange). TDX data is subject to the TDX 資料授權利用條款. This project is not affiliated with MOTC or TDX.

License

MIT

Questions fréquentes

Qu'est-ce que Taiwan TDX transport ?

Taiwan transport via TDX: YouBike, buses, rail, flights, ferries, road traffic, parking, EV

Comment installer Taiwan TDX transport ?

Il s'exécute sur votre machine. Dans Claude Code : claude mcp add taiwan-tdx-transport -e 'TDX_CLIENT_ID=<TDX_CLIENT_ID>' -e 'TDX_CLIENT_SECRET=<your tdx_client_secret>' -e 'TDX_REQUESTS_PER_SECOND=5' -e 'TDX_MAX_ITEMS=200' -- npx -y tdx-taiwan-mcp@0.3.0. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour Taiwan TDX transport ?

Oui. Il attend TDX_CLIENT_ID, TDX_CLIENT_SECRET, à renseigner dans sa configuration.

Taiwan TDX transport est-il open source ?

Oui. Son code est sur GitHub sous licence MIT.

Qui maintient Taiwan TDX transport ?

Il est publié par amangeldievkuu. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.