KeyFlight PNR Converter

io.keyflight由 keyflight.io 發布官方發布者v1.0.0更新於 Oct 28, 2026

Decode Amadeus, Sabre, Galileo and Worldspan PNRs into itineraries, JSON and PRO ticket PDFs.

已驗證Streamable HTTP可網頁執行位置與生活開發者工具

概覽

AI 產生的概覽

託管式 MCP 伺服器,可將 Amadeus、Sabre、Galileo 與 Worldspan 的 PNR 解碼為可讀行程、JSON 與 PRO 機票 PDF。

可以做什麼
  • 把原始 GDS 訂位文字解碼為可讀行程文字與結構化 JSON,包含旅客、航班、機場、航廈、當地時間、飛行時長與航空公司訂位代號,並可選擇版面、時間與日期格式
  • 依 PNR 產生 PRO 機票 PDF,可指定旅客姓名、訂位代號、艙等、價格、幣別與標誌,並回傳 PDF 連結
適用情境
適合處理 GDS 訂位的旅行社與代理,或為訂位工具、CRM、聊天機器人、電子郵件流程加入 PNR 解碼的開發者,希望助理把貼上的訂位文字轉成行程或給旅客的機票 PDF。
執行需求
遠端 Streamable HTTP 端點 keyflight.io/mcp,僅支援 POST,無需本機安裝。需要付費的 KeyFlight 訂閱(沒有免費額度)與 API 金鑰,透過 Authorization 標頭以 Bearer kfp_… 形式傳送;金鑰在訂閱頁面建立且只顯示一次。Claude Desktop 需經由 mcp-remote 連線,因此需要 Node.js。
安裝前請注意
Authorization 標頭攜帶密鑰;金鑰只顯示一次,每個訂閱最多同時存在兩把。每次找到航班的解碼都會計入每月 3,000 次額度(兩把金鑰與 HTTP API 共用),機票每小時每把金鑰最多 30 張。PRO 機票是給旅客的文件,並非航空公司機票,其 PNR 不會與航空公司系統核對。來自其他網站頁面的請求會被拒絕。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 KeyFlight PNR Converter,將其新增到工作區。
  2. 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.keyflight%2Fpnr/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "keyflight-pnr-converter": {
      "type": "http",
      "url": "https://keyflight.io/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

[KeyFlight PNR API & MCP: decode Amadeus, Sabre, Galileo and Worldspan PNRs in Claude, Cursor or your code]

KeyFlight PNR Converter: MCP server and PNR API

Paste a raw booking from a GDS (Amadeus, Sabre, Galileo, Worldspan) into Claude, Cursor or another AI assistant and get a readable itinerary, the booking as JSON, or a PRO ticket PDF.

KeyFlight runs a hosted Model Context Protocol server at https://keyflight.io/mcp and an HTTP API at https://keyflight.io/api/v1/pnr/decode. Both use the same decoder as the free PNR converter on keyflight.io.

This repository holds the documentation and examples. The server itself is hosted by KeyFlight: there is nothing to install or run. Full reference: keyflight.io/pnr-api.

Who it is for: travel agents and agencies who work with GDS bookings, and developers who add PNR decoding to a booking tool, CRM, chat bot or e-mail flow.

Get an API key

The MCP server and the PNR API take the same key, kfp_ followed by 43 letters, digits, - and _.

  1. Get the KeyFlight subscription (the subscription for travel agents).
  2. On the same page use "Already subscribed?", open the link we e-mail you and press "Create API key".
  3. Copy the key: it is shown once. A subscription can have 2 keys at a time; you revoke a key on the same page.

While the subscription is not active, the key answers 403 subscription_inactive. There is no free tier for the API or the MCP server. The PNR converter on the website is free for everyone, with no key.

Connect an AI assistant (MCP)

Server URLhttps://keyflight.io/mcp
TransportStreamable HTTP, POST only, no sessions and no server-sent event stream
Authenticationheader Authorization: Bearer kfp_…
Protocol versions2025-06-18, 2025-03-26, 2024-11-05

Claude Code

bash
claude mcp add --transport http keyflight https://keyflight.io/mcp --header "Authorization: Bearer kfp_…"

Cursor (.cursor/mcp.json)

json
{  "mcpServers": {    "keyflight": {      "url": "https://keyflight.io/mcp",      "headers": {        "Authorization": "Bearer kfp_…"      }    }  }}

Claude Desktop (claude_desktop_config.json, needs Node.js)

Claude Desktop connects through mcp-remote:

json
{  "mcpServers": {    "keyflight": {      "command": "npx",      "args": [        "-y",        "mcp-remote",        "https://keyflight.io/mcp",        "--header",        "Authorization: Bearer kfp_…"      ]    }  }}

Cline (cline_mcp_settings.json)

In Cline open MCP Servers → Configure MCP Servers and add:

json
{  "mcpServers": {    "keyflight": {      "type": "streamableHttp",      "url": "https://keyflight.io/mcp",      "headers": {        "Authorization": "Bearer kfp_…"      },      "disabled": false,      "autoApprove": []    }  }}

Step-by-step notes for AI agents that install the server: llms-install.md.

Then ask, for example: "Decode this PNR and make a PRO ticket with a price of 850 EUR" and paste the booking.

Other clients: any MCP client that supports Streamable HTTP and custom headers. Requests sent from web pages of other sites (with a browser Origin header) are refused with 403 origin_not_allowed, so connect from a desktop app, a CLI or your server. Without a client, see examples/mcp/raw-jsonrpc.sh: one JSON-RPC message per POST, JSON back.

MCP tools

decode_pnr: decode a PNR

Turns a raw PNR into a readable itinerary (text) and structured JSON: passengers, flights, airports, terminals, local times, flight duration, airline locators.

ArgumentTypeDefaultDescription
textstring, requiredThe PNR as the GDS shows it, up to 20,000 characters. The format is recognised from the text.
viewtable, lines2, lines3, whatsapptableLayout of the itinerary text.
time_format"24", "12""24"24 or 12 hour time.
date_format"short", "numeric""short"short: 3 May 2026, numeric: 03.05.2026.

Returns the itinerary text, then JSON: and the same JSON as the PNR API answer. Clients that read structuredContent get that JSON there.

Each decode that finds flights counts towards the monthly decodes of the subscription, like an API call. A text without flights returns an error and does not count. When the decodes of the month are used up, the tool returns an error until the 1st (UTC).

make_ticket: make a PRO ticket PDF

Makes a PRO ticket PDF (PNR, airline logos, class, optional price) from a raw PNR and returns a link to the PDF. Included in the KeyFlight subscription.

The ticket is a document for the traveller: it is not an airline ticket and its PNR is not checked against airline systems.

ArgumentTypeDefaultDescription
textstring, requiredThe PNR, up to 20,000 characters. Every flight needs a date and times.
passengersarray of strings, up to 20the names in the PNRPassenger names as on the ticket, e.g. "SMITH/JOHN MR".
pnrstringthe code in the text, or a random oneBooking code printed on the ticket, 5–8 letters and digits.
booking_classEconomy, Premium Economy, Business, First Classthe cabin of the first flight's booking classClass on the ticket.
pricestringno price on the ticketTotal price printed on the ticket, e.g. "1200.50".
currencystring, up to 10 characters"$"Currency next to the price, e.g. "USD", "€".
logonone, expeditionnoneLogo in the ticket header.
time_format"24", "12""24"24 or 12 hour time.
date_format"short", "numeric"short or numeric.

Returns a line PRO ticket PDF: https://keyflight.io/tickets/….pdf with the PNR, the number of flights and the passengers, and as structuredContent:

json
{ "url": "https://keyflight.io/tickets/….pdf", "pnr": "PQ7XNR", "passengers": ["JOHNSON JOHN", "JOHNSON JANE"], "segments": 2 }

Tickets do not count towards the monthly decodes; one key can make up to 30 tickets an hour.

Errors (no flights in the text, a flight without a date or time, no passenger names, a wrong pnr or option, more than 30 tickets in an hour) come back as tool results with isError: true, so the assistant can read them and fix the call.

PNR API over HTTP

POST https://keyflight.io/api/v1/pnr/decode with Content-Type: application/json and Authorization: Bearer kfp_…. The body is { "text": "…", "options": { … } }. The HTTP API returns data and the itinerary as text and HTML; PRO ticket PDFs come from the MCP tool make_ticket. The examples below send the Amadeus booking from examples/pnr-amadeus.txt.

curl

bash
curl https://keyflight.io/api/v1/pnr/decode \  -H "Authorization: Bearer $KEYFLIGHT_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "text": "RP/LHRBA/LHRBA            BA/BA  26APR26/1200Z   PQ7XNR\nPQ7XNR/BA QLHR 03MAY\n1.JOHNSON JOHN\n2.JOHNSON JANE\n3  BA 178 Y 03MAY 7 LHRJFK HK2  0855 1205  03MAY  E  BA/PQ7XNR\n4  BA 117 Y 10MAY 7 JFKLHR HK2  1830 0640  11MAY  E  BA/PQ7XNR\n5 TKT/TIME LIMIT\n6 OPC LHRBA-10MAY:1900/1S2/Q TKT/T-BA\n7 FA PAX 125-2196837482/ETBA/GBP560.20/03MAY26/LHRBA2104/00390755/S3-4",  "options": {    "view": "table"  }}'

Node.js 18+

examples/api/decode.mjs:

js
// Node.js 18+ (fetch is built in), in an ES module or an async functionconst text = `RP/LHRBA/LHRBA            BA/BA  26APR26/1200Z   PQ7XNRPQ7XNR/BA QLHR 03MAY1.JOHNSON JOHN2.JOHNSON JANE3  BA 178 Y 03MAY 7 LHRJFK HK2  0855 1205  03MAY  E  BA/PQ7XNR4  BA 117 Y 10MAY 7 JFKLHR HK2  1830 0640  11MAY  E  BA/PQ7XNR5 TKT/TIME LIMIT6 OPC LHRBA-10MAY:1900/1S2/Q TKT/T-BA7 FA PAX 125-2196837482/ETBA/GBP560.20/03MAY26/LHRBA2104/00390755/S3-4`;
const response = await fetch('https://keyflight.io/api/v1/pnr/decode', {  method: 'POST',  headers: {    Authorization: `Bearer ${process.env.KEYFLIGHT_API_KEY}`,    'Content-Type': 'application/json',  },  body: JSON.stringify({ text, options: { "view": "table" } }),});const data = await response.json();if (response.ok) {  data.segments.forEach((s) => console.log(s.airlineCode, s.flightNumber, s.departure.date));} else {  console.error(response.status, data.error, data.message);}

Python

examples/api/decode.py (needs requests):

python
import osimport requests
text = """RP/LHRBA/LHRBA            BA/BA  26APR26/1200Z   PQ7XNRPQ7XNR/BA QLHR 03MAY1.JOHNSON JOHN2.JOHNSON JANE3  BA 178 Y 03MAY 7 LHRJFK HK2  0855 1205  03MAY  E  BA/PQ7XNR4  BA 117 Y 10MAY 7 JFKLHR HK2  1830 0640  11MAY  E  BA/PQ7XNR5 TKT/TIME LIMIT6 OPC LHRBA-10MAY:1900/1S2/Q TKT/T-BA7 FA PAX 125-2196837482/ETBA/GBP560.20/03MAY26/LHRBA2104/00390755/S3-4"""
response = requests.post(    "https://keyflight.io/api/v1/pnr/decode",    headers={"Authorization": f"Bearer {os.environ['KEYFLIGHT_API_KEY']}"},    json={"text": text, "options": { "view": "table" }},    timeout=30,)data = response.json()if response.ok:    for s in data["segments"]:        print(s["airlineCode"], s["flightNumber"], s["departure"]["date"])else:    print(response.status_code, data["error"], data["message"])

Options

FieldValuesDefault
textRequired. The booking as the GDS shows it, up to 20,000 characters.
options.viewtable, lines2, lines3, whatsapp: the layout of itinerary.table
options.timeFormat"24" (18:30), "12" (6:30 PM)"24"
options.dateFormat"short" (3 May 2026), "numeric" (03.05.2026)"short"
options.show.logotrue / false. Airline logos (HTML only).true
options.show.airportstrue / false. Airport names and terminals next to the city.true
options.show.cabintrue / false. Cabin and booking class: Economy (Y).false
options.show.statustrue / false. Segment status: Confirmed, Waitlisted.false
options.show.passengerstrue / false. Passenger names above the flights.false
options.show.pnrtrue / false. The booking reference and the airlines' references above the flights.false

An unknown option or a wrong value answers 400 invalid_option with the field and the allowed values.

Response

The full answer to the example above: examples/api/response-example.json (itinerary.html shortened). Main fields:

FieldMeaning
pnrCodeThe booking reference found in the text, or null.
passengers[].nameA passenger name as the PNR writes it.
segments[].airlineCode, airlineName, flightNumberAirline and flight number ("950" for UA0950).
segments[].bookingClass, cabinBooking class letter and cabin by it: Economy, Premium Economy, Business, First Class.
segments[].status, statusTextStatus code as in the PNR ("HK2") and Confirmed, Waitlisted or the code itself.
segments[].logoUrlAirline logo, 64×64 PNG.
segments[].durationFlight time in minutes across the two airports' time zones, or null.
segments[].distance{ km, miles } between the airports, or null.
segments[].aircraftCode, aircraftAircraft type when the PNR shows it, or null.
segments[].operatedByOperating airline as the PNR prints it (OPERATED BY …), or null.
segments[].airlineLocator{ airlineCode, code }: the airline's own booking reference, or null.
segments[].departure, arrivalcode, city, airport, terminal, local date (YYYY-MM-DD) and time (HH:MM).
itineraryview, text and html (e-mail HTML with tables and inline styles; null for whatsapp).

itinerary.html of the example in the table view, with options.show.logo: false, as the free converter shows it:

[Decoded itinerary of the example booking: BA 178 London (LHR) to New York (JFK) on 3 May 2026, BA 117 New York (JFK) to London (LHR) on 10 May 2026]

Limits

LimitValue
PNR textup to 20,000 characters; JSON body up to 100kb
Requests per key60 a minute on the API and 60 a minute on the MCP server; over it 429 too_many_requests with Retry-After
Requests per IP address120 a minute
Decodes per subscription3,000 a calendar month (UTC), both keys together, API and decode_pnr together. Only decodes that found flights count.
PRO ticket PDFs (make_ticket)30 an hour per key

Answers of the HTTP API carry X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-Monthly-Limit, X-Monthly-Remaining, X-Monthly-Reset.

Errors

PNR API errors are JSON: { "error": "<code>", "message": "…" }.

StatuserrorWhen
400invalid_jsonThe body is not a JSON object.
400text_requiredtext is missing or empty.
400invalid_optionAn unknown option or a wrong value. field names it, allowed lists the values.
401missing_api_keyNo Authorization: Bearer … header.
401invalid_api_keyThe key is not valid or was revoked.
403subscription_inactiveThe subscription of the key is not active.
404not_foundNo such endpoint.
405method_not_allowedThe method is not POST.
413too_longThe text is longer than 20,000 characters (max in the answer).
413payload_too_largeThe body is larger than 100kb.
415unsupported_encodingThe body is not UTF-8.
422no_flightsNo flights in the text. Does not count towards the monthly limit.
429too_many_requestsOver the per-minute limit; wait Retry-After seconds.
429monthly_limit_reachedThe subscription has used its decodes for this month.
500server_errorSomething went wrong on our side.
503service_unavailableThe key cannot be checked right now. Try again in a minute.

Before a tool runs, the MCP server answers in the same JSON: 401 missing_api_key / invalid_api_key, 403 subscription_inactive, 429 too_many_requests and 503 service_unavailable; also 403 origin_not_allowed for requests from web pages of other sites and 405 method_not_allowed for anything but POST. Inside a tool, errors (the monthly limit too) are tool results with isError: true.

Supported GDS formats

Amadeus (1A), Sabre (1B/1S), Galileo (1G) and Worldspan (1P). Send the booking as the GDS shows it; you don't need to say which system it came from. Example bookings for each system: Amadeus, Sabre, Galileo, Worldspan.

Links

License

The examples and documentation in this repository are under the MIT License. The KeyFlight service is not open source; using it needs a KeyFlight subscription.

來源:README.md,提交 f0ebd7c

工具

0
該伺服器需要 API 金鑰等憑證,因此 SourceWeft 無法在沒有憑證的情況下讀取其工具,也未收錄。

版本歷史

1
  1. v1.0.0最新Oct 20, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分