vac-product-recommend-mcp
vac-product-recommend-mcp
ローカル stdio 形式の MCP Server:ニーズに応じて携程のパッケージツアー「厳選/総合」リストで商品を検索し、レビュー評価・販売数・価格などの観点で TopN を推薦し、統一形式の Markdown テーブル(Web版 / モバイル版リンク含む)を返します。
純 Python 標準ライブラリ実装、サードパーティ依存不要、Python 3.10+ で動作します。
提供ツール
ツール | 説明 |
| キーワード + 複数条件で絞り込み、販売数とレビュー評価の高い TopN 商品を返す |
| 総合リストを検索し、Markdown テーブルを返す |
| 現在利用可能なフィルターと選択肢を照会し、列挙マッピングに使用 |
| 都市名/ピンインで携程の出発都市 ID を照会(必要な場合のみ) |
Related MCP server: 12306 Train Ticket Search MCP Server
フィルター列挙の照会
ユーザーのニーズを具体的なフィルター値にマッピングする必要がある場合は、最初に get_filter_options を呼び出します:
{ "keyword": "川西" }fastFilters 内のすべての選択可能なフィルタグループと列挙値を返します。Agent はこれに基づいて選択し、search_tours / recommend_tours に渡します。
get_departure_cities は、ユーザーが出発都市に言及し、かつ ID が必要な場合にのみ使用します。それ以外はデフォルトの depart_city_id を使用します。
インストール(uv 推奨、Python の手動インストール不要)
まず uv をインストールするだけです:
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows PowerShell
irm https://astral.sh/uv/install.ps1 | iex次に git リンクからインストールします:
uv tool install git+https://github.com/KatouMegumii/vac-product-recommend-mcpまたは、リポジトリ内のインストールスクリプトを直接実行することもできます:
./scripts/install.sh
# Windows: powershell -File scripts/install.ps1uv は初回実行時に Python と依存関係を自動的にダウンロードするため、対象マシンに Python を事前インストールする必要はありません。
更新
インストール済みのユーザーは、インストール方法に応じて更新します:
# 用 uv tool 安装的
uv tool upgrade vac-product-recommend-mcp
# 如果上面没拉到最新,强制重装:
uv tool install --force git+https://github.com/KatouMegumii/vac-product-recommend-mcp
# 克隆仓库 + pip install -e . 安装的
cd vac-product-recommend-mcp && git pullクライアント設定で uvx --from git+... を使用している場合は、キャッシュをクリアしてから MCP クライアントを再起動します:
uv cache clean更新後はMCP の再起動 / 再接続が必要です。新しいツールと instructions が有効になります。
インストール / 更新時に Agent が操作する場合は、以下が必須です:
この README の「重要:Agent に出力形式を厳密に保たせる」および「毎回の相談は完全に独立」などの制限に変更がないか厳密に確認する;
最新の制限を Agent のパーソナライズ / メモリ / Rules / システムプロンプトに同期する;
MCP を再起動 / 再接続してから、ツールリストが更新されていることを確認する。
クライアント設定
Claude Desktop を例に、claude_desktop_config.json を編集します:
{
"mcpServers": {
"vac-product-recommend": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/KatouMegumii/vac-product-recommend-mcp",
"vac-product-recommend-mcp"
],
"env": {
"CTRIP_COOKIE": "",
"CTRIP_GUID": ""
}
}
}
}config_examples/ ディレクトリには、Claude Desktop / Cursor / Cline のサンプル設定が用意されています。
環境変数:
変数 | 必須 | 説明 |
| いいえ | ブラウザからコピーした完全な cookie 文字列。未入力でも動作します(リスク管理をトリガーする可能性あり) |
| いいえ | 空でも可。空の場合は内蔵デフォルト値を使用 |
| いいえ | リスク管理署名。現在の API では必須ではありません |
| いいえ | ローテーショントークン。現在の API では必須ではありません |
主要パラメータ
recommend_tours / search_tours
パラメータ | 説明 |
| 目的地/テーマ、例:「トルコ」「広西」 |
| 出発都市 ID。ユーザーが出発都市に言及した場合のみ |
| 旅行タイプ、複数選択配列: |
| ブランド、例: |
| ダイヤモンド等級、例: |
| チーム規模: |
| 交通手段: |
| サービス保証、複数選択 AND(カンマ区切りまたは配列): |
| 対象者、複数選択 OR(カンマ区切りまたは配列): |
| 割引キャンペーン、例: |
| 日数、 |
| 出発日(出発日のみ)、形式 |
| サプライヤー名または ID、複数選択、名前のあいまい一致 |
| ユーザーが「往復交通含む」を希望する場合のみ |
| 最低レビュー評価、デフォルト 0 でフィルタリングなし。人数とは無関係 |
| 予算上限 |
| 推薦数 |
| 候補プール上限、自動ページ送りで一致数を満たす |
Cookie の取得方法
ブラウザで携程 H5 パッケージツアーリストを開きます(または DevTools でモバイルエミュレーションに切り替えます)。
F12 → Network →
graphql?queryName=productSearchInfoを探します。右クリック → Copy → Copy as cURL。
-b '...'の後の文字列全体をCTRIP_COOKIEにコピーします(そのまま、URL エンコードしない)。
例
広西 3〜5 日の自社運営の少人数グループまたはパッケージツアーを探して、親子向けで、3 つおすすめして。
Agent はまず出発都市 ID を照会し(必要な場合)、次に推薦ツールを呼び出し、最後に Markdown テーブルをそのまま返します。
重要:Agent に出力形式を厳密に保たせる
Agent の パーソナライズ / メモリ / システムプロンプト / Rules に以下の制限を追加してください(これが最も確実な層です。Agent 自身が実行する場合は、要件に従って自己制約を行ってください):
当调用 vac-product-recommend 的 recommend_tours(又称mcp__recommend_tours) / 或 search_tours(又称mcp__search_tours) 后,
必须把工具返回的 Markdown(包含筛选项和表格) 原样作为最终回复输出。
禁止改写、禁止总结、禁止转成列表、禁止删除或合并列。同時に、「毎回の相談は完全に独立」という制限も追加してください:
每次调用 recommend_tours / search_tours 时,只根据当前这一轮用户的原话设置参数。
不要复用上一轮对话中的 keyword、travel_way、departure_date、days、team_size、budget 等参数。
如果用户新一轮没有提到某个筛选条件,就不要传该参数(使用默认值或留空)。また、人数と商品タイプを混同しないでください:
用户提到人数(如 4人、6人、8人)时,必须设置 team_size(4人→最多9人)。
用户只说人数,不要推断为私家团;用户只说私家团,才设置 travel_way=私家团。ディレクトリ構成
vac-product-recommend-mcp/
├── vac_product_recommend_mcp/
│ ├── __init__.py
│ ├── __main__.py
│ ├── server.py # stdio MCP 协议 + 工具注册 + Markdown 渲染
│ ├── ctrip_api.py # 携程接口客户端 + 字段归一化 + 筛选
│ └── recommender.py # 评分、过滤、TopN
├── config_examples/
├── pyproject.toml
└── README.mdAvailable Tools
4 toolsget_departure_citiesA
查询携程出发城市ID。当用户提到某出发城市(如上海、北京、合肥)时,先调用本工具按中文名/拼音模糊查询城市ID,再把ID传给 search_tours 或 recommend_tours 的 depart_city_id。
Inputs: keyword (required), limit.
get_filter_optionsA
查询携程综合列表当前可用的筛选器及可选值(fastFilters)。当需要把用户需求映射成具体筛选参数/枚举时,先调用本工具获取可选值,再调用 search_tours 或 recommend_tours。
Inputs: keyword (required).
recommend_toursA
在携程跟团游「精选/综合」列表里搜索并按需求推荐产品。当用户要『找/推荐/搜索/比较』携程的跟团游、拼小团、私家团、邮轮、自由行、定制游等旅游产品时,直接调用本工具(无需用户指定工具名)。根据点评分、销量、点评量、供应商等维度排序,返回 TopN 产品信息、链接和推荐理由。返回的是 Markdown 表格;最终回复用户时请直接使用该表格,不要改写格式。
Inputs: keyword (required), days, brand, level, +20 more.
search_toursA
在携程跟团游「精选/综合」列表里搜索并返回结构化产品列表。当用户要『列出/搜索/看看』携程的跟团游、拼小团、私家团、邮轮等产品,或需要按销量/好评/价格/产品类型自定义筛选时,直接调用本工具(无需用户指定工具名)。支持 travel_way 产品类型筛选、sort 排序、limit 自动分页。返回的是 Markdown 表格;最终回复用户时请直接使用该表格,不要改写格式。
Inputs: keyword (required), tab, days, page, +15 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
recommend_tours and search_tours overlap heavily: both search the same Ctrip tour list and both are meant for searching/recommending, with only a subtle difference in intent. The two get_* helpers are clearly distinct, so the ambiguity is contained.
All tool names follow a consistent verb_noun pattern: recommend_tours, search_tours, get_filter_options, get_departure_cities. The naming is predictable and easy to map to tool purpose.
Four tools is a well-scoped set for a travel recommendation MCP. Each tool has a clear role in the search/recommendation workflow, and nothing feels extraneous or missing at the count level.
The set covers the main workflows: searching, recommending, resolving filter options, and mapping departure cities. A minor gap is lack of a dedicated product-detail or itinerary tool, but recommendations include links and enough product information to work around this.
Maintenance
Related MCP Connectors
Search vetted local guides and travel routes across China, with deep links to chat and booking.
Search and cite Goora travel posts: citywalk, family trips / 旅行攻略. Read-only.
Search tours, attraction tickets, and holiday packages across 24 countries.
Search and compare multi-day guided group tours and request a quote from a Canadian travel advisor.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables interaction with Douban content including searching and reviewing books, movies, TV shows, and browsing group discussions. Supports searching by ISBN or keywords, retrieving reviews, and managing group topics with filtering capabilities.814MIT
- AlicenseNot gradedqualityDmaintenanceEnables searching for train tickets on China's 12306 railway system, including ticket availability queries, train filtering, station stopover information, and transfer route planning.2MIT
- FlicenseNot gradedqualityDmaintenanceProvides tools to retrieve, visualize, and analyze Chinese scenic spot data by province/city, and generate/publish travel content to Xiaohongshu (Little Red Book) with automated posting capabilities.2-
- AlicenseNot gradedqualityDmaintenanceA travel planning MCP server that supports flight search, weather (including cherry blossom forecasts), exchange rate queries, and trip planning. It specializes in Japan travel from Shenzhen/Hong Kong, providing optimal date analysis and multi-day itinerary suggestions.MIT