Skip to main content
Glama
flexible-hotels-mcp-server

flexible-hotels-mcp-server

by sholts2026

flexible-hotels-mcp-server

AI(Claude やその他の MCP クライアント)が、固定のチェックイン/チェックアウト日ではなく、柔軟な日付範囲内の宿泊日数に基づいてホテルの部屋を検索できるようにする MCP(Model Context Protocol)サーバーです。

例:「テルアビブで3泊、9月1日から9月20日の間のどこかで」— サーバーは範囲内のすべての可能なチェックイン日をスキャンし、それぞれの実際の価格を取得して、価格順に並べた最もお得な取引を返します。

アフィリエイトモデル: これは価格比較ツールのみです — 支払い情報を収集したり、予約を実行したりすることはありません。各結果には、ユーザーが自分で購入を完了できるソース(現時点では Booking.com)へのリンク(bookingUrl)が含まれています。

データソース: Amadeus for Developers — 観光分野をリードする無料APIで、完全に無料のテスト環境(test)があり、クレジットカードは不要です。

含まれるもの

AIに公開されている4つのツール:

ツール

機能

flexible_hotels_resolve_city_code

自由形式の都市名(「テルアビブ」)をIATAコード(「TLV」)に変換する

flexible_hotels_list_hotels_in_city

指定された都市のホテル(とID)のリストを返す

flexible_hotels_search_flexible_offers

メインツール — 日付範囲内の宿泊日数による柔軟な検索。各結果に予約リンク付き

flexible_hotels_get_offer_details

特定の取引の完全な詳細と最新価格 + 予約リンク

「柔軟な検索」ロジックはsrc/services/hotelSearch.tsに実装されています:Amadeus(および他のすべてのプロバイダー)は呼び出しごとに固定の日付範囲のみをサポートするため、サーバーは定義されたウィンドウ内のすべての可能なチェックイン日を自分でスキャンし、それに応じてAPIを呼び出し、結果を集約します。各結果へのリンクはsrc/services/affiliateLink.tsで構築されます。

Related MCP server: Amadeus Hotel API MCP Server

インストール

1. 無料のAPIキーを取得する(2分、クレジットカード不要):

  1. https://developers.amadeus.com/register で登録する

  2. 認証後、My Self-Service Workspace で「New App」を作成する

  3. API Key と API Secret を受け取る — これらが AMADEUS_CLIENT_ID と AMADEUS_CLIENT_SECRET になります

これはtest(サンドボックス)環境です — 完全に無料で、寛大な月間クォータと毎秒約10リクエストのレート制限があります。世界中の数十万のホテルを実際のデータ(ただし不完全/キャッシュされた場合もあります)でカバーしています。将来、完全なライブデータに切り替えるには、Amadeusにproductionアクセスを申請(有料)し、AMADEUS_ENV=production に変更します。

2. ローカルインストール:

npm install
cp .env.example .env
# ערכו את .env והכניסו את המפתחות שקיבלתם
npm run build

3. すべてが機能することを確認する(クォータを消費せず、Amadeusに実際のリクエストを送信しません):

npm test

実行

npm start

デフォルトでは、サーバーはstdio経由で実行されます(Claude Desktopなどのクライアントへのローカル接続に適しています)。HTTP経由のリモートサーバーとして実行する場合(Claude.ai / Cowork への「カスタムコネクタ」として、または他のリモートMCPクライアントからの接続用):

TRANSPORT=http PORT=3000 npm start

AIへの「プラグイン」としての接続

Claude Desktop(ローカル)

設定ファイル claude_desktop_config.json に追加します:

{
  "mcpServers": {
    "flexible-hotels": {
      "command": "node",
      "args": ["/נתיב-מלא/ל/flexible-hotels-mcp-server/dist/index.js"],
      "env": {
        "AMADEUS_CLIENT_ID": "המפתח-שלכם",
        "AMADEUS_CLIENT_SECRET": "הסוד-שלכם"
      }
    }
  }
}

Claude Desktopを再起動すると、AIは会話内でこれらのツールを直接呼び出せるようになります。

リモート接続(Claude.ai / Cowork / その他のクライアント)

製品を複数のユーザーがローカルでコードを実行せずに「プラグイン」として利用できるようにするには、サーバーをTRANSPORT=httpモードでサーバー/ホストにデプロイし、クライアント設定で https://あなたのドメイン/mcp アドレスをカスタムMCPコネクタとして接続します。

Railway(すでにアカウント + CLIがインストールされている場合に推奨):

cd flexible-hotels-mcp-server
railway login          # רק אם עוד לא מחוברים — פותח דפדפן לאישור
railway up --new -y --detach --json   # יוצר פרויקט חדש, מעלה את הקוד ומפעיל build מה-Dockerfile
railway variable set AMADEUS_CLIENT_ID=המפתח-שלכם --skip-deploys
railway variable set AMADEUS_CLIENT_SECRET=הסוד-שלכם --skip-deploys
railway variable set AMADEUS_ENV=test
railway domain          # מפיק כתובת ציבורית כמו https://xxx.up.railway.app

サーバーは、Amadeusキーを設定する前でも起動し(ヘルスチェックに合格します)— 実際のキーが設定されて自動再デプロイが行われるまで、検索ツールは明確なエラーを返すだけです。

Render: プロジェクトルートのrender.yamlファイルがBlueprintとして準備されています — repoをRenderに接続し、「New」→「Blueprint」で、インターフェースでAMADEUS_CLIENT_ID/AMADEUS_CLIENT_SECRETを入力します(ファイル内のコメントを参照)。

すべてのオプションで注意:AMADEUS_CLIENT_ID/AMADEUS_CLIENT_SECRETはホストサーバー上の環境変数として設定する必要があり、コードに記述してはいけません。

使用例(AIが「見る」もの)

User: תמצא לי 3 לילות בתל אביב, איפשהו בין ה-1 ל-20 בספטמבר, לזוג.

AI calls: flexible_hotels_resolve_city_code(keyword="Tel Aviv")
  -> TLV

AI calls: flexible_hotels_search_flexible_offers(
  city_code="TLV", nights=3,
  earliest_check_in="2026-09-01", latest_check_in="2026-09-20",
  adults=2
)
  -> רשימת עסקאות ממוינת מהזולה ביותר, עם תאריך צ'ק-אין/אאוט מדויק וקישור הזמנה לכל אחת

User: מעולה, תראה לי את הפרטים המלאים של האופציה הכי זולה.

AI calls: flexible_hotels_get_offer_details(offer_id="...")
  -> מחיר מעודכן + קישור לחיצה שמעביר את המשתמש להשלים את ההזמנה באתר המקורי

ビジネスモデル: アフィリエイト

このサーバーは予約を実行せず、いかなる段階でも支払い情報に触れません — これは意図的で、シンプルさ/安全性のためであり、また「外部チェックアウト」を要求し、ツール自体によるクレジットカード番号の収集を禁止するアプリストア(ChatGPT App Directoryなど)の仕組みに沿ったものです。

実際の仕組み:

  1. サーバーはAmadeus(無料)を通じて実際の価格を検索します。

  2. 各結果について、ホテル名と日付が事前入力されたBooking.comの検索ページへのリンクが構築されます(src/services/affiliateLink.ts)。

  3. Booking.com Affiliate Partner Program(無料、自己登録、特別な承認不要)に登録してaidを取得すると、環境変数BOOKING_AFFILIATE_IDとして設定できます — するとすべてのリンクにあなたのパートナーIDが含まれ、リンク経由で行われた予約に対してコミッションを受け取れます。

  4. BOOKING_AFFILIATE_IDがなくてもリンクは完全に機能します — ただ報酬が発生しないだけです。

これはまさにあなたが求めた「登録するだけ」です:Booking.comのパートナープログラムへの一度きりの登録(AmadeusやRailwayではなく)だけで、リンクが収益を生み始めます。

既知の制限事項

  • 無料クォータ: Amadeusのtest環境は月間クォータとリクエストレート(約10/秒)に制限があります。N日間のウィンドウでの柔軟な検索は最大N回のリクエストを送信します(間に軽い遅延あり)— ウィンドウが大きいほど検索が遅くなります。クォータを保護するため、ウィンドウは検索ごとに30日に制限されています。

  • ホテル数: デフォルトでは、各日付について都市内の最大15のホテルがチェックされます(max_hotelsで最大30まで増やせるか、特定のhotelIdsに絞り込めます)。

  • サンドボックスデータ: test環境では、カバレッジが最も信頼できるのは大都市(例:NYC、LON、PAR)です。小さな都市ではホテルが少ないかゼロの場合があります — これはproductionへの移行で解決されます。

  • 予約リンクはホテル名と日付に基づいてBooking.comの検索を構築します — Amadeusが提供しないため、特定の部屋へのディープリンクではありません。ほとんどの場合、関連するホテルが結果の最初に表示されます。

プロジェクト構造

src/
├── index.ts              # נקודת כניסה, רישום השרת והכלים
├── constants.ts           # קבועים (URLs, מגבלות)
├── types.ts                # טיפוסי TypeScript משותפים
├── services/
│   ├── amadeusClient.ts   # קליינט HTTP מאומת ל-Amadeus (OAuth2, endpoints)
│   ├── hotelSearch.ts     # הלוגיקה של חיפוש גמיש (הליבה)
│   ├── affiliateLink.ts   # בניית קישור ההזמנה (Booking.com + aid אופציונלי)
│   └── format.ts           # פורמט markdown לתשובות
├── schemas/
│   └── schemas.ts          # סכמות Zod לכל כלי
├── tools/                  # רישום כל כלי MCP
└── test/
    └── hotelSearch.test.ts # בדיקות יחידה ללוגיקת החיפוש (ללא צורך במפתח API)
scripts/
└── smoke-test-tools.mjs    # בדיקת עשן שמפעילה את השרת האמיתי ומוודאת שכל הכלים נחשפים כראוי

今後の拡張の可能性

  • 固定数ではなく柔軟な宿泊日数範囲(最小/最大泊数)。

  • クォータ節約のための検索結果のキャッシュ。

  • 追加のアフィリエイトプログラム(Expedia、Agodaなど)への参加と、Booking.comだけでなく各結果に複数のソースへのリンクを表示。

  • 製品が成長するにつれて、より広いプロバイダーカバレッジのための有料プロバイダー(StayAPI / RapidAPIなど)への移行。

  • ChatGPTアプリストア(Apps SDK)への登録 — 独自の要件(OpenAI開発者アカウント、プライバシーポリシー、テスト用デモアカウント)を持つ別プロジェクト。現在のアフィリエイトモデル(クレジットカード収集なし)は、すでに彼らの「外部チェックアウト」要件に準拠しています。

Available Tools

4 tools
flexible_hotels_get_offer_detailsGet Hotel Offer DetailsA
Read-onlyIdempotent

Fetch full, up-to-date details for a single hotel offer previously returned by search_flexible_hotel_offers, including its cancellation policy.

Offer prices can shift between search and booking, so call this before telling the user a final price or sending them to book. Like the rest of this server, it never collects payment details — it only reads offer details and returns a click-through link to the real site.

Args:

  • offer_id (string): the offerId returned by search_flexible_hotel_offers

  • response_format ('markdown' | 'json'): output format (default markdown)

Returns: hotel name, confirmed price, check-in/check-out dates, room description, board type, cancellation deadline, and a booking link to the real site.

Examples:

  • Use when: the user picked one result from search_flexible_hotel_offers and wants to double-check the price before going to book

  • Don't use when: you don't have an offer_id yet — run search_flexible_hotel_offers first

Error Handling:

  • Returns "No details found for this offer id" if the offer expired (Amadeus test-environment offers are short-lived)

Inputs: offer_id (required), response_format.

flexible_hotels_list_hotels_in_cityList Hotels in a CityA
Read-onlyIdempotent

List hotels (with their Amadeus hotelId) located in a given IATA city code, optionally within a radius.

Use this to discover hotelIds you can pass into search_flexible_hotel_offers via hotel_ids, e.g. to restrict a search to a specific neighborhood or a shortlist of hotels the user already mentioned by name. It does NOT return prices or availability — only hotel identity/location. This tool does not modify any data.

Args:

  • city_code (string): 3-letter IATA city code, e.g. "TLV", "PAR" (use resolve_city_code to find it)

  • radius_km (number): search radius around the city center in km, 1-300 (default 20)

  • max_results (number): max hotels to return, 1-30 (default 20)

  • response_format ('markdown' | 'json'): output format (default markdown)

Returns: hotel name, hotelId, chain code, and coordinates for each matching hotel.

Examples:

  • Use when: "only search hotels near the Tel Aviv beachfront" -> narrow radius_km, then pass returned hotelIds to search_flexible_hotel_offers

  • Don't use when: you just want priced offers — use search_flexible_hotel_offers directly, it looks up hotels automatically

Error Handling:

  • Returns "No hotels found for city code ..." if the city_code is invalid or has no coverage in this environment

Inputs: city_code (required), radius_km, max_results, response_format.

flexible_hotels_resolve_city_codeResolve City Name to IATA City CodeA
Read-onlyIdempotent

Look up the 3-letter IATA city code for a free-text city name (e.g. "Tel Aviv" -> "TLV", "Paris" -> "PAR").

Every other tool in this server (list_hotels_in_city, search_flexible_hotel_offers) requires an IATA city_code, so this is normally the first tool to call when the user names a city.

Args:

  • keyword (string): city name or the start of it, e.g. "Tel Aviv", "New York", "Par"

  • max_results (number): max cities to return, 1-20 (default 10)

  • response_format ('markdown' | 'json'): output format (default markdown)

Returns: matching cities with their name, iataCode, and country code.

Examples:

  • Use when: "find flexible hotel deals in Tel Aviv" -> call with keyword="Tel Aviv" first to get city_code="TLV"

  • Don't use when: you already have a 3-letter IATA city code

Error Handling:

  • Returns "No cities found matching ..." if the keyword doesn't match anything

Inputs: keyword (required), max_results, response_format.

flexible_hotels_search_flexible_offersSearch Hotel Offers by Number of Nights (Flexible Dates)A
Read-only

Find the cheapest hotel offers for a fixed NUMBER OF NIGHTS across a WINDOW of possible check-in dates, instead of a single fixed check-in/check-out date pair. This is the core tool of this server.

For example: "3 nights in Tel Aviv, sometime between Sep 1 and Sep 20" is expressed as nights=3, earliest_check_in="2026-09-01", latest_check_in="2026-09-20". The tool scans every possible check-in date in that window (each implying checkout = check-in + nights), fetches real priced offers for each, and returns the cheapest options found, sorted by price — so the caller can see which exact dates are the best deal.

This does NOT search by a single fixed date — for that, just set earliest_check_in = latest_check_in. This is an AFFILIATE search tool: it never collects payment details or creates a booking. Each returned offer includes a bookingUrl — a link to the real hotel/OTA listing where the guest can complete the purchase themselves, if they choose to. Data comes from the Amadeus for Developers hotel API (free test/sandbox environment by default).

Args:

  • city_code (string): 3-letter IATA city code, e.g. "TLV" (use resolve_city_code to find it from a name)

  • nights (number): exact stay length in nights, 1-28

  • earliest_check_in / latest_check_in (YYYY-MM-DD): the flexible window of possible check-in dates, at most 30 days apart

  • hotel_ids (string[], optional): restrict to specific Amadeus hotelIds (from list_hotels_in_city)

  • max_hotels (number): if hotel_ids is omitted, how many hotels in the city to auto-check (default 15)

  • adults (number): guests per room (default 2)

  • room_quantity (number): rooms to book (default 1)

  • currency (string, optional): 3-letter ISO currency code, e.g. "USD"

  • max_results (number): how many offers to return, cheapest first (default 10)

  • response_format ('markdown' | 'json'): output format (default markdown)

Returns: For JSON format: { "cityCode": string, "nights": number, "earliestCheckIn": string, "latestCheckIn": string, "datesScanned": number, "datesWithOffers": number, "datesSkipped": [{ "date": string, "reason": string }], "hotelsConsidered": number, "offers": [{ "offerId", "hotelId", "hotelName", "checkInDate", "checkOutDate", "nights", "currency", "totalPrice", "boardType", "roomDescription", "bookingUrl" }, ...], "cheapest": <same shape as one offer, or null>, "truncated": boolean }

Examples:

  • Use when: "find me the cheapest 3-night stay in Paris sometime in the next month"

  • Use when: "is it cheaper to go for a long weekend early or late September?"

  • Don't use when: the user already has exact fixed dates in mind — a single-date search is faster (set earliest_check_in = latest_check_in), though this tool still works for that case.

Error Handling:

  • Returns an error if the date window exceeds 30 days — narrow it and retry

  • Individual dates that error out (e.g. sandbox has no data) are listed in datesSkipped rather than failing the whole search

Inputs: nights (required), city_code (required), latest_check_in (required), earliest_check_in (required), +7 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.6/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: resolving city names to codes, listing hotels, searching flexible offers, and getting offer details. There is no overlap or ambiguity between them; the workflow is linear and obvious.

    Naming Consistency5/5

    All tool names follow the same pattern: 'flexible_hotels_' prefix followed by a verb_noun combination (resolve_city_code, list_hotels_in_city, search_flexible_offers, get_offer_details). The verbs are consistent and descriptive, making the API predictable.

    Tool Count4/5

    Four tools is on the lower end but well-scoped for a focused flexible hotel search server. Each tool is necessary and covers a distinct step in the workflow; there is no bloat or redundancy.

    Completeness5/5

    The server covers the complete user journey: resolve city → optionally list hotels → search offers → get details. For an affiliate-focused read-only service, the surface is complete with no obvious missing operations or dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to search, browse, and book hotels from a database of 2 million properties worldwide. Provides comprehensive hotel search capabilities with location lookup, filtering by amenities, detailed property information, and integrated booking functionality.
      6
      1
      ISC
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to search, compare, and book hotels with real-time pricing and availability, supporting multiple location types, star ratings, and price filters.
      12
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to search and book hotels globally with real-time pricing and inventory from over 2 million properties.
      46
      MIT