Skip to main content
Glama
open-transfer-times

open-transfer-times

Open Transfer Times

CI npm open-transfer-times MCP server

Is this flight connection comfortable, tight, or risky? Open, cited airport transfer data, an engine that explains its verdict, and an MCP server so AI agents can check connections before recommending a flight.

Try it

Ask an AI agent to compare layovers. With the MCP server connected, it gets:

1. IST 3 h BER–IST–PVG: RECOMMEND — rated comfortable, margin 135 min, protected itinerary, medium confidence
2. VIE 2 h BER–VIE–PVG: INSUFFICIENT DATA — estimate only, margin 65 min, protected itinerary, low confidence
   Why: Key information is missing, so the rating cannot be relied on. No transfer profile for this airport; generic baseline allowances were used.
3. FRA 50 min BER–FRA–PVG: AVOID — rated risky, margin -5 min, protected itinerary, medium confidence
   Why: The transfer steps take about as long as the layover or longer.
Only RECOMMEND and CAUTION options may be presented as workable; for the others, say why.

Vienna has plenty of time but no airport data, so it is not recommended. Each result gives a decision, the transfer steps it counted, a confidence level, and the official sources behind the airport data:

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 (tight if every possible step applies).
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 missing detail if it matters.

With Claude Desktop or any MCP client

Add to claude_desktop_config.json, then fully restart Claude:

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

Then ask, in a new chat: "From Berlin to Shanghai, which is safest: 50 minutes in Frankfurt, 3 hours in Istanbul or 2 hours in Vienna?"

With a flight search. Add a flight-search MCP server such as fli next to it, and ask "Find flights from Berlin to Shanghai on 21 December. I prefer cheap ones, but no risky connections." The agent searches, checks every connection, and ranks the results by risk as well as price: docs/demo-flight-search.md.

The server is also listed in the official MCP Registry and on Glama. Tools and options: packages/mcp.

From code

npm install open-transfer-times
const { assessConnection } = require("open-transfer-times");

const result = assessConnection(
  { segments: [
    { origin: "BER", destination: "LHR", arrivalTime: "2026-09-20T10:00" },
    { origin: "LHR", destination: "PVG", departureTime: "2026-09-20T11:30" }
  ] },
  { ticketStatus: "protected" }
);
result.quality;          // "reasonable"
result.confidence.level; // "medium"

API reference: packages/core.

Related MCP server: lufthaven

Why this exists

Airlines and booking systems decide whether a connection is feasible using minimum connection times (MCT): commercial data sold by IATA and schedule providers. Open flight-search tools can find itineraries but cannot say whether a layover is realistic. This project collects what airports and airlines publish openly, cites every fact, and marks every estimate as an estimate.

How it works

The engine is deterministic: the model that calls it explains the result but never does the arithmetic.

  1. Start from the real layover: at profiled airports, in the airport's time zone, so a daylight-saving change is accounted for.

  2. Deduct the transfer steps that apply at the connection airport: a base transfer allowance, Schengen passport control when the transfer crosses the Schengen border, a terminal change, security re-screening, and bag re-check. Each step applies, does not apply, or is unknown. An unknown step (terminals or bags not given) is not counted as "no": it is listed as a possible step, and the margin becomes a range from best to worst case.

  3. Rate the remaining margin: comfortable (≥ 45 min), reasonable (≥ 25), tight (≥ 5) or risky.

Alongside the rating:

  • Confidence (high / medium / low). An airport without a profile, or a route whose border situation is unknown, is always low confidence, so missing data is never presented as "no risk".

  • Ticket protection. Separate tickets change the warning and verdict, but do not add transfer time by themselves. When bags on separate tickets are not stated, the result shows what a re-check would do.

  • Published minimum connection times, checked separately (mct). Where an airline publishes an MCT for the airport (Lufthansa's 60 minutes at FRA), its conditions (operating airline, route type) decide whether it applies, does not apply, or is unknown. Below an MCT that applies is avoid; below one that may apply rules out recommend; unknown is never a pass. A structural estimate is not proof that an airline would sell a connection.

  • Decision (recommend / caution / insufficient_data / avoid) combines the above. Missing data never yields recommend, and comparisons rank by decision first.

Airport data

13 hub airports have their own profile in airports/, one YAML file each; every other airport uses a standard baseline. All 13 cite official airport or airline pages. Facts confirm transfer steps, for example that Heathrow, Hong Kong, Changi, Incheon, Narita and Doha screen transfer passengers again, while most durations are still estimates (basis: heuristic). COVERAGE.md shows how well each airport is sourced.

Contributions welcome, no code needed. Add an airport, replace an estimate with a sourced figure, or report a rule the format can't express: see CONTRIBUTING.md or open an issue with the Airport data form.

Limitations

  • Not an official MCT table, and no delay prediction. It is a structural estimate with its sources attached.

  • Durations are mostly rule-of-thumb. None of the 52 step durations is sourced or derived yet, so no result reaches high confidence. A deep check of FRA, AMS and LHR found that airports publish which steps apply, but not how long they take; minutes come from airlines (MCTs) or from parts of a transfer (a train ride, a bus interval). The only sourced minute value is a published airline MCT (FRA). Sourcing durations matters more than adding airports with estimates only.

  • MCT applicability needs the operating airlines. Without them a published MCT whose route matches is reported as possibly applying. Only FRA's Lufthansa MCT is in the data so far.

  • One stop at a time. Itineraries with more connections are rejected; check each connection separately.

  • Schengen status comes from each airport's country (OurAirports, about 9,000 airports). Special cases inside member countries are listed in regions/schengen.yaml (Svalbard so far); Ceuta and Melilla's extra checks are not modelled.

  • Conditional steps: security only so far. AMS re-screens transfer passengers depending on where they arrive from, and the engine applies that rule. Terminal-pair rules (NRT) and MUC's "some cases" are not modelled yet; MUC re-screening still counts as 0 (RFC 0001).

  • Self-transfers. Re-checking bags on separate tickets counts entry control, check-in, exit control and departure security (estimates). Whether entering the country needs a visa is not checked.

  • Clock changes at other airports. Only the 13 profiled airports have time zones. Elsewhere a layover across a daylight-saving change is off by an hour unless the times carry UTC offsets.

  • Visa and transit-visa requirements are not covered.

Roadmap

RFC 0001 proposes the next steps: a country for every airport, rules with conditions, self-transfer border steps, time zones beyond the profiled airports, and sourced durations for MUC, NRT and LHR. It addresses most of the limitations above. Feedback is welcome on issue #6.

The agent evaluation measures how reliably an AI agent uses the server: 38 questions in Chinese and English, graded on tool calls and answer accuracy, for any model behind Anthropic, OpenAI, OpenRouter or a local Ollama.

Repository layout

Path

What it is

airports/, regions/

The transfer dataset (YAML) and Schengen membership.

packages/core

open-transfer-times on npm: the dependency-free engine.

packages/mcp

open-transfer-times-mcp on npm: the MCP server.

eval/

Agent evaluation against the Claude API.

extension/

Chrome extension for Google Flights (beta, not in the Chrome Web Store).

docs/

RFCs, data sources, extension store materials.

src/, pyproject.toml

Legacy Python research code (delay simulation, EUROCONTROL benchmarks). Not published, not maintained, not used by the packages above.

Development

Requires Node.js 20+.

npm install
npm run check   # airport data validation, lint, all tests, extension build
npm run smoke   # pack both npm packages, install them, call the MCP server
npm run eval    # agent evaluation: Anthropic, OpenAI, OpenRouter or local Ollama (eval/README.md)

npm run airports:build regenerates the engine's data after editing airports/*.yaml. CI runs check and smoke on Ubuntu and Windows with Node 20 and 22. Working on the extension: extension/README.md. Changes by release: CHANGELOG.md.

License

MIT. Airport names come from the public-domain OurAirports dataset.

Available Tools

4 tools
check_connectionCheck a flight connectionA
Read-onlyIdempotent

Assess whether a one-stop flight connection leaves enough time to transfer. Deducts the transfer steps that apply at the connection airport (walking, Schengen passport control, terminal change, security re-screening, baggage re-check) from the scheduled layover and returns comfortable / reasonable / tight / risky, the reasons, ticket-protection exposure, and the cited airport facts behind the estimate. Give the scheduled arrival and departure as local wall-clock times at the connection airport, or only layover_minutes when that is all the user said. Explain the result using the returned steps; airport facts are context and only apply where their scope matches the trip. To compare two or more options, call compare_connections once instead of this tool for each.

Inputs: to (required), via (required), from (required), ticket, +7 more. Returns: route, steps, ticket, factors, +14 more

compare_connectionsCompare and rank flight connectionsA
Read-onlyIdempotent

Assess several one-stop itineraries (for example the results of a flight search) and rank them from safest to riskiest connection: by decision (recommend, caution, insufficient data, avoid), then transfer quality, then ticket protection (one ticket before unknown before self-transfer), then confidence, then remaining margin. Each option takes times or layover_minutes, like check_connection. Use the optional id to map results back to your own options (e.g. an offer id or price).

Inputs: options (required). Returns: ranked, disclaimer

get_airport_profileGet an airport's transfer profileA
Read-onlyIdempotent

Return the transfer allowances used for an airport, whether each is a heuristic estimate or sourced, and the cited facts (with official source links) about transferring there. Airports without a profile use the standard baseline.

Inputs: airport (required). Returns: iata, name, facts, coverage, +3 more

list_airportsList airports with transfer profilesA
Read-onlyIdempotent

List the airports that have their own transfer profile, with how well each is sourced.

Inputs: no named parameters. Returns: airports

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 4 tools

    Disambiguation4/5

    check_connection and compare_connections inherently overlap, but the descriptions draw a clear line: use compare once for two or more options instead of looping check. The remaining tools (get_airport_profile, list_airports) target distinct data-retrieval purposes with no ambiguity.

    Naming Consistency5/5

    All four names follow the same snake_case verb_noun pattern (check_connection, compare_connections, get_airport_profile, list_airports), with the singular/plural distinction accurately reflecting single-vs-multiple input semantics.

    Tool Count4/5

    Four tools is on the lean side but each earns its place: one assessment engine, one batch comparator, and two airport-facts retrieval tools. Nothing feels redundant, though the surface is narrow enough that a fifth tool (e.g. airport search) wouldn't be out of place.

    Completeness4/5

    The surface covers the core lifecycle: assess a single connection, rank multiple options, inspect an airport's transfer profile, and enumerate profiled airports. Minor gaps remain (only one-stop connections, no way to search or look up profiles by city/country), but agents can work around them with the baseline behavior described.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables flight planning and aviation operations through intelligent airport resolution, great-circle route calculation, and aircraft performance estimation. Supports 28,000+ airports worldwide and 190+ aircraft types for comprehensive flight planning via natural language.
      46
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides AI assistants with real-time and forecast airport intelligence, including security wait times, FAA delays, EU border queues, lounge and terminal info, aviation weather, and baggage performance for over 8,000 airports.
      MIT