npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-hotelplanet-mcp-server

v1.0.3

Published

HotelPlanet MCP Server for hotel booking operations

Readme

HotelPlanet MCP Server

A Model Context Protocol (MCP) server that provides hotel booking tools including search, price checking, booking, and cancellation capabilities using the HotelPlanet API.

Features

The server exposes four main tools:

  1. search_hotel_availability - Search for available hotels by property IDs
  2. check_price - Get detailed pricing for specific rates
  3. book_hotel - Make a hotel reservation
  4. cancel_booking - Cancel an existing booking

Setup

1. Install Dependencies

npm install

2. Environment Configuration

Copy the example environment file and configure your API credentials:

cp env.example .env

Edit the .env file with your HotelPlanet API credentials:

# HotelPlanet API Configuration
HOTEL_API_BASE_URL=https://thehotelplanet.com/cm
HOTEL_API_KEY=your_actual_api_key_here

3. Build the Project

npm run build

4. Run the Server

For MCP (AI Agents)

npm start

For n8n (HTTP API)

npm run start:n8n

n8n Integration

This server can be used with n8n workflows via HTTP requests. The n8n version runs on port 3000 by default and provides REST API endpoints.

Available Endpoints

  • Health Check: GET http://localhost:3000/health
  • API Documentation: GET http://localhost:3000/api/docs
  • Search Availability: POST http://localhost:3000/api/search-availability
  • Check Price: POST http://localhost:3000/api/check-price
  • Book Hotel: POST http://localhost:3000/api/book-hotel
  • Cancel Booking: POST http://localhost:3000/api/cancel-booking

n8n Workflow Setup

  1. Start the server:

    npm run start:n8n
  2. In n8n, add HTTP Request nodes for each operation:

    • Set Method to POST
    • Set URL to the appropriate endpoint
    • Set Headers: Content-Type: application/json
    • Set Body to the JSON payload (see examples below)
  3. Test the connection:

    node test-n8n-server.js

n8n Response Format

All endpoints return responses in this format:

{
  "success": true,
  "data": { /* actual response data */ },
  "summary": { /* summary information */ },
  "metadata": {
    "timestamp": "2024-01-01T00:00:00.000Z",
    "request_id": "req_1234567890_abc123"
  }
}

API Endpoints

The server integrates with the following HotelPlanet API endpoints:

  • Search Availability: POST /engine/availability
  • Check Price: POST /v2/engine/v1/prebook
  • Book Hotel: POST /v2/engine/v1/bookv2
  • Cancel Booking: POST /engine/cancel

Tool Usage Examples

Search Hotel Availability

{
  "property_ids": [24517],
  "checkin": "2025-11-25",
  "checkout": "2025-11-26",
  "occupancies": [
    {
      "occupancy_index": 0,
      "adults": 2
    }
  ],
  "currency": "EUR",
  "agency": "1745",
  "max_properties": 3,
  "max_rates_per_property": 2,
  "price_range": {
    "min": 100,
    "max": 500
  },
  "star_rating": [4, 5],
  "board_types": ["Breakfast"]
}

💡 Best Practices for AI Agents:

  • Limit property_ids to 5-10 properties for best performance
  • Use max_properties (default: 5, max: 10) to control response size
  • Use max_rates_per_property (default: 3, max: 5) to limit rates shown
  • Apply filters (price_range, star_rating, board_types) to get targeted results
  • The response includes guidance for next steps (price checking, booking)

Check Price

{
  "availability_request": {
    "property_id": 23755,
    "checkin": "2025-01-13",
    "checkout": "2025-01-14",
    "occupancies": [
      {
        "occupancy_index": 0,
        "adults": 2
      }
    ],
    "currency": "USD",
    "agency": "56458",
    "nationality": "IT"
  },
  "booked_rates": [
    {
      "rate_identifier": "d14f44aa839e3d67b7bc1e6c1bce7953",
      "amount": {
        "price": 110,
        "vat": {
          "value": 0,
          "included": false
        }
      },
      "quantity": 1,
      "guest_details": [
        {
          "leader": true,
          "first_name": "Veronika Test Booking Nuitee",
          "last_name": "Surname Test Booking Nuitee"
        }
      ]
    }
  ]
}

Book Hotel

{
  "availability_request": {
    "property_id": 23755,
    "checkin": "2025-01-13",
    "checkout": "2025-01-14",
    "occupancies": [
      {
        "occupancy_index": 0,
        "adults": 2
      }
    ],
    "currency": "USD",
    "agency": "56458",
    "nationality": "IT"
  },
  "booked_rates": [
    {
      "rate_identifier": "d14f44aa839e3d67b7bc1e6c1bce7953",
      "amount": {
        "price": 110,
        "vat": {
          "value": 0,
          "included": false
        }
      },
      "quantity": 1,
      "guest_details": [
        {
          "leader": true,
          "first_name": "Veronika Test Booking Nuitee",
          "last_name": "Surname Test Booking Nuitee"
        }
      ]
    }
  ],
  "client_booking_reference": "nuitee-test-1",
  "customer_remarks": "Test Booking Nuitee",
  "payment_method": {
    "credit_card": {
      "number": "4111111111111111",
      "holder_name": "Nuitee",
      "expiration_month": 10,
      "expiration_year": 26,
      "cvv": 645
    }
  }
}

Cancel Booking

{
  "booking_id": 83314
}

Testing

Run the test suite to verify all tools are working:

node test-server.js

Development

Build

npm run build

Watch Mode

npm run dev

License

This project is licensed under the MIT License.