Skip to main content
Glama
KatouMegumii

vac-product-recommend-mcp

by KatouMegumii

vac-product-recommend-mcp

本地 stdio 形态的 MCP Server:按需求在携程跟团游「精选/综合」列表里搜索产品,并按 点评分、销量、价格等维度推荐 TopN,返回统一格式的 Markdown 表格(含网页端 / 移动端链接)。

纯 Python 标准库实现,无需第三方依赖,Python 3.10+ 即可运行。

提供的工具

工具

作用

recommend_tours

按关键词 + 多条件筛选,返回销量与点评俱佳的 TopN 产品

search_tours

搜索综合列表,返回 Markdown 表格

get_filter_options

查询当前可用的筛选器及可选值,用于枚举映射

get_departure_cities

按城市名/拼音查询携程出发城市 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.ps1

uv 会在首次运行时自动下载 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 操作,必须:

  1. 严格检查本 README 的「重要:让 Agent 严格保持输出格式」和「每次咨询完全独立」等限制是否有变化;

  2. 把最新限制同步到 Agent 的个性化 / 记忆 / Rules / 系统提示词中;

  3. 重启 / 重连 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 的示例配置。

环境变量:

变量

必填

说明

CTRIP_COOKIE

从浏览器复制的完整 cookie 串,不填也能跑(可能触发风控)

CTRIP_GUID

可留空;留空时使用内置默认值

CTRIP_W_PAYLOAD_SOURCE

风控签名,当前接口不强制

CTRIP_X_CTX_WCLIENT_REQ

轮换 token,当前接口不强制

主要参数

recommend_tours / search_tours

参数

说明

keyword

目的地/主题,如「土耳其」「广西」

depart_city_id

出发城市 ID;仅在用户提到出发城市时用 get_departure_cities

travel_way

旅行方式,多选数组:["拼小团","跟团游"]

brand

品牌,如 自营 / 携程自营,可多选

level

钻级,如 5钻 / 4钻 / 3钻,可多选

team_size

团队规模:最多9人 / 10-20人 / 21人及以上;用户提到人数必须设置

vehicle

交通方式:不含往返交通 / 不含大交通 / 当地参团

service_tags

服务保障,多选 AND(逗号分隔或数组):0购物一价全包

suit_person

适用人群,多选 OR(逗号分隔或数组):亲子友好老友会严选

promo

优惠活动,如 机票用户价火车票用户价

days

天数,支持 7 / 6-8 / 6,7,8;给出发返程日时用 返程-出发+1

departure_date

出发日期(仅出发日),格式 YYYY-MM-DD

vendor

供应商名称或 ID,多选,名称模糊匹配

include_traffic

仅当用户要「含往返交通」时传 ;不含请用 vehicle

min_score

最低点评分,默认 0 不过滤;与人数无关

budget_max

预算上限

top_n

推荐数量

candidate_limit

候选池上限,自动翻页凑够匹配数

  1. 浏览器打开携程 H5 跟团游列表(或 DevTools 切移动端模拟)。

  2. F12 → Network → 找 graphql?queryName=productSearchInfo

  3. 右键 → Copy → Copy as cURL。

  4. -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.md
Install Server
F
license - not found
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    Enables 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.
    8
    9
    9
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A 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.
    11
    ISC

View all related MCP servers

Related MCP Connectors

  • TravelMind: 8 MCP tools for travel (12306 trains, flights, hotels, geocode, planning, policy).

  • Search and book theatre, attractions, tours across 681 cities. 13,090+ products.

  • China & Asia travel eSIM specialist. 200+ countries. No-VPN internet in China.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/KatouMegumii/vac-product-recommend-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server