mcpField
O
Open Transfer Times

Open Transfer Times

本地服务
github.com/joelynli0110地图与出行05 天前更新

关于 Open Transfer Times

Open Transfer Times 是供 Agent 评估一次中转航班的只读 MCP 服务。它根据机场引用资料给出确定且可解释的评估,并区分缺少数据与可用估算。

主要功能

  1. 01评估中转决策、评级和置信度
  2. 02计算中转步骤与时间余量
  3. 03纳入机票保障、航站楼和行李因素
  4. 04比较并排序 2–20 个行程
  5. 05返回机场资料及引用事实

适用场景

  1. 01推荐航班前评估中转时间
  2. 02为航班搜索结果中的一次中转选项排序
  3. 03检查更换航站楼对中转的影响
  4. 04找出缺失的行李或机场信息

MCP 相关

该 MCP 服务提供只读工具,用于检查和比较中转方案以及获取机场资料。它通过本地 stdio 运行,无需 API 密钥或网络调用。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"joelynli0110-open-transfer-times": {
"command": "npx",
"args": [
"-y",
"open-transfer-times-mcp"
]
}
}
}
启动命令npx -y open-transfer-times-mcp

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmopen-transfer-times-mcp0.3.0

工具

4

收录的工具列表 · 更新于 4 天前

参数类型必填说明
tostring是第二个航班的目的地机场(IATA),例如 PVG
viastring是中转机场(IATA),例如 IST
fromstring是第一个航班的出发机场(IATA),例如 BER
ticketenum否protected = 两个航班在同一张机票/同一预订中;separate = 分开购票并自行中转;如果未说明,则为 unknownprotected | separate | unknown
arrival_timestring否第一个航班抵达中转机场的计划时间,当地时间,YYYY-MM-DDTHH:mm。请提供两个时间,否则改为提供 layover_minutes。
departure_timestring否第二个航班从中转机场起飞的计划时间,当地时间,YYYY-MM-DDTHH:mm。请提供两个时间,否则改为提供 layover_minutes。
baggage_recheckboolean否如果必须提取托运行李并重新办理托运,则设为 true
layover_minutesinteger否到达与起飞之间的计划时长,单位为分钟。用户只提供中转时长时使用;不要臆造日期或时钟时间。
terminal_changeboolean否如果已知需要更换航站楼,但未提供航站楼信息,则设为 true
arrival_terminalstring否已知时填写中转机场的到达航站楼
departure_terminalstring否已知时填写中转机场的出发航站楼

详细介绍

open-transfer-times-mcp

一个 MCP 服务,让 AI Agent 在推荐或预订航班前,检查中转是否切实可行。

航班搜索工具会返回行程,但不会说明在法兰克福转机时,50 分钟的中转时间是否足够。此服务通过 open-transfer-times 引擎提供确定且可解释的评估,并返回每项估算背后引用的机场信息,让 Agent 能展示信息来源。

通过标准输入输出在本地运行。无需 API 密钥,也不会发起网络调用。

工具

所有工具均为只读。

工具功能
check_connection评估一次中转:给出决策(recommend / caution / insufficient_data / avoid)、评级(comfortable → risky)、含理由的置信度、实际中转时间、计入的各个中转步骤及所需分钟数、余量、机票保障风险,以及附带引用来源的中转机场信息。
compare_connections评估 2–20 个行程(例如航班搜索结果)并排序:依次按决策、评级、机票保障(同一张机票 → 未知 → 自行转机)、置信度和余量排序。缺少数据的中转永远不会排在可用选项之前。为每个选项传入你自己的 id,以便将结果对应起来。
get_airport_profile查看机场的中转时间估算、每项数据属于 heuristic 还是 sourced,以及附带官方链接的引用信息。
list_airports查看具有独立档案的机场,以及各机场的信息来源充足程度。
check_connection 输入
字段必填示例说明
from、via、to是BER、LHR、PVGIATA 代码;不区分大小写。
arrival_time二选一2026-09-20T10:00第一段航班的到达时间,即 via 机场的当地时间;UTC 偏移量(+02:00)可选。
departure_time二选一2026-09-20T11:30第二段航班的起飞时间,即 via 机场的当地时间。
layover_minutes二选一90仅知道中转时长时,用此项代替两个时间。
ticket否protectedprotected(同一订单)、separate(自行转机)、unknown(默认值)。
arrival_terminal、departure_terminal否2、5两项都提供且值不同时,系统会判定需要更换航站楼。
terminal_change否true已知需要更换航站楼,但不知道具体航站楼时使用。
baggage_recheck否falsetrue:必须提取行李并重新办理托运。false:仅携带手提行李,或行李直挂。仅在未知时省略;若机票分开,结果会显示这是否有影响。

请提供两个时间,或提供 layover_minutes。若提供两个时间,它们必须一致。

结果文本示例:

BER–LHR–PVG: CAUTION — The terminals are not known, and a terminal change would leave little or no margin; ask for the terminals.
Rating: REASONABLE — A practical connection on one ticket.
Confidence: MEDIUM — The terminals are not known; a terminal change would make this connection tight or risky. With a terminal change (25 min) the margin would be 10 min (tight). The transfer-step durations are rule-of-thumb estimates, not sourced figures.
Layover 90 min, transfer steps 55 min, margin 10 to 35 min (10 min if every possible step applies: tight).
Steps counted: Move through airport 40 min (heuristic); Allow for another security check 15 min (heuristic). No other steps were counted.
Possible step not counted: Change terminals 25 min (terminals not given). Give the margin as a range and ask for the terminals if it matters.
Factors: Transfer through London Heathrow; Additional security screening may apply; Moderate transfer margin.
Ticket: Protected itinerary.
MCT: no published minimum connection time in this data. This is a structural estimate, not proof that an airline would sell this connection.
Data: London Heathrow profile (partial, 3 cited facts).
Comparing several options? Send them together to compare_connections, which ranks them.
Airport facts are context, not extra steps. Apply a fact only where its scope matches this trip:
- All connecting passengers go through security screening again at Heathrow.
- ...

机票分开且未说明行李是否需要重新托运,而重新托运会产生影响时:

BER–IST–PVG: INSUFFICIENT DATA — Separate tickets, and it is not known whether bags must be collected and checked in again; a re-check would make this connection tight or risky. With a bag re-check the margin would be -15 min (risky). The result cannot be relied on.
Do not call this connection safe, fine or comfortable. Tell the user the estimate is unreliable, why, and what would settle it.
Confidence: LOW, for the reasons above.
Rough estimate only: layover 75 min, transfer steps 45 min, margin 30 min.
...
Bags: not stated. If they must be collected and checked in again, the margin is -15 min (risky). Ask the user.
  • 文本会先给出决定,compare_connections 会解释每个不推荐的选项(“原因:……”)。对于 insufficient_data,文本会完全省略评级:在 Agent 评估中,即使决定说明评级不可靠,Agent 仍会重复“舒适”和“有充足余量”等说法来让用户放心。评级仍保留在 structuredContent 中。
  • mct 与结构性评级分开处理。below_published 表示中转时间低于该机场航空公司公布的最低中转时间(例如,Lufthansa 在 FRA 的最低中转时间为 60 分钟);此规定是否适用于这趟行程为 unknown,因此绝不会将其视为通过。
  • decision 是应采取行动的字段。insufficient_data 表示缺少关键信息(置信度原因会说明具体缺少什么):应询问用户,而不是推荐这段中转。
  • steps 的总和始终等于 transfer_process_minutes。事实会列出其 scope(例如“巴黎机场的 Air France 中转”),以免 Agent 将其错误地应用于其他行程。
  • 中转时间按实际经过时间计算:在 13 个已整理资料的机场,跨越夏令时变更的中转时间会按机场所在时区计算,wall_clock_layover_minutes 则显示时钟上的时间差。
给 Agent 的说明

客户端连接时,服务会发送使用说明(MCP instructions):先根据用户提供的信息调用工具;使用 layover_minutes,不要臆造时间;只有缺少机场或时长时才提问;比较选项时使用 compare_connections;只解释已计入的步骤;报告决定;先给出结果,再询问机票分开时的行李情况;并遵守事实的适用范围(限定范围的事实会显示为“(仅适用于:……)”)。每条规则都针对测试 Agent 时发现的问题;请参阅 eval。

相同的数据也会以符合工具输出架构的 structuredContent 形式返回。

设置

需要 Node.js 20+。

Claude Desktop — 添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "open-transfer-times": {
      "command": "npx",
      "args": ["-y", "open-transfer-times-mcp"]
    }
  }
}

Claude Code:

claude mcp add open-transfer-times -- npx -y open-transfer-times-mcp

克隆此仓库后使用(软件包发布前):

{
  "mcpServers": {
    "open-transfer-times": {
      "command": "node",
      "args": ["/absolute/path/to/open-transfer-times/packages/mcp/src/cli.js"]
    }
  }
}

请先在仓库根目录运行 npm install。

与航班搜索服务搭配使用

可将其与任何搜索航班的 MCP 服务配合使用。可以向 Agent 提出类似这样的请求:“查找 9 月 20 日从柏林飞往上海的航班,并按中转安全性对所有一次中转的选项进行排序”——Agent 使用一个服务搜索航班,再将结果传递给 compare_connections。

限制

  • 仅支持一站式行程(两段航程)。
  • 根据计划时间和已发布的机场信息进行结构性估算: 这不是官方最低中转时间,也不是延误预测。
  • 13 个机场有各自的资料;其他机场均使用标准基准值,结果会标记为 coverage: "baseline"。
  • 在 13 个有资料的机场会处理时钟变更;其他机场请传入带 UTC 偏移的时间,以精确计算中转时长。

开发

npm install                          # at the repository root
node packages/mcp/test/server.test.js
npx @modelcontextprotocol/inspector node packages/mcp/src/cli.js   # interactive testing

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。