agentCLAWHUBUnverified

Mcporter Railway Query Repo

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. Skill: Mcporter Railway Query Repo Owner: Lancenas Summary: 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. Tags: latest:1.0.2 Version history: v1.0.2 | 2026-02-12T05:48:13.188Z |

OpenClaw

Rank

62

Safety

84

Downloads

689

Updated

Apr 15, 2026

Version

1.0.2

Source

CLAWHUB

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 689 downloads reported by the source. Last updated 4/15/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Public facts

Every fact links back to the source it came from.

Vendor
Clawhubvendor · observed Apr 15, 2026
Protocol compatibility
OpenClawcompatibility · observed Apr 15, 2026
Adoption signal
689 downloadsadoption · observed Apr 15, 2026
Latest release
1.0.2release · observed Feb 12, 2026
Handshake status
UNKNOWNsecurity

Install and run

Setup complexity: low.

clawhub skill install kn7473nwmwpv2j47ck4x8z7ead80zt96:mcporter-railway-query-repo
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-lancenas-mcporter-railway-query-repo/snapshot"

Documentation

CLAWHUB

23,758 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: mcporter-railway-query
description: 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.
---

# mcporter Railway Ticket Query

使用 mcporter 命令行工具查询 12306 中国铁路车票信息。

## Prerequisites

1. 安装 mcporter CLI
2. 配置 12306 MCP 服务器
3. 确认 mcporter.json 配置路径(默认 ~/.mcporter/mcporter.json)

## Quick Start

### 1. 使用快捷脚本查询

```bash
# 查询下午班次 (12:00-18:00)
./scripts/query-afternoon.sh 2026-02-18 SHH KYH

# 查询全天班次
./scripts/query-tickets.sh 2026-02-18 AOH HZH

# 查询车站代码
./scripts/get-station-code.sh "上海虹桥"
```

### 2. 直接 mcporter 命令

```bash
# 基础查询
mcporter call 12306.get-tickets \
  date="2026-02-18" \
  fromStation="AOH" \
  toStation="HZH" \
  trainFilterFlags="GD" \
  --config ~/.mcporter/mcporter.json

# 下午班次
mcporter call 12306.get-tickets \
  date="2026-02-18" \
  fromStation="AOH" \
  toStation="HZH" \
  trainFilterFlags="GD" \
  earliestStartTime=12 \
  latestStartTime=18 \
  sortFlag="startTime" \
  --config ~/.mcporter/mcporter.json
```

## Workflow

### Step 1: 获取车站代码

不知道车站代码时:

```bash
mcporter call 12306.get-station-code-of-citys \
  citys="上海|杭州" \
  --config ~/.mcporter/mcporter.json
```

或查看参考表 [station-codes.md](references/station-codes.md)

### Step 2: 查询车票

```bash
mcporter call 12306.get-tickets \
  date="YYYY-MM-DD" \
  fromStation="出发站代码" \
  toStation="到达站代码" \
  [可选过滤参数] \
  --config ~/.mcporter/mcporter.json
```

### Step 3: 解析结果

- 有票: "**有票**" 或显示剩余票数 "剩余X张票"
- 无票: "无票"
- *票: 特殊标记票

## Parameters Reference

| 参数 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
| date | string | 必填 | 日期格式 YYYY-MM-DD |
| fromStation | string | 必填 | 出发站代码 (如 SHH) |
| toStation | string | 必填 | 到达站代码 (如 KYH) |
| trainFilterFlags | string | "" | G=高铁, D=动车, GD=高铁+动车 |
| earliestStartTime | number | 0 | 最早出发时间 (0-24) |
| latestStartTime | number | 24 | 最晚出发时间 (0-24) |
| sortFlag | string | "" | startTime/arriveTime/duration |
| sortReverse | boolean | false | 是否倒序 |
| limitedNum | number | 0 | 限制结果数量 |
| format | string | text | text/json/csv |

## Common Station Codes

| 城市 | 代码 | 城市 | 代码 |
|------|------|------|------|
| 上海 | SHH | 上海虹桥 | AOH |
| 杭州东 | HZH | 无锡 | WXH |
| 江阴 | KYH | 南京南 | NKH |

完整列表见 [station-codes.md](references/station-codes.md)

## Troubleshooting

### mcporter not found
```bash
npm install -g mcporter
```

### 12306 MCP 未配置
创建 ~/.mcporter/mcporter.json 配置文件。

### 查询无结果
- 确认车站代码正确
- 确认日期格式为 YYYY-MM-DD
- 检查 mcporter.json 路径

## Examples

更多查询示例见 [query-examples.md](references/query-examples.md)

README.md

# mcporter-railway-query

An OpenClaw skill for querying Chinese railway tickets via 12306 using mcporter CLI.

## Overview

This skill provides tools to search for G/D/C train tickets, check train schedules, query seat availability, and plan rail travel between Chinese cities. It supports filtering by date, time range, train type, and sorting results.

## Project Structure

mcporter-railway-query/
├── scripts/              # Shell helper scripts
├── references/           # Station code reference
├── README.md
├── README_zh.md
└── LICENSE

## Prerequisites

1. Install mcporter CLI: `npm install -g mcporter`
2. Configure 12306 MCP server in `~/.mcporter/mcporter.json`
    ```
      {
        "mcpServers": {
           "12306": {
              "type": "sse",
               "url": "http://127.0.0.1:8080/sse",
              "name": "12306 高铁动车查询",
              "description": "查询高铁(G开头)和动车(D开头)余票,支持出发站、到达站、日期、时间段过滤。只返回G/D车次。",
              "enabled": true
            }
        }
     }
    ```
3. Ensure MCP server is running

## Installation

This is an OpenClaw skill. Install using:

```bash
openclaw skills install mcporter-railway-query.skill
```

## Usage

The skill provides several helper scripts:

### Query afternoon trains (12:00-18:00)
```bash
./scripts/query-afternoon.sh 2026-02-18 SHH KYH
```

### Query all-day trains
```bash
./scripts/query-tickets.sh 2026-02-18 AOH HZH
```

### Get station codes
```bash
./scripts/get-station-code.sh "上海虹桥"
```

### Direct mcporter commands
```bash
mcporter call 12306.get-tickets \
  date="2026-02-18" \
  fromStation="AOH" \
  toStation="HZH" \
  trainFilterFlags="GD" \
  earliestStartTime=12 \
  latestStartTime=18 \
  sortFlag="startTime" \
  --config ~/.mcporter/mcporter.json
```

## Features

- Query train tickets with departure time filtering
- Support for G (high-speed), D (bullet train), and C (city train) trains
- Seat availability checking (商务座, 一等座, 二等座, etc.)
- Station code lookup
- Comprehensive station code reference table

## Common Station Codes

| Station | Code | Notes |
|---------|------|-------|
| 上海 | SHH | Shanghai Station |
| 上海虹桥 | AOH | Shanghai Hongqiao Station |
| 杭州东 | HZH | Hangzhou East Station |
| 江阴 | KYH | Jiangyin Station |

See `references/station-codes.md` for the complete list.

## License

MIT

## Security & Compliance

This project is a read-only OpenClaw skill that:

- Does NOT collect user data
- Does NOT store credentials
- Does NOT perform ticket booking
- Does NOT bypass 12306 authentication
- Does NOT execute arbitrary system commands
- Does NOT write to local file system
- Does NOT open network listeners
- Does NOT include obfuscated or encrypted code

All queries are executed through official 12306 MCP interfaces configured by the user.

This repository contains only helper scripts and configuration examples.

_meta.json

{
  "ownerId": "kn7473nwmwpv2j47ck4x8z7ead80zt96",
  "slug": "mcporter-railway-query-repo",
  "version": "1.0.2",
  "publishedAt": 1770875293188
}

references/query-examples.md

# mcporter 火车票查询示例

## 基础查询命令

### 1. 查询车票
```bash
mcporter call 12306.get-tickets \
  date="2026-02-14" \
  fromStation="SHH" \
  toStation="KYH" \
  trainFilterFlags="GD" \
  sortFlag="startTime" \
  format="text" \
  --config ~/.mcporter/mcporter.json
```

### 2. 查询下午班次(12:00-18:00)
```bash
mcporter call 12306.get-tickets \
  date="2026-02-14" \
  fromStation="SHH" \
  toStation="KYH" \
  trainFilterFlags="GD" \
  earliestStartTime=12 \
  latestStartTime=18 \
  sortFlag="startTime" \
  --config ~/.mcporter/mcporter.json
```

### 3. 查询指定车次详情
```bash
mcporter call 12306.get-train-route-stations \
  trainCode="G7134" \
  departDate="2026-02-14" \
  format="text" \
  --config ~/.mcporter/mcporter.json
```

## 查询参数说明

| 参数 | 说明 | 示例 |
|------|------|------|
| date | 日期 (YYYY-MM-DD) | "2026-02-14" |
| fromStation | 出发站代码 | "SHH" |
| toStation | 到达站代码 | "KYH" |
| trainFilterFlags | 车次类型过滤 | "G"=高铁, "D"=动车, "GD"=高铁+动车 |
| earliestStartTime | 最早出发时间 (0-24) | 12 |
| latestStartTime | 最晚出发时间 (0-24) | 18 |
| sortFlag | 排序方式 | "startTime" / "arriveTime" / "duration" |
| sortReverse | 是否倒序 | true / false |
| limitedNum | 限制返回数量 | 10 |
| format | 输出格式 | "text" / "json" / "csv" |

## 常用查询场景

### 场景1: 上海虹桥到杭州东 下午高铁
```bash
./scripts/query-afternoon.sh 2026-02-18 AOH HZH
```

### 场景2: 上海到江阴 全天班次
```bash
./scripts/query-tickets.sh 2026-02-14 SHH KYH
```

### 场景3: 获取车站代码
```bash
./scripts/get-station-code.sh "上海虹桥"
```

## 配置说明

mcporter 配置文件 `~/.mcporter/mcporter.json`:

```json
{
  "mcpServers": {
    "12306": {
      "type": "sse",
      "url": "http://127.0.0.1:8080/sse",
      "name": "12306 高铁动车查询",
      "description": "查询高铁(G开头)和动车(D开头)余票",
      "enabled": true
    }
  }
}
```

references/station-codes.md

# 12306 常用车站代码表

## 上海地区
| 车站 | 代码 | 备注 |
|------|------|------|
| 上海 | SHH | 上海站 |
| 上海虹桥 | AOH | 虹桥火车站 |
| 上海南 | SNH | 南站 |
| 上海西 | SXH | 西站 |
| 上海松江 | IMH | 松江南站/松江站 |
| 金山北 | EGH | 金山北站 |

## 江苏地区
| 车站 | 代码 | 备注 |
|------|------|------|
| 江阴 | KYH | 江阴站 |
| 无锡 | WXH | 无锡站 |
| 无锡东 | WGH | 无锡东站 |
| 无锡新区 | IFH | 无锡新区站 |
| 惠山 | VCH | 惠山站 |
| 常州 | CZH | 常州站 |
| 南京 | NJH | 南京站 |
| 南京南 | NKH | 南京南站 |
| 苏州 | SZH | 苏州站 |
| 苏州北 | OHH | 苏州北站 |
| 昆山 | KSH | 昆山站 |
| 昆山南 | KNH | 昆山南站 |
| 徐州 | XCH | 徐州站 |

## 浙江地区
| 车站 | 代码 | 备注 |
|------|------|------|
| 杭州 | HZH | 杭州站 |
| 杭州东 | HZH | 杭州东站 |
| 杭州西 | IAH | 杭州西站 |
| 杭州南 | XHH | 杭州南站/萧山站 |
| 宁波 | NGH | 宁波站 |
| 温州 | RZH | 温州站 |

## 安徽地区
| 车站 | 代码 | 备注 |
|------|------|------|
| 合肥 | HFH | 合肥站 |
| 合肥南 | ENH | 合肥南站 |
| 黄山 | HSH | 黄山站 |

## 其他地区
| 车站 | 代码 | 备注 |
|------|------|------|
| 北京 | BJP | 北京站 |
| 北京南 | VNP | 北京南站 |
| 北京西 | BXP | 北京西站 |
| 北京朝阳 | IFP | 朝阳站 |
| 广州 | GZQ | 广州站 |
| 广州南 | IZQ | 广州南站 |
| 深圳 | SZQ | 深圳站 |
| 深圳北 | IOQ | 深圳北站 |
| 成都 | CDW | 成都站 |
| 成都东 | ICW | 成都东站 |
| 重庆 | CQW | 重庆站 |
| 重庆北 | CUW | 重庆北站 |
| 武汉 | WHN | 武汉站 |
| 长沙 | CSQ | 长沙站 |
| 长沙南 | CWQ | 长沙南站 |
| 西安 | XAY | 西安站 |
| 西安北 | EAY | 西安北站 |

## 查询方法

未知车站代码时,使用 mcporter 查询:

```bash
# 按城市查询
mcporter call 12306.get-station-code-of-citys citys="城市名"

# 按车站名查询
mcporter call 12306.get-station-code-by-names stationNames="车站名1|车站名2"
```
Github ReposUpdated 8h agoRank 70

AionUi

Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!

MCPOPENCLAW
Github ReposUpdated 6mo agoRank 70

activepieces

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

OPENCLAW
Github ReposUpdated 6mo agoRank 70

cherry-studio

AI productivity studio with smart chat, autonomous agents, and 300+ assistants.

MCPOPENCLAW
Github ReposUpdated 7mo agoRank 70

CopilotKit

The Frontend for Agents & Generative UI. React + Angular

OPENCLAW

Machine-readable data

The same record, as JSON, for agents and crawlers.

{
  "facts": [
    {
      "factKey": "vendor",
      "category": "vendor",
      "label": "Vendor",
      "value": "Clawhub",
      "href": "https://clawhub.ai/Lancenas/mcporter-railway-query-repo",
      "sourceUrl": "https://clawhub.ai/Lancenas/mcporter-railway-query-repo",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-04-15T00:45:39.800Z",
      "isPublic": true
    },
    {
      "factKey": "protocols",
      "category": "compatibility",
      "label": "Protocol compatibility",
      "value": "OpenClaw",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-lancenas-mcporter-railway-query-repo/contract",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-lancenas-mcporter-railway-query-repo/contract",
      "sourceType": "contract",
      "confidence": "medium",
      "observedAt": "2026-04-15T00:45:39.800Z",
      "isPublic": true
    },
    {
      "factKey": "traction",
      "category": "adoption",
      "label": "Adoption signal",
      "value": "689 downloads",
      "href": "https://clawhub.ai/Lancenas/mcporter-railway-query-repo",
      "sourceUrl": "https://clawhub.ai/Lancenas/mcporter-railway-query-repo",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-04-15T00:45:39.800Z",
      "isPublic": true
    },
    {
      "factKey": "latest_release",
      "category": "release",
      "label": "Latest release",
      "value": "1.0.2",
      "href": "https://clawhub.ai/Lancenas/mcporter-railway-query-repo",
      "sourceUrl": "https://clawhub.ai/Lancenas/mcporter-railway-query-repo",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-02-12T05:48:13.188Z",
      "isPublic": true
    },
    {
      "factKey": "handshake_status",
      "category": "security",
      "label": "Handshake status",
      "value": "UNKNOWN",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-lancenas-mcporter-railway-query-repo/trust",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-lancenas-mcporter-railway-query-repo/trust",
      "sourceType": "trust",
      "confidence": "medium",
      "observedAt": null,
      "isPublic": true
    }
  ],
  "events": [
    {
      "eventType": "release",
      "title": "Release 1.0.2",
      "description": "- Updated documentation in README.md and README_zh.md. - No changes to functionality or code; documentation only.",
      "href": "https://clawhub.ai/Lancenas/mcporter-railway-query-repo",
      "sourceUrl": "https://clawhub.ai/Lancenas/mcporter-railway-query-repo",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-02-12T05:48:13.188Z",
      "isPublic": true
    }
  ]
}

Record generated Oct 10, 2026.

Sponsored

Ads related to Mcporter Railway Query Repo and adjacent AI workflows.