ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified utilities Safety 4/5

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.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/lancenas/mcporter-railway-query-repo
Or

What 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:

  1. Checking real-time ticket availability for weekend getaways between major cities like Shanghai and Hangzhou.
  2. filtering train schedules by specific time windows (e.g., only afternoon trains after 12:00) to match meeting schedules.
  3. Quickly resolving station name to station code lookups to ensure accurate ticket querying.
  4. Sorting travel options by departure time or total duration to optimize trip planning.

Example Prompts

  1. "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."
  2. "What are the station codes for Nanjing and Wuxi? I need to look up tickets for next week."
  3. "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

Author@lancenas
Stars1656
Views1
Updated2026-02-28
View Author Profile
AI Skill Finder

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 skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-lancenas-mcporter-railway-query-repo": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#railway#travel#12306#automation#cli
Safety Score: 4/5

Flags: network-access, file-read, external-api, code-execution