bj-old-mcp-cm
v2.0.2
Published
This project is an MCP (Model Context Protocol) server named `gethotelinfo`. It provides tools that can be accessed by an MCP client.
Downloads
74
Readme
Adiona MCP Server (gethotelinfo)
This project is an MCP (Model Context Protocol) server named gethotelinfo. It provides tools that can be accessed by an MCP client.
Project Structure
.
├── .gitattributes
├── .gitignore
├── package-lock.json
├── package.json
├── pnpm-lock.yaml
├── src
│ ├── server.ts # Main MCP server setup and initialization
│ └── tools
│ ├── getRoomTypes.ts # Logic for the 'get_room_types' tool
│ ├── getSupportedOtas.ts # Logic for the 'get_supported_otas' tool
│ ├── getOtaRates.ts # Logic for the 'get_ota_rates' tool
│ └── beIndividualRateUpdate.ts # Logic for the 'be_individual_rate_update' tool
└── tsconfig.json # TypeScript configurationsrc/: Contains all the TypeScript source code.src/server.ts: The main entry point for the MCP server. It initializes FastMCP, registers tools, and starts the server.src/tools/: Contains individual files for each tool provided by the server.getRoomTypes.ts: Implements theget_room_typestool, which fetches available room types for a given hotel ID.getSupportedOtas.ts: Implements theget_supported_otastool, which fetches the list of supported OTAs for a given hotel ID.getOtaRates.ts: Implements theget_ota_ratestool, which fetches OTA rates for a specific hotel, room type, and date range.beIndividualRateUpdate.ts: Implements thebe_individual_rate_updatetool, which updates individual rates.
package.json: Defines project metadata, dependencies, and scripts.tsconfig.json: Configures the TypeScript compiler options.dist/: (Generated after build) Contains the compiled JavaScript code.
Available Tools
get_room_types
- Description: Get all OTAs by room type and rate plans for a specific hotel ID.
- Parameters:
hotel_id(number): ID of the hotel.
- Returns: A JSON string containing the full API response, which includes OTA information grouped by room types and their mapped rate plans.
get_supported_otas
- Description: Get the list of supported OTAs for a specific hotel ID.
- Parameters:
hotel_id(number): ID of the hotel.
- Returns: A JSON string containing an array of OTA objects, each with
ota_name,ota_id, andlogo.
get_ota_rates
- Description: Get OTA rates for a specific hotel, room type, and date range.
- Parameters:
hotel_id(number): ID of the hotel.room_type_id(number): ID of the room type.from_date(string): Start date for fetching rates (e.g., YYYY-MM-DD).to_date(string): End date for fetching rates (e.g., YYYY-MM-DD).
- Returns: A JSON string containing the OTA rates data. (The exact structure of this data depends on the API response).
be_individual_rate_update
- Description: Update individual rates for specified OTAs, room types, and dates.
- Parameters:
hotel_id(number): ID of the hotel.ota_id(array of strings): Array of OTA IDs to update (e.g.,["-1"]).rates(array of objects): Array of rate update objects. Each object should contain:room_type_id(number): ID of the room type.room_type(string): Name/description of the room type.plan_type(string): Plan type (e.g., "EP").rate_plan_id(number): ID of the rate plan.rates(array of objects): Array of specific date rates. Each object should contain:bar_price(number): Base rate.date(string): Date for the rate (e.g., "DD-MM-YYYY").extra_adult_price(number): Price for an extra adult.extra_child_price(number): Price for an extra child.los(number): Length of stay.multiple_occupancy(array of strings): Array of occupancy-based prices.
- Returns: A JSON string containing the API response from the rate update operation.
Setup and Running
Install Dependencies:
npm install # or # pnpm install # or # yarn installBuild the Project: This command compiles the TypeScript code into JavaScript in the
distdirectory.npm run buildRun the Server: This command starts the MCP server using the compiled JavaScript.
npm run startThe server will then be accessible via STDIO transport as configured.
Development
- To make changes, edit the TypeScript files in the
srcdirectory. - After making changes, rebuild the project using
npm run build.
