flexible-hotels-mcp-server
flexible-hotels-mcp-server
Servidor MCP (Model Context Protocol) que permite a la IA (Claude o cualquier otro cliente MCP) buscar habitaciones de hotel por número de noches en un rango de fechas flexible, en lugar de por una fecha fija de check-in/check-out.
Por ejemplo: "3 noches en Tel Aviv, en algún momento entre el 1.9 y el 20.9" — el servidor escanea todas las fechas de check-in posibles dentro del rango, obtiene precios reales para cada una y devuelve las ofertas más baratas ordenadas por precio.
Modelo de afiliado: es una herramienta de comparación de precios únicamente — no recopila datos de pago ni realiza reservas. Cada resultado incluye un enlace (bookingUrl) que dirige a la fuente (actualmente Booking.com) donde el usuario puede completar la compra por sí mismo, si así lo desea.
Fuente de datos: Amadeus for Developers — la API gratuita líder en el sector turístico, con un entorno de pruebas (test) totalmente gratuito y sin necesidad de tarjeta de crédito.
Qué hay aquí
Cuatro herramientas (tools) expuestas a la IA:
Herramienta | Qué hace |
| Convierte un nombre de ciudad libre ("Tel Aviv") en un código IATA ("TLV") |
| Devuelve una lista de hoteles (y sus identificadores) en una ciudad determinada |
| La herramienta principal — búsqueda flexible por número de noches en un rango de fechas, con enlace de reserva para cada resultado |
| Detalles completos y precio actualizado de una oferta específica + enlace de reserva |
La lógica de "búsqueda flexible" está implementada en src/services/hotelSearch.ts: dado que Amadeus (y cualquier otro proveedor) solo admite un rango de fechas fijo por llamada, el servidor escanea por sí mismo cada fecha de check-in posible dentro de la ventana definida, llama a la API en consecuencia y agrega los resultados. El enlace de cada resultado se construye en src/services/affiliateLink.ts.
Related MCP server: Amadeus Hotel API MCP Server
Instalación
1. Obtén una clave de API gratuita (2 minutos, sin tarjeta de crédito):
Regístrate en https://developers.amadeus.com/register
Después de la verificación, crea una "New App" en My Self-Service Workspace
Recibirás un
API Keyy unAPI Secret— estos seránAMADEUS_CLIENT_IDyAMADEUS_CLIENT_SECRET
Este es el entorno de test (sandbox) — totalmente gratuito, con una cuota mensual generosa y un límite de velocidad de unas 10 solicitudes por segundo. Cubre cientos de miles de hoteles en todo el mundo con datos reales (aunque a veces parciales/en caché). Para pasar a datos en vivo completos en el futuro, se puede solicitar acceso de producción a Amadeus (de pago) y cambiar AMADEUS_ENV=production.
2. Instalación local:
npm install
cp .env.example .env
# ערכו את .env והכניסו את המפתחות שקיבלתם
npm run build3. Comprobar que todo funciona (sin afectar a la cuota — no envía solicitudes reales a Amadeus):
npm testEjecución
npm startPor defecto, el servidor se ejecuta a través de stdio (adecuado para conexión local con clientes como Claude Desktop). Para ejecutarlo como servidor remoto por HTTP (para conectar desde Claude.ai / Cowork como "custom connector", o desde cualquier otro cliente MCP remoto):
TRANSPORT=http PORT=3000 npm startConexión como "plugin" a la IA
Claude Desktop (local)
Añade al archivo de configuración claude_desktop_config.json:
{
"mcpServers": {
"flexible-hotels": {
"command": "node",
"args": ["/נתיב-מלא/ל/flexible-hotels-mcp-server/dist/index.js"],
"env": {
"AMADEUS_CLIENT_ID": "המפתח-שלכם",
"AMADEUS_CLIENT_SECRET": "הסוד-שלכם"
}
}
}
}Tras reiniciar Claude Desktop, la IA podrá llamar a estas herramientas directamente en la conversación.
Conexión remota (Claude.ai / Cowork / cualquier otro cliente)
Para que el producto esté disponible como "plugin" para varios usuarios sin que cada uno ejecute código localmente, hay que desplegar (deploy) el servidor en modo TRANSPORT=http en algún servidor/host, y luego conectar la dirección https://su-dominio/mcp como conector MCP personalizado en la configuración del cliente.
Railway (recomendado si ya tienes cuenta + CLI instalado):
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.appEl servidor se levanta (y pasa el health check) incluso antes de configurar las claves de Amadeus — las herramientas de búsqueda simplemente devolverán un error claro hasta que se configuren las claves reales y se haga un nuevo despliegue automático.
Render: el archivo render.yaml en la raíz del proyecto está listo como Blueprint — conecta el repo a Render, "New" -> "Blueprint", y rellena AMADEUS_CLIENT_ID/AMADEUS_CLIENT_SECRET en la interfaz (ver comentarios dentro del archivo).
Ten en cuenta en todas las opciones: AMADEUS_CLIENT_ID/AMADEUS_CLIENT_SECRET deben ser variables de entorno definidas en el servidor de alojamiento, nunca escritas en el código.
Ejemplo de uso (lo que "ve" la IA)
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="...")
-> מחיר מעודכן + קישור לחיצה שמעביר את המשתמש להשלים את ההזמנה באתר המקוריEl modelo de negocio: afiliado
Este servidor no realiza reservas ni toca datos de pago en ninguna fase — es intencional, tanto por simplicidad/seguridad como porque así funcionan las tiendas de aplicaciones (como ChatGPT App Directory) que exigen "external checkout" y prohíben recopilar números de tarjeta de crédito a través de la propia herramienta.
Cómo funciona en la práctica:
El servidor encuentra precios reales a través de Amadeus (gratis).
Para cada resultado se construye un enlace a la página de búsqueda de Booking.com con el nombre del hotel y las fechas ya rellenados (
src/services/affiliateLink.ts).Si te registras en el Booking.com Affiliate Partner Program (gratuito, registro independiente, sin aprobación especial) y obtienes un
aid, puedes configurarlo como variable de entornoBOOKING_AFFILIATE_ID— entonces cada enlace incluirá tu identificador de socio y podrás recibir comisiones por las reservas realizadas a través del enlace.Sin
BOOKING_AFFILIATE_IDlos enlaces siguen funcionando perfectamente — simplemente no generan comisión.
Esto es exactamente el "solo hay que registrarse" que pediste: el registro único en el programa de socios de Booking.com (no en Amadeus, no en Railway) es todo lo que se necesita para que los enlaces empiecen a generar ingresos.
Limitaciones conocidas
Cuota gratuita: el entorno de
testde Amadeus está limitado en cuota mensual y en velocidad de solicitudes (~10/segundo). Una búsqueda flexible sobre una ventana de N días envía hasta N solicitudes (con una ligera pausa entre ellas) — ventana grande = búsqueda más lenta. La ventana está limitada a 30 días por búsqueda para proteger la cuota.Número de hoteles: por defecto se comprueban hasta 15 hoteles en la ciudad por fecha (se puede aumentar hasta 30 mediante
max_hotels, o reducir ahotelIdsespecíficos).Datos de sandbox: en el entorno de
test, la cobertura más fiable está en las grandes ciudades (por ejemplo, NYC, LON, PAR). Las ciudades más pequeñas pueden devolver pocos hoteles o ninguno — esto se resuelve al pasar aproduction.Los enlaces de reserva construyen una búsqueda en Booking.com por nombre de hotel y fechas — no un enlace profundo (deep link) directo a la habitación específica, porque Amadeus no lo proporciona. En la mayoría de los casos, el hotel relevante aparecerá primero en los resultados.
Estructura del proyecto
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 # בדיקת עשן שמפעילה את השרת האמיתי ומוודאת שכל הכלים נחשפים כראויPosibles ampliaciones futuras
Rango de noches flexible (min/max nights) y no solo un número fijo.
Caché de resultados de búsqueda para ahorrar cuota.
Incorporación de programas de afiliados adicionales (Expedia, Agoda, etc.) y mostrar varios enlaces a diferentes fuentes por cada resultado, no solo Booking.com.
Migración a un proveedor de pago (como StayAPI / RapidAPI) para una cobertura más amplia de proveedores cuando el producto crezca.
Registro en la tienda de aplicaciones de ChatGPT (Apps SDK) — proyecto aparte con sus propios requisitos (cuenta de desarrollador en OpenAI, política de privacidad, cuenta demo para pruebas); el modelo de afiliado actual (sin recopilación de tarjetas de crédito) ya cumple con su requisito de "external checkout".
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