mcporter-railway-query
Query and book Chinese railway tickets via 12306 using mcporter CLI. Use when user wants to search for G/D/C train tickets, check train schedules, query seat availability, or plan rail travel between Chinese cities. Supports filtering by date, time range, train type, and sorting results.
Why use this skill?
Automate your 12306 train ticket queries and schedule management using the mcporter-railway-query skill for OpenClaw. Search, filter, and plan travel easily.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/lancenas/mcporter-railway-query-repoWhat This Skill Does
The mcporter-railway-query skill is a powerful automation tool designed for the OpenClaw AI agent to interface with the 12306 Chinese railway ticketing system. By leveraging the mcporter CLI, this skill enables seamless searching, filtering, and schedule retrieval for high-speed (G), bullet (D), and city-connecting (C) trains. It acts as an abstraction layer between natural language requests and complex terminal commands, allowing users to query availability, plan journeys between cities using station codes, and apply time-based constraints or sorting preferences directly through AI prompts.
Installation
To integrate this skill into your environment, use the OpenClaw CLI command: clawhub install openclaw/skills/skills/lancenas/mcporter-railway-query-repo. After installation, ensure you have the mcporter CLI installed globally via npm install -g mcporter. Finally, create a valid configuration file at ~/.mcporter/mcporter.json to authenticate your connection to the 12306 MCP server. Failure to configure this path will prevent the agent from executing queries successfully.
Use Cases
This skill is ideal for commuters, business travelers, and travel planners. Common scenarios include:
- Checking real-time ticket availability for weekend getaways between major cities like Shanghai and Hangzhou.
- filtering train schedules by specific time windows (e.g., only afternoon trains after 12:00) to match meeting schedules.
- Quickly resolving station name to station code lookups to ensure accurate ticket querying.
- Sorting travel options by departure time or total duration to optimize trip planning.
Example Prompts
- "Check for high-speed train tickets from Shanghai to Hangzhou on February 18th, 2026. Only show me G and D trains departing in the afternoon."
- "What are the station codes for Nanjing and Wuxi? I need to look up tickets for next week."
- "List all trains from Shanghai Hongqiao to Wuxi on 2026-02-18, sorted by arrival time, and limit the results to the first 5 options."
Tips & Limitations
- Station Accuracy: Always verify station codes if a query returns no results; cities often have multiple stations (e.g., Shanghai vs. Shanghai Hongqiao).
- Format Support: You can request raw JSON output if you intend to pipe this data into other scripts or automation workflows.
- Date Constraint: Ensure your input date is always in YYYY-MM-DD format to avoid parsing errors.
- Connectivity: This tool requires an active internet connection to the 12306 API and consistent maintenance of the local configuration file.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-lancenas-mcporter-railway-query-repo": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, file-read, external-api, code-execution