EmilyThaHuman/booking-mcp-server
If you are the rightful owner of booking-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A TypeScript-based Model Context Protocol (MCP) server that integrates Booking.com accommodation search with ChatGPT using the OpenAI Apps SDK.
Booking.com MCP Server with OpenAI Apps SDK
A TypeScript-based Model Context Protocol (MCP) server that integrates Booking.com accommodation search with ChatGPT using the OpenAI Apps SDK. This server provides interactive UI widgets for searching hotels, apartments, hostels, and other accommodations worldwide.
Features
-
Comprehensive Accommodation Search with support for:
- 🏨 Hotels, Apartments, Hostels, Resorts, Villas, Guest Houses, and more
- 📅 Flexible date ranges and number of nights
- 👥 Multiple guests, children, and rooms
- 💰 Budget filtering (min/max price)
- ⭐ Star ratings and guest reviews
- 🏊 Facilities (pool, parking, gym, breakfast, pet-friendly, etc.)
- 📍 Landmark and location-based search
-
Beautiful Interactive Widget - Booking.com-style cards with photos, ratings, and details
-
Sustainability Badges - Shows Travel Sustainable Level certifications
-
Real API Integration - Uses RapidAPI for live accommodation data (with mock data fallback)
-
Cloudflare Workers Ready - Deploy globally with zero-config scaling
-
TypeScript - Fully typed for better development experience
Quick Start
cd booking-mcp-server
npm install
# Optional: Set up API key for real data
cp .env.example .env
# Edit .env and add your RAPIDAPI_KEY
npm run dev
API Setup (Optional)
The server works without an API key using mock data. For real data:
- Sign up at RapidAPI
- Subscribe to Booking.com API
- Copy your API key to
.env:RAPIDAPI_KEY=your_key_here
See for detailed instructions.
Current API Integration
With RAPIDAPI_KEY:
- Real-time accommodation searches from Booking.com
- Actual prices, availability, and guest reviews
- Live property details and amenities
Without RAPIDAPI_KEY:
- Automatically uses mock data
- Perfect for testing and development
Custom API Integration
Option 1: Booking.com Affiliate Partner Hub API
- Sign up for Booking.com Partner Hub
- Get API credentials
- Update
src/worker.tsorsrc/server.ts:
const BOOKING_API_BASE = 'https://distribution-xml.booking.com/2.7/json';
async function searchAccommodations(params: any) {
const response = await fetch(`${BOOKING_API_BASE}/hotels`, {
method: 'GET',
headers: {
'Authorization': `Basic ${btoa(env.BOOKING_USERNAME + ':' + env.BOOKING_PASSWORD)}`,
},
params: new URLSearchParams({
city_ids: params.cityId,
checkin: params.checkIn,
checkout: params.checkOut,
room: params.adults,
// ... other parameters
})
});
return await response.json();
}
Option 2: RapidAPI Booking.com
Use RapidAPI's Booking.com endpoint:
async function searchAccommodations(params: any) {
const response = await fetch(
'https://booking-com.p.rapidapi.com/v1/hotels/search',
{
method: 'POST',
headers: {
'X-RapidAPI-Key': env.RAPIDAPI_KEY,
'X-RapidAPI-Host': 'booking-com.p.rapidapi.com',
'Content-Type': 'application/json',
},
body: JSON.stringify({
dest_id: params.destId,
checkin_date: params.checkIn,
checkout_date: params.checkOut,
adults_number: params.adults,
// ... other parameters
}),
}
);
return await response.json();
}
Tool Schema
accomodations.search
Input Parameters:
destination(required) - City name or destinationcoordinates- Geographic coordinates if city unavailablecheckIn- Check-in date (YYYY-MM-DD format)checkOut- Check-out date (YYYY-MM-DD format)nights- Number of nightsadults- Number of adults (default: 2)children- Number of children (default: 0)rooms- Number of rooms (default: 1)minPrice- Minimum budget per nightmaxPrice- Maximum budget per nightaccommodationType- Type (hotel, apartment, hostel, resort, etc.)facilities- Array of required amenitieslandmark- Nearby landmark or POIrating- Minimum guest rating (0-10)
Output Widget: Accommodation cards showing property details, pricing, ratings, facilities, and booking info
Deployment to Cloudflare Workers
npm install -g wrangler
wrangler login
wrangler deploy
Add your API keys as secrets:
wrangler secret put BOOKING_API_KEY
wrangler secret put RAPIDAPI_KEY
Using in ChatGPT
Example queries:
- "Find hotels in Paris from June 15 to June 20"
- "Show me pet-friendly apartments in Barcelona with parking"
- "Search for 5-star resorts in Bali with pool and spa under $200/night"
- "Find family-friendly hostels near Eiffel Tower with free breakfast"
License
MIT License
Built with ❤️ using TypeScript, MCP, and OpenAI Apps SDK