flexible-hotels-mcp-server
flexible-hotels-mcp-server
Ein MCP-Server (Model Context Protocol), der es einer KI (Claude oder einem anderen MCP-Client) ermöglicht, Hotelzimmer nach Anzahl der Nächte in einem flexiblen Datumsbereich zu suchen, anstatt nach einem festen Check-in-/Check-out-Datum.
Zum Beispiel: „3 Nächte in Tel Aviv, irgendwann zwischen dem 1.9. und dem 20.9." – der Server durchsucht alle möglichen Check-in-Daten im Bereich, holt echte Preise für jedes davon und liefert die günstigsten Angebote, sortiert nach Preis.
Affiliate-Modell: Dies ist ein reines Preisvergleichstool – es sammelt keine Zahlungsdaten und führt keine Buchung durch. Jedes Ergebnis enthält einen Link (bookingUrl), der zur Quelle (derzeit Booking.com) führt, wo der Nutzer den Kauf selbst abschließen kann, falls er das überhaupt möchte.
Datenquelle: Amadeus for Developers – die führende kostenlose API im Tourismusbereich, mit einer komplett kostenlosen Testumgebung (test) und ohne Kreditkartenpflicht.
Was es hier gibt
Vier Tools, die der KI zur Verfügung stehen:
Tool | Was es tut |
| Wandelt einen freien Stadtnamen („Tel Aviv") in einen IATA-Code („TLV") um |
| Liefert eine Liste von Hotels (und deren IDs) in einer bestimmten Stadt |
| Das zentrale Tool – flexible Suche nach Anzahl der Nächte in einem Datumsbereich, mit Buchungslink für jedes Ergebnis |
| Vollständige Details und aktueller Preis für ein bestimmtes Angebot + Buchungslink |
Die Logik der „flexiblen Suche" ist in src/services/hotelSearch.ts umgesetzt: Da Amadeus (und jeder andere Anbieter) nur einen festen Datumsbereich pro Aufruf unterstützt, durchsucht der Server selbst jedes mögliche Check-in-Datum im definierten Fenster, ruft die API entsprechend auf und bündelt die Ergebnisse. Der Link für jedes Ergebnis wird in src/services/affiliateLink.ts erstellt.
Related MCP server: Amadeus Hotel API MCP Server
Installation
1. Kostenlosen API-Schlüssel erhalten (2 Minuten, ohne Kreditkarte):
Registrieren Sie sich unter https://developers.amadeus.com/register
Erstellen Sie nach der Verifizierung eine „New App" in My Self-Service Workspace
Sie erhalten einen
API Keyund einAPI Secret– diese werden zuAMADEUS_CLIENT_IDundAMADEUS_CLIENT_SECRET
Dies ist die test-Umgebung (Sandbox) – komplett kostenlos, mit großzügigem Monatskontingent und einem Ratenlimit von etwa 10 Anfragen pro Sekunde. Sie deckt Hunderttausende Hotels weltweit mit echten Daten ab (wenn auch manchmal teilweise/gecacht). Um später auf vollständige Live-Daten umzusteigen, können Sie bei Amadeus Produktionszugriff (kostenpflichtig) beantragen und AMADEUS_ENV=production setzen.
2. Lokale Installation:
npm install
cp .env.example .env
# ערכו את .env והכניסו את המפתחות שקיבלתם
npm run build3. Prüfen, dass alles funktioniert (ohne das Kontingent zu belasten – sendet keine echten Anfragen an Amadeus):
npm testAusführung
npm startStandardmäßig läuft der Server über stdio (geeignet für die lokale Verbindung mit Clients wie Claude Desktop). Um ihn als entfernten HTTP-Server auszuführen (für die Verbindung von Claude.ai / Cowork als „custom connector" oder von jedem anderen entfernten MCP-Client):
TRANSPORT=http PORT=3000 npm startVerbindung als „Plugin" mit der KI
Claude Desktop (lokal)
Fügen Sie zur Konfigurationsdatei claude_desktop_config.json hinzu:
{
"mcpServers": {
"flexible-hotels": {
"command": "node",
"args": ["/נתיב-מלא/ל/flexible-hotels-mcp-server/dist/index.js"],
"env": {
"AMADEUS_CLIENT_ID": "המפתח-שלכם",
"AMADEUS_CLIENT_SECRET": "הסוד-שלכם"
}
}
}
}Nach einem Neustart von Claude Desktop kann die KI diese Tools direkt im Gespräch aufrufen.
Entfernte Verbindung (Claude.ai / Cowork / jeder andere Client)
Damit das Produkt als „Plugin" für mehrere Benutzer verfügbar ist, ohne dass jeder lokal Code ausführen muss, muss der Server im Modus TRANSPORT=http auf einem Server/Host bereitgestellt (deployt) werden. Anschließend verbinden Sie die Adresse https://ihre-domain/mcp als Custom-MCP-Connector in den Client-Einstellungen.
Railway (empfohlen, wenn Sie bereits ein Konto + CLI installiert haben):
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.appDer Server startet (und besteht den Health Check) auch bevor die Amadeus-Schlüssel konfiguriert sind – die Suchtools geben dann einfach eine klare Fehlermeldung zurück, bis die echten Schlüssel gesetzt und ein automatisches Re-Deployment erfolgt ist.
Render: Die Datei render.yaml im Projektstamm ist als Blueprint vorbereitet – verbinden Sie das Repo mit Render, „New" -> „Blueprint", und füllen Sie AMADEUS_CLIENT_ID/AMADEUS_CLIENT_SECRET in der Oberfläche aus (siehe Kommentare in der Datei).
Beachten Sie bei allen Optionen: AMADEUS_CLIENT_ID/AMADEUS_CLIENT_SECRET müssen als Umgebungsvariablen auf dem Host-Server definiert sein, niemals im Code.
Beispielverwendung (was die KI „sieht")
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="...")
-> מחיר מעודכן + קישור לחיצה שמעביר את המשתמש להשלים את ההזמנה באתר המקוריDas Geschäftsmodell: Affiliate
Dieser Server führt keine Buchungen durch und berührt in keiner Phase Zahlungsdaten – das ist beabsichtigt, sowohl aus Gründen der Einfachheit/Sicherheit als auch, weil App-Stores (wie das ChatGPT App Directory) so funktionieren: Sie verlangen einen „external checkout" und verbieten das Sammeln von Kreditkartennummern über das Tool selbst.
So funktioniert es in der Praxis:
Der Server findet echte Preise über Amadeus (kostenlos).
Für jedes Ergebnis wird ein Link zur Suchseite auf Booking.com erstellt, bei dem Hotelname und Daten bereits ausgefüllt sind (
src/services/affiliateLink.ts).Wenn Sie sich beim Booking.com Affiliate Partner Program anmelden (kostenlos, eigenständige Registrierung, ohne besondere Genehmigung) und eine
aiderhalten, können Sie diese als UmgebungsvariableBOOKING_AFFILIATE_IDfestlegen – dann enthält jeder Link Ihre Partner-ID und Sie können Provisionen für Buchungen erhalten, die über den Link erfolgen.Ohne
BOOKING_AFFILIATE_IDfunktionieren die Links weiterhin vollständig – sie sind nur nicht vergütet.
Das ist genau das „nur registrieren", das Sie wollten: Eine einmalige Anmeldung beim Partnerprogramm von Booking.com (nicht bei Amadeus, nicht bei Railway) ist alles, was nötig ist, damit die Links anfangen, Einnahmen zu generieren.
Bekannte Einschränkungen
Kostenloses Kontingent: Die
test-Umgebung von Amadeus ist durch ein Monatskontingent und eine Anfragenrate (~10/Sekunde) begrenzt. Eine flexible Suche über ein Fenster von N Tagen sendet bis zu N Anfragen (mit einer leichten Verzögerung dazwischen) – ein großes Fenster bedeutet eine langsamere Suche. Das Fenster ist auf 30 Tage pro Suche begrenzt, um das Kontingent zu schützen.Anzahl der Hotels: Standardmäßig werden bis zu 15 Hotels in der Stadt pro Datum geprüft (über
max_hotelsauf bis zu 30 erhöhbar, oder auf bestimmtehotelIdseingrenzbar).Sandbox-Daten: In der
test-Umgebung ist die Abdeckung in großen Städten am zuverlässigsten (z. B. NYC, LON, PAR). Kleinere Städte können wenige oder keine Hotels zurückgeben – das wird durch den Wechsel zuproductionbehoben.Die Buchungslinks erstellen eine Suche auf Booking.com nach Hotelname und Daten – kein direkter Deep Link zum spezifischen Zimmer, da Amadeus keinen solchen bereitstellt. In den meisten Fällen erscheint das relevante Hotel zuerst in den Ergebnissen.
Projektstruktur
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 # בדיקת עשן שמפעילה את השרת האמיתי ומוודאת שכל הכלים נחשפים כראויMögliche zukünftige Erweiterungen
Flexibler Nächtebereich (min/max Nächte) statt nur einer festen Anzahl.
Caching von Suchergebnissen zur Schonung des Kontingents.
Beitritt zu weiteren Affiliate-Programmen (Expedia, Agoda usw.) und Anzeige mehrerer Links zu verschiedenen Quellen für jedes Ergebnis, nicht nur Booking.com.
Wechsel zu einem kostenpflichtigen Anbieter (wie StayAPI / RapidAPI) für eine breitere Anbieterabdeckung, wenn das Produkt wächst.
Registrierung im ChatGPT App Store (Apps SDK) – ein separates Projekt mit eigenen Anforderungen (OpenAI-Entwicklerkonto, Datenschutzrichtlinie, Demo-Konto zum Testen); das aktuelle Affiliate-Modell (ohne Kreditkartenerfassung) entspricht bereits deren „external checkout"-Anforderung.
Available Tools
4 toolsflexible_hotels_get_offer_detailsGet Hotel Offer DetailsARead-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 CityARead-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 CodeARead-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)ARead-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
Scored across 4 tools
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.
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.
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.
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
Related MCP Connectors
Live hotel search and booking for AI agents in DACH, the UK and 10 US cities.
AI hotel search and booking: millions of properties, 85,000+ cities, live rates.
Search hotels, check live room prices and availability, and get a checkout link to book.
Search and book 3M+ hotels in 200+ countries. Agents pay per reservation in USDC on Base over x402. Hosted, no auth.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables 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.61ISC
- AlicenseAqualityNot gradedmaintenanceEnables AI assistants to search for and book hotels via the Amadeus Travel API, providing hotel listings, offers, and booking capabilities.41MIT

DIDA Hotel MCPofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents to search, compare, and book hotels with real-time pricing and availability, supporting multiple location types, star ratings, and price filters.12MIT
Dida Hotel MCPofficial
AlicenseNot gradedqualityDmaintenanceEnables AI agents to search and book hotels globally with real-time pricing and inventory from over 2 million properties.46MIT