- Home
- MCP servers
- THSRC
THSRC
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"physictim-thsrc_mcp": {
"command": "npx",
"args": [
"-y",
"@physictim/mcp-server-thsrc"
],
"env": {
"TDX_CLIENT_ID": "YOUR_CLIENT_ID",
"TDX_CLIENT_SECRET": "YOUR_CLIENT_SECRET"
}
}
}
}You run an MCP server that exposes Taiwan High Speed Rail data, including timetables, live schedules, station details, and seat availability. It lets any MCP-enabled client query real-time information in a standardized way, so you can build apps or assistants that help travelers plan trips with up-to-date THSRC data.
How to use
You connect with the THSRC MCP server from an MCP client. Use the provided functions to access station lists, timetables, live schedule data, specific train details, and remaining seats for a route.
Available MCP endpoints include: get_thsr_stations(), get_thsr_timetable(origin, destination, travel_date), get_thsr_live_schedule(station), get_thsr_train_info(train_no, travel_date), and get_thsr_available_seats(origin, destination, travel_date). These let you retrieve data in your client language of choice, with support for Chinese station names, English station names, or station IDs.
Examples of user intents you can support: finding all THSRC stations, listing tomorrow’s departures from Taipei to Zuoying, checking live departures from Taipei, viewing a specific train’s details, and checking seat availability for a given date.
How to install
Prerequisites you need installed on your system before running the THSRC MCP server: Python 3.x, and a runtime tool for your preferred installation method (see below). You also need a TSX (TDX) API key consisting of a Client ID and Client Secret.
Choose one of the installation methods below. Each method runs the MCP server locally and exposes it to MCP clients.
Note: you will run the server via a standard runtime command once installed, and you will provide your TDX credentials to enable API access.
Additional sections
Configuration and credentials: You must obtain a TDX API key (Client ID and Client Secret) from the Transport Data Exchange platform and set them in your environment when starting the MCP server. These credentials are required for all data requests to the TDX API.
Server startup and environment: The recommended runtime for the MCP server is to use a standard runtime command that launches the server process. The exact command you run will depend on how you installed the server. If you installed via npx, you start the MCP server by invoking the npx command with the appropriate package. If you installed via pipx, you start the server using the installed package executable. If you built and started manually, you run the Python script that launches the MCP server.
Security and credentials handling: Keep your TDX Client ID and Client Secret secure. Do not commit them to version control or share them publicly. Use environment variable configuration to pass these credentials to the running MCP server.
Usage notes and data updates: Real-time data comes from the THSRC data feed via the TDX API. Update schedules are defined to refresh data daily at multiple times and for the current day every 10 minutes to ensure you receive the latest information.
Usage examples for clarity: you can query the THSRC stations list, fetch a timetable from Taipei to Zuoying on a given date, check live departures from a station, retrieve details for a specific train, and verify seat availability on a chosen date.
Available tools
get_thsr_stations
Retrieve all THSRC station information.
get_thsr_timetable
Query timetable for a route on a specific date with origin, destination, and travel date.
get_thsr_live_schedule
Fetch real-time departures for a given station.
get_thsr_train_info
Get detailed information for a specific train number on a given date.
get_thsr_available_seats
Check remaining seats for a route on a given date.