@curless/hotel-storefront

中文文档
0.65.0发布于 2026/11/11MITTypeScriptES Module近 30 天下载 1.4万

One hotel-booking MCP connector, driven by a config file. Brand, tool names, vocabulary and where the rooms come from live in a HotelConfig, so the second hotel group is a JSON file rather than a fork.

原始使用文档
文档目录5 节
  1. Dates are a first-class type
  2. The tools
  3. Three rules the code enforces
  4. Where the rooms come from
  5. Payment

@curless/hotel-storefront

A hotel-booking MCP connector, driven by one config file. Brand, tool names, vocabulary and where the rooms come from live in a HotelConfig, so the second hotel group is a JSON file rather than a fork.

npx @curless/hotel-storefront ./config.json   # the config lives in the brand's own repo

It answers on POST /mcp (streamable HTTP), serves its own card as a ui:// resource, and publishes /docs, /privacy, /terms and /healthz.

Dates are a first-class type

The one structural difference from a shopping connector: a room has no price until someone names the nights. Everything that can carry a price takes a Stay, and the parts that cannot — a hotel's summary, its amenities — are deliberately separate from the parts that can. A connector that guesses "this weekend" books someone the wrong nights, and they find out at the front desk.

The tools

Twenty-one, named from the brand's prefix, two of them the card's own and kept from the model. A backend that cannot do something says so in its capabilities, and those tools are not listed at all - Huazhu's deployment has fourteen (no loyalty, add-ons, in-place changes or policy text).

list_<brand>_hotelsThe group's destinations, or hotels by city or free text - with filters, a sort and a nightly ceiling, and with checkIn/checkOut each priced for those nights. A city usually holds several, and all of them come back
look_up_<brand>_hotelsUp to six hotels read as text and drawn nowhere: what a comparison or a plan is made from
get_<brand>_hotelOne hotel; with dates, its rooms priced for those nights and the arrival days either side
compare_<brand>_hotelsTwo to four side by side - the model's judgement, the server's figures (it takes no prices)
show_<brand>_itineraryDay by day, each item marked as in the trip or only planned
list_<brand>_extrasTransfers, dining, experiences, spa, family - for a stay, or for a booking already made
add_to_<brand>_trip · view_ · clear_The trip: room nights plus add-ons, priced as one
request_<brand>_bookingA demonstration hold (demo) or a booking paid at the hotel (a group's own API); a confirmation code per stay
pick_<brand>_room · book_picked_<brand>_roomThe card's own, app-only: Reserve on one rate, and booking that one room. The pick has a slot beside the trip - a second pick replaces the first, and neither touches the trip
list_my_<brand>_bookingsThis conversation's bookings, or one found by its code and the email it was made with
preview_<brand>_cancellation · cancel_<brand>_bookingThe fee and its rule, before anything is cancelled
preview_<brand>_booking_change · change_<brand>_bookingNew nights, rooms or add-ons: the difference first, then the change
get_<brand>_hotel_policiesWhat the property itself publishes
sign_in_<brand>_member · sign_out_A membership number and the surname on it - a member rate, never a way into anybody's booking
forget_<brand>_preferencesRemoves the room preferences a member asked to have remembered

Tool descriptions say what a tool does and nothing else; how to behave lives in the server's instructions, which is what both assistant directories' listing attestations require.

Three rules the code enforces

  • No dates, no line. add_to_*_trip asks rather than guessing.
  • Preview, then cancel. cancel_*_booking returns the fee and its rule and cancels nothing until it is called again with confirmed.
  • Held is not paid, and booked is not paid. A booking takes no money and collects no card; the answer says so, and the card says so in as many words.

Where the rooms come from

Everything goes through one HotelBackend interface, and there are two:

  • data.source: "demo" reads a JSON file and prices it (DemoHotels). Every price-bearing answer carries demo: true and says so in words — an invented rate presented as bookable is the one failure a booking connector cannot have.
  • data.source: "api", data.api.provider: "huazhu" books for real through Huazhu's distributor OpenAPI: the hotel list kept on disk and current, prices, rules and rooms left asked for live, prebook before every booking, one reservation per stay paid at the hotel, and a booking whose answer was lost followed up by the consistency query for the eight minutes Huazhu's rules require. Credentials come from the environment (HUAZHU_CLIENT_ID, HUAZHU_CLIENT_SECRET, HUAZHU_DISTRIBUTOR_ID), never the config.
  • data.api.sandbox: true is the same connector against a SIMULATED Huazhu, for testing before there is an account: node dist/huazhu/sandbox.js serves the distributor API as its documentation describes it, with nine invented hotels named 【模拟】/[Sandbox] and no photographs, and keeps its bookings in SANDBOX_STATE_FILE. The flag makes every answer say demo, the instructions and the legal pages say it is a test environment, and nothing claim a booking went to Huazhu - without it an api source is taken to be real.

A backend says what it cannot do through capabilities — Huazhu has no loyalty sign-in, no add-ons and no in-place date change — and the tools, the server instructions, the card and the legal pages leave those out rather than offering something that always says no.

# The first call against a real environment, read-only - it never books:
HUAZHU_CLIENT_ID=… HUAZHU_CLIENT_SECRET=… HUAZHU_DISTRIBUTOR_ID=… \
  npx @curless/hotel-storefront --check ./config.json

Payment

Not in this version, by design: the arc ends at a booking request. The seam is config.payment.mode.

MIT · part of agentbank

版本与发布记录

@curless/hotel-storefront 共发布 189 个版本,首次发布于 2026/09/18;过去 12 个月发布了 189 个版本。

版本发布日期距今
0.65.0latest2026/11/11今天
0.64.02026/11/11今天
0.63.22026/11/10今天
0.63.12026/11/10今天
0.63.02026/11/10今天
0.62.02026/11/10今天

关于 @curless/hotel-storefront 的常见问题

@curless/hotel-storefront 是什么?

One hotel-booking MCP connector, driven by a config file. Brand, tool names, vocabulary and where the rooms come from live in a HotelConfig, so the second hotel group is a JSON file rather than a fork.

如何安装 @curless/hotel-storefront?

在项目目录运行 npm install @curless/hotel-storefront,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 curless-hotel-storefront,可以用 npx curless-hotel-storefront 直接运行。

@curless/hotel-storefront 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@curless/hotel-storefront 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@curless/hotel-storefront 可以商用吗?

@curless/hotel-storefront 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@curless/hotel-storefront 的下载量有多少?

根据 npm 官方下载统计,@curless/hotel-storefront 在 2026/10/11 – 2026/11/09 这 30 天内被下载 13,541 次,日均约 451 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@curless/hotel-storefront 还在维护吗?

最新版本 0.65.0 发布于 2026/11/11(今天);至今共发布 189 个版本,其中过去 12 个月发布了 189 个;首次发布于 2026/09/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。