Skip to content

tanweiping1012-source/travel-planner

travel-planner-mvp

Verified

Create evidence-backed, read-only travel plans using Amap, a community 12306 rail MCP, and approved browser research. Use for 行程规划、路线安排、景点取舍、高铁或机票比较、酒店住宿比价、预算分析、旅行可行性检查,以及中国境内多城市旅行规划(境外目的地降级为浏览器辅助规划)。

FileKindSize
SKILL.mdskill md12.5 KB
agents/openai.yamlconfig344 B
examples/final_plan.jsonconfig2.6 KB
examples/itinerary.jsonconfig1020 B
examples/rail_query.jsonconfig2.9 KB
examples/social_research.jsonconfig1.3 KB
examples/trip_request.jsonconfig1.1 KB
references/browser-use.mdmarkdown14.8 KB
references/client-compatibility.mdmarkdown5.4 KB
references/data-contracts.mdmarkdown26.6 KB
references/intake-template.mdmarkdown4.9 KB
references/rail-mcp.mdmarkdown4.3 KB
references/script-tools.mdmarkdown3.5 KB
references/workflow.mdmarkdown13.3 KB
scripts/audit_release.shexecutablescript3.4 KB
scripts/prepare_release.shexecutablescript1.8 KB
scripts/setup_amap_key.shexecutablescript828 B
scripts/setup_rail_mcp.shexecutablescript3.8 KB
scripts/travel_planner.pyexecutablescript11.8 KB
scripts/validate_skill.pyexecutablescript5.5 KB

scripts/setup_rail_mcp.sh

View on GitHub
#!/bin/sh
set -eu

UPSTREAM_URL="https://github.com/drfccv/mcp-server-12306.git"
UPSTREAM_COMMIT="1b6ee94ff801cbfe0c1e8c8bb95195466b08b6dd"
REGISTER_CODEX=0

usage() {
  cat <<'EOF'
Usage: bash scripts/setup_rail_mcp.sh [--register-codex]

Installs the pinned, patched 12306 community MCP outside the Skill directory.
Set TRAVEL_PLANNER_DATA_DIR to override the per-user data location.

Options:
  --register-codex  Register the installed stdio server with Codex.
  -h, --help        Show this help.
EOF
}

while [ "$#" -gt 0 ]; do
  case "$1" in
    --register-codex)
      REGISTER_CODEX=1
      ;;
    -h|--help)
      usage
      exit 0
      ;;
    *)
      echo "Unknown option: $1" >&2
      usage >&2
      exit 2
      ;;
  esac
  shift
done

SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
SKILL_ROOT=$(CDPATH='' cd -- "$SCRIPT_DIR/.." && pwd)
PATCH_FILE="$SKILL_ROOT/patches/mcp-server-12306-security.patch"

if [ -n "${TRAVEL_PLANNER_DATA_DIR:-}" ]; then
  DATA_ROOT=$TRAVEL_PLANNER_DATA_DIR
elif [ "$(uname -s)" = "Darwin" ]; then
  : "${HOME:?HOME is required to resolve the user data directory}"
  DATA_ROOT="$HOME/Library/Application Support/travel-planner-mvp"
else
  : "${HOME:?HOME is required to resolve the user data directory}"
  DATA_HOME=${XDG_DATA_HOME:-"$HOME/.local/share"}
  DATA_ROOT="$DATA_HOME/travel-planner-mvp"
fi

case "$DATA_ROOT" in
  /*) ;;
  *)
    echo "TRAVEL_PLANNER_DATA_DIR must resolve to an absolute path." >&2
    exit 1
    ;;
esac

CHECKOUT_DIR="$DATA_ROOT/mcp-server-12306"

if ! command -v git >/dev/null 2>&1; then
  echo "git is required." >&2
  exit 1
fi

if ! command -v uv >/dev/null 2>&1; then
  echo "uv is required to run the pinned Python 3.10+ MCP environment." >&2
  echo "Install it first, for example: brew install uv" >&2
  exit 1
fi

UV_COMMAND=$(command -v uv)
mkdir -p "$DATA_ROOT"

if [ ! -d "$CHECKOUT_DIR/.git" ]; then
  if [ -e "$CHECKOUT_DIR" ]; then
    echo "Refusing to replace non-git path: $CHECKOUT_DIR" >&2
    exit 1
  fi
  git clone --no-checkout "$UPSTREAM_URL" "$CHECKOUT_DIR"
fi

CURRENT_REMOTE=$(git -C "$CHECKOUT_DIR" remote get-url origin)
if [ "$CURRENT_REMOTE" != "$UPSTREAM_URL" ]; then
  echo "Unexpected upstream remote: $CURRENT_REMOTE" >&2
  exit 1
fi

git -C "$CHECKOUT_DIR" fetch --depth 1 origin "$UPSTREAM_COMMIT"
git -C "$CHECKOUT_DIR" checkout --detach "$UPSTREAM_COMMIT"

if git -C "$CHECKOUT_DIR" apply --reverse --check "$PATCH_FILE" >/dev/null 2>&1; then
  echo "Security patch already applied."
else
  git -C "$CHECKOUT_DIR" apply --check "$PATCH_FILE"
  git -C "$CHECKOUT_DIR" apply "$PATCH_FILE"
fi

"$UV_COMMAND" sync --directory "$CHECKOUT_DIR"
"$UV_COMMAND" --directory "$CHECKOUT_DIR" run mcp-server-12306 --version

printf '\nInstalled runtime: %s\n' "$CHECKOUT_DIR"
printf '\nAdd this MCP configuration using the absolute path shown below:\n\n'
printf '{\n'
printf '  "mcpServers": {\n'
printf '    "12306": {\n'
printf '      "command": "%s",\n' "$UV_COMMAND"
printf '      "args": ["--directory", "%s", "run", "mcp-server-12306"]\n' "$CHECKOUT_DIR"
printf '    }\n'
printf '  }\n'
printf '}\n'

if [ "$REGISTER_CODEX" -eq 1 ]; then
  if ! command -v codex >/dev/null 2>&1; then
    echo "Codex CLI is unavailable; add the stdio server in Codex Settings -> MCP servers." >&2
    exit 1
  fi
  if codex mcp get 12306 >/dev/null 2>&1; then
    echo "Codex already has an MCP server named 12306; leaving it unchanged." >&2
    echo "Remove it first with: codex mcp remove 12306" >&2
    exit 1
  fi
  codex mcp add 12306 -- "$UV_COMMAND" \
    --directory "$CHECKOUT_DIR" run mcp-server-12306
  codex mcp get 12306
  echo "Restart Codex before using the new MCP tools."
else
  printf '\nCodex CLI registration command:\n\n'
  printf 'codex mcp add 12306 -- %s --directory "%s" run mcp-server-12306\n' \
    "$UV_COMMAND" "$CHECKOUT_DIR"
fi
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall