### Configure API Key Source: https://github.com/longcreat/aigohotel-mcp/blob/main/README.md Commands to copy the example environment file and instructions to edit it with your AIGOHOTEL_API_KEY. The API key must start with 'mcp_'. ```bash # Windows (复制文件) copy .env.example .env # Linux/Mac (复制文件) cp .env.example .env ``` ```env AIGOHOTEL_API_KEY=mcp_your_actual_api_key_here ``` -------------------------------- ### Install and Configure AigoHotel MCP Server Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Steps to set up the AigoHotel MCP Server, including virtual environment creation, dependency installation, API key configuration, and service startup. ```bash # 创建并激活虚拟环境 python -m venv venv source venv/bin/activate # Linux/Mac # venv\Scripts\activate # Windows # 安装依赖 pip install -r requirements.txt # 配置 API Key cp .env.example .env # 编辑 .env,填写你的 API Key(必须以 mcp_ 开头) # AIGOHOTEL_API_KEY=mcp_your_actual_api_key_here # 启动服务 python server.py ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/longcreat/aigohotel-mcp/blob/main/README.md Commands to set up a Python virtual environment and install project dependencies using pip. Ensure you activate the virtual environment before installing. ```bash # 创建虚拟环境 python -m venv venv # 激活虚拟环境 # Windows: venv\Scripts\activate # Linux/Mac: source venv/bin/activate # 安装依赖包 pip install -r requirements.txt ``` -------------------------------- ### Start AigoHotel MCP Server Source: https://github.com/longcreat/aigohotel-mcp/blob/main/README.md Command to launch the AigoHotel MCP Server. Successful startup displays server endpoint and API key status. ```bash python server.py ``` -------------------------------- ### Expected Server Startup Output Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt The expected output when the AigoHotel MCP Server starts successfully, indicating the listening address and authentication methods. ```text AigoHotel MCP Server 启动中... 认证方式: 从请求 header 中读取 Authorization / X-Secret-Key INFO: Uvicorn running on http://127.0.0.1:8000 ``` -------------------------------- ### Search Hotels Request Parameters Source: https://github.com/longcreat/aigohotel-mcp/blob/main/README.md Example JSON payload for searching hotels in Seattle. Requires 'place' and 'placeType'. ```json { "place": "西雅图", "placeType": "城市" } ``` -------------------------------- ### Search Hotels using AigoHotel MCP Server Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Python example demonstrating how to call the `searchHotels` tool via the MCP server using httpx. Requires API key in the Authorization header. ```python import asyncio import httpx MCP_URL = "http://localhost:8000/mcp" API_KEY = "mcp_your_api_key" # 示例1:搜索上海迪士尼附近高星酒店(带入住日期与标签筛选) payload = { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "searchHotels", "arguments": { "originQuery": "上海迪士尼附近有游泳池的五星级酒店,2025年8月1日入住2晚", "place": "上海迪士尼乐园", "placeType": "景点", "checkInParam": { "checkInDate": "2025-08-01", "stayNights": 2, "adultCount": 2 }, "filterOptions": { "distanceInMeter": 3000, "starRatings": [4.5, 5.0] }, "hotelTags": { "requiredTags": ["游泳池"], "preferredTags": ["亲子友好", "免费早餐"], "maxPricePerNight": 2000 }, "size": 5 } } } # 示例2:搜索东京新宿区酒店(不限星级) payload_2 = { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "searchHotels", "arguments": { "originQuery": "东京新宿区酒店", "place": "东京新宿区", "placeType": "区/县", "countryCode": "JP", "checkInParam": { "checkInDate": "2025-09-10", "stayNights": 3, "adultCount": 1 }, "size": 10 } } } async def search(): headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"} async with httpx.AsyncClient() as client: resp = await client.post(MCP_URL, json=payload, headers=headers) result = resp.json() hotels = result["result"]["content"][0]["text"] print(hotels) # 预期返回结构(JSON字符串): # [ # { # "hotelId": 123456, # "name": "上海迪士尼乐园大酒店", # "starRating": 5.0, # "price": 1580.0, # "currency": "CNY", # "address": "上海市浦东新区川沙新镇", # "latitude": 31.144, # "longitude": 121.666, # "bookingUrl": "https://...", # "tags": ["游泳池", "亲子友好"], # "score": 9.2 # }, # ... # ] asyncio.run(search()) ``` -------------------------------- ### Query Hotel Details using AigoHotel MCP Server Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Python example for calling the `getHotelDetail` tool via the MCP server. It demonstrates querying by `hotelId` and specifies dates, occupancy, and locale parameters. Requires API key in the Authorization header. ```python import asyncio import httpx MCP_URL = "http://localhost:8000/mcp" API_KEY = "mcp_your_api_key" # 通过 hotelId 查询(精确,推荐) payload = { "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "getHotelDetail", "arguments": { "hotelId": 123456, "dateParam": { "checkInDate": "2025-08-01", "checkOutDate": "2025-08-03" }, "occupancyParam": { "adultCount": 2, "childCount": 1, "childAgeDetails": [5], "roomCount": 1 }, "localeParam": { "countryCode": "CN", "currency": "CNY" } } } } ``` -------------------------------- ### Search High-Rated Hotels Near Landmark Source: https://github.com/longcreat/aigohotel-mcp/blob/main/README.md Example JSON payload for searching high-rated hotels near Buckingham Palace, specifying check-in date and star ratings. Requires 'place' and 'placeType'. ```json { "place": "白金汉宫", "placeType": "景点", "checkIn": "2026-01-01", "starRatings": [4.5, 5.0] } ``` -------------------------------- ### MCP Client Configuration Source: https://github.com/longcreat/aigohotel-mcp/blob/main/README.md JSON configuration to add to your MCP client's configuration file to connect to the AigoHotel server. ```json { "mcpServers": { "aigohotel": { "url": "http://localhost:8000/mcp" } } } ``` -------------------------------- ### Define Data Models for Hotel Search Parameters Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Utilize Pydantic models for defining core input parameters for hotel search and detail retrieval. These models ensure data validation and structure for API requests. ```python from aigohotel_mcp.models import ( CheckInParam, # searchHotels 入住参数 FilterOptions, # searchHotels 基础筛选 HotelTags, # searchHotels 标签筛选 DateParam, # getHotelDetail 日期参数 OccupancyParam, # getHotelDetail 入住人数 LocaleParam, # getHotelDetail 区域与币种 ) # CheckInParam check_in = CheckInParam(checkInDate="2025-08-01", stayNights=2, adultCount=2) # FilterOptions filters = FilterOptions(distanceInMeter=3000, starRatings=[4.0, 5.0]) # HotelTags(软/硬约束组合) tags = HotelTags( requiredTags=["游泳池"], # 硬约束:必须命中 preferredTags=["亲子友好"], # 软约束:影响排序 excludedTags=["仅限成人"], # 排除:命中则过滤 preferredBrands=["万豪", "希尔顿"], maxPricePerNight=1500.0, minRoomSize=30.0 ) # DateParam(getHotelDetail 使用) date = DateParam(checkInDate="2025-08-01", checkOutDate="2025-08-03") # OccupancyParam occupancy = OccupancyParam(adultCount=2, childCount=2, childAgeDetails=[3, 7], roomCount=1) # LocaleParam locale = LocaleParam(countryCode="CN", currency="CNY") ``` -------------------------------- ### Query Hotel Details by Name Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Use this snippet to retrieve hotel details when the hotelId is unknown, performing a fuzzy match based on the hotel name. Ensure API_KEY and MCP_URL are correctly configured. ```python payload_by_name = { "jsonrpc": "2.0", "id": 4, "method": "tools/call", "params": { "name": "getHotelDetail", "arguments": { "name": "上海迪士尼乐园大酒店", "dateParam": { "checkInDate": "2025-08-01", "checkOutDate": "2025-08-02" }, "localeParam": { "countryCode": "US", "currency": "USD" } } } } async def get_detail(): headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"} async with httpx.AsyncClient() as client: resp = await client.post(MCP_URL, json=payload, headers=headers) result = resp.json() detail = result["result"]["content"][0]["text"] print(detail) asyncio.run(get_detail()) ``` -------------------------------- ### getHotelDetail Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Retrieves real-time room availability, pricing details, and cancellation policies for a specified hotel. This is useful for secondary price checks after a user has selected a hotel. Hotels can be identified by `hotelId` (recommended, obtained from `searchHotels`) or by hotel `name` (for fuzzy matching). Supports specifying check-in/out dates, occupancy, number of rooms, and currency. ```APIDOC ## getHotelDetail ### Description Retrieves real-time room availability, pricing details, and cancellation policies for a specified hotel. This is useful for secondary price checks after a user has selected a hotel. Hotels can be identified by `hotelId` (recommended, obtained from `searchHotels`) or by hotel `name` (for fuzzy matching). Supports specifying check-in/out dates, occupancy, number of rooms, and currency. ### Method POST ### Endpoint /mcp ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, should be "2.0" - **id** (integer) - Required - Request ID - **method** (string) - Required - Should be "tools/call" - **params** (object) - Required - **name** (string) - Required - Tool name, should be "getHotelDetail" - **arguments** (object) - Required - **hotelId** (integer) - Required - Unique identifier for the hotel (recommended). - **dateParam** (object) - Required - Date parameters for the stay. - **checkInDate** (string) - Required - The check-in date in YYYY-MM-DD format. - **checkOutDate** (string) - Required - The check-out date in YYYY-MM-DD format. - **occupancyParam** (object) - Optional - Occupancy details. - **adultCount** (integer) - Optional - Number of adults. - **childCount** (integer) - Optional - Number of children. - **childAgeDetails** (array) - Optional - Ages of children. - **roomCount** (integer) - Optional - Number of rooms. - **localeParam** (object) - Optional - Locale and currency settings. - **countryCode** (string) - Optional - ISO 3166-1 alpha-2 country code. - **currency** (string) - Optional - Currency code (e.g., "CNY"). ### Request Example ```json { "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "getHotelDetail", "arguments": { "hotelId": 123456, "dateParam": { "checkInDate": "2025-08-01", "checkOutDate": "2025-08-03" }, "occupancyParam": { "adultCount": 2, "childCount": 1, "childAgeDetails": [5], "roomCount": 1 }, "localeParam": { "countryCode": "CN", "currency": "CNY" } } } } ``` ### Response (Response structure not detailed in the source text, but would typically include room types, prices, and policies.) ``` -------------------------------- ### searchHotels Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Searches for hotels globally based on various criteria such as location, dates, star rating, distance, and tags. It returns a list of candidate hotels and their minimum prices. The `originQuery` parameter can be used for semantic sorting, while `place` and `placeType` define the search scope. `hotelTags` allow for advanced filtering including brand preferences, soft/hard constraints, and price budgets. ```APIDOC ## searchHotels ### Description Searches for hotels globally based on various criteria such as location, dates, star rating, distance, and tags. It returns a list of candidate hotels and their minimum prices. The `originQuery` parameter can be used for semantic sorting, while `place` and `placeType` define the search scope. `hotelTags` allow for advanced filtering including brand preferences, soft/hard constraints, and price budgets. ### Method POST ### Endpoint /mcp ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, should be "2.0" - **id** (integer) - Required - Request ID - **method** (string) - Required - Should be "tools/call" - **params** (object) - Required - **name** (string) - Required - Tool name, should be "searchHotels" - **arguments** (object) - Required - **originQuery** (string) - Optional - User's original natural language query for semantic sorting. - **place** (string) - Required - The location to search within. - **placeType** (string) - Required - The type of the place (e.g., "景点", "区/县"). - **checkInParam** (object) - Optional - Parameters for check-in date and stay duration. - **checkInDate** (string) - Required - The check-in date in YYYY-MM-DD format. - **stayNights** (integer) - Required - The number of nights to stay. - **adultCount** (integer) - Optional - Number of adults. - **childCount** (integer) - Optional - Number of children. - **childAgeDetails** (array) - Optional - Ages of children. - **filterOptions** (object) - Optional - Filtering options. - **distanceInMeter** (integer) - Optional - Maximum distance in meters from the specified place. - **starRatings** (array) - Optional - Array of desired star ratings (e.g., [4.5, 5.0]). - **hotelTags** (object) - Optional - Advanced filtering tags. - **requiredTags** (array) - Optional - List of tags that must be present. - **preferredTags** (array) - Optional - List of tags that are preferred. - **maxPricePerNight** (number) - Optional - Maximum price per night. - **size** (integer) - Optional - Number of results to return. - **countryCode** (string) - Optional - ISO 3166-1 alpha-2 country code. ### Request Example ```json { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "searchHotels", "arguments": { "originQuery": "上海迪士尼附近有游泳池的五星级酒店,2025年8月1日入住2晚", "place": "上海迪士尼乐园", "placeType": "景点", "checkInParam": { "checkInDate": "2025-08-01", "stayNights": 2, "adultCount": 2 }, "filterOptions": { "distanceInMeter": 3000, "starRatings": [4.5, 5.0] }, "hotelTags": { "requiredTags": ["游泳池"], "preferredTags": ["亲子友好", "免费早餐"], "maxPricePerNight": 2000 }, "size": 5 } } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC version. - **id** (integer) - Request ID. - **result** (object) - **content** (array) - **text** (string) - A JSON string representing the list of hotels found. Each hotel object may contain: - **hotelId** (integer) - Unique identifier for the hotel. - **name** (string) - Name of the hotel. - **starRating** (number) - Star rating of the hotel. - **price** (number) - Lowest available price per night. - **currency** (string) - Currency of the price. - **address** (string) - Address of the hotel. - **latitude** (number) - Latitude coordinate. - **longitude** (number) - Longitude coordinate. - **bookingUrl** (string) - URL for booking. - **tags** (array) - List of tags associated with the hotel. - **score** (number) - A score for the hotel. #### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "content": [ { "text": "[ { "hotelId": 123456, "name": "上海迪士尼乐园大酒店", "starRating": 5.0, "price": 1580.0, "currency": "CNY", "address": "上海市浦东新区川沙新镇", "latitude": 31.144, "longitude": 121.666, "bookingUrl": "https://...", "tags": ["游泳池", "亲子友好"], "score": 9.2 } ]" } ] } } ``` ``` -------------------------------- ### getHotelSearchTags Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Fetches metadata for hotel search tags, including facility tags, service tags, and brand names. This endpoint is recommended to be called at application startup and cached locally for use in constructing `searchHotels` parameters. ```APIDOC ## POST /tools/call ### Description Fetches metadata for hotel search tags, including facility tags, service tags, and brand names. This endpoint is recommended to be called at application startup and cached locally for use in constructing `searchHotels` parameters. This is a GET request, but implemented as a POST to the `/tools/call` endpoint with the method name. ### Method POST ### Endpoint /tools/call ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, should be "2.0". - **id** (integer) - Required - Request ID. - **method** (string) - Required - The method to call, should be "tools/call". - **params** (object) - Required - Parameters for the tool call. - **name** (string) - Required - The name of the tool, should be "getHotelSearchTags". - **arguments** (object) - Required - Arguments for the "getHotelSearchTags" tool. This tool does not require any specific arguments. ### Request Example ```json { "jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": { "name": "getHotelSearchTags", "arguments": {} } } ``` ### Response #### Success Response (200) - **result** (object) - The result of the tool call. - **content** (array) - An array of content objects. - **text** (object) - The hotel search tags metadata. - **amenityTags** (array) - A list of available amenity tags (e.g., "游泳池", "健身房"). - **serviceTags** (array) - A list of available service tags (e.g., "24小时前台", "机场接送"). - **brands** (array) - A list of supported hotel brands (e.g., "万豪", "希尔顿"). #### Response Example ```json { "amenityTags": ["游泳池", "健身房", "免费WiFi", "免费早餐", "停车场", "水疗中心"], "serviceTags": ["24小时前台", "机场接送", "亲子友好", "宠物友好"], "brands": ["万豪", "希尔顿", "洲际", "香格里拉", "四季"] } ``` ``` -------------------------------- ### Fetch Hotel Search Tags Metadata Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Retrieve a comprehensive list of hotel search tags, including amenities, services, and brands. This is recommended to be called at AI application startup and cached locally for parsing user intent. ```python import asyncio import httpx MCP_URL = "http://localhost:8000/mcp" API_KEY = "mcp_your_api_key" payload = { "jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": { "name": "getHotelSearchTags", "arguments": {} } } async def get_tags(): headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"} async with httpx.AsyncClient() as client: resp = await client.post(MCP_URL, json=payload, headers=headers) result = resp.json() tags = result["result"]["content"][0]["text"] print(tags) asyncio.run(get_tags()) ``` -------------------------------- ### getHotelDetail Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Retrieves detailed information for a specific hotel using its name. This method supports fuzzy matching and is useful when a hotelId is not available. It requires parameters like hotel name, check-in/out dates, and locale information. ```APIDOC ## POST /tools/call ### Description Retrieves detailed information for a specific hotel using its name. This method supports fuzzy matching and is useful when a hotelId is not available. It requires parameters like hotel name, check-in/out dates, and locale information. ### Method POST ### Endpoint /tools/call ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, should be "2.0". - **id** (integer) - Required - Request ID. - **method** (string) - Required - The method to call, should be "tools/call". - **params** (object) - Required - Parameters for the tool call. - **name** (string) - Required - The name of the tool, should be "getHotelDetail". - **arguments** (object) - Required - Arguments for the "getHotelDetail" tool. - **name** (string) - Required - The name of the hotel to search for (fuzzy match). - **dateParam** (object) - Required - Date parameters for the search. - **checkInDate** (string) - Required - The check-in date in YYYY-MM-DD format. - **checkOutDate** (string) - Required - The check-out date in YYYY-MM-DD format. - **localeParam** (object) - Required - Locale parameters for the search. - **countryCode** (string) - Required - The country code (e.g., "US"). - **currency** (string) - Required - The currency code (e.g., "USD"). ### Request Example ```json { "jsonrpc": "2.0", "id": 4, "method": "tools/call", "params": { "name": "getHotelDetail", "arguments": { "name": "上海迪士尼乐园大酒店", "dateParam": { "checkInDate": "2025-08-01", "checkOutDate": "2025-08-02" }, "localeParam": { "countryCode": "US", "currency": "USD" } } } } ``` ### Response #### Success Response (200) - **result** (object) - The result of the tool call. - **content** (array) - An array of content objects. - **text** (object) - The detailed hotel information. - **hotelId** (integer) - The unique identifier for the hotel. - **name** (string) - The name of the hotel. - **rooms** (array) - A list of available rooms. - **roomType** (string) - The type of the room. - **price** (number) - The price of the room. - **tax** (number) - The tax amount for the room. - **currency** (string) - The currency of the price. - **available** (boolean) - Indicates if the room is available. - **cancellationPolicy** (string) - The cancellation policy for the room. - **breakfastIncluded** (boolean) - Indicates if breakfast is included. #### Response Example ```json { "hotelId": 123456, "name": "上海迪士尼乐园大酒店", "rooms": [ { "roomType": "豪华湖景大床房", "price": 1680.0, "tax": 168.0, "currency": "CNY", "available": true, "cancellationPolicy": "入住前72小时免费取消", "breakfastIncluded": true } ] } ``` ``` -------------------------------- ### search_hotels Source: https://github.com/longcreat/aigohotel-mcp/blob/main/README.md Queries global hotel information based on various criteria such as location, star rating, and dates. Returns a list of hotels in JSON format. ```APIDOC ## search_hotels ### Description Queries global hotel information based on various criteria such as location, star rating, and dates. Returns a list of hotels in JSON format. ### Method POST ### Endpoint /search_hotels ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **place** (string) - Required - Destination (city, attraction, hotel, transport hub, landmark, etc.) - **placeType** (string) - Required - Type of destination (city, district/county, airport, train station, hotel, attraction, etc.) - **originalQuery** (string) - Optional - The user's original query sentence - **checkIn** (string) - Optional - Check-in date, format yyyy-MM-dd, defaults to the next day - **stayNights** (int) - Optional - Number of nights to stay, defaults to 1 - **starRatings** (array) - Optional - Hotel star rating range, e.g., [4.5, 5.0], defaults to [0.0, 5.0] - **adultCount** (int) - Optional - Number of adults per room, defaults to 2 - **distanceInMeter** (int) - Optional - Distance in meters from the attraction, defaults to 5000 - **size** (int) - Optional - Number of results to return, defaults to 10, maximum 20 - **withHotelAmenities** (bool) - Optional - Whether to include hotel amenities, defaults to true - **withRoomAmenities** (bool) - Optional - Whether to include room amenities, defaults to true - **language** (string) - Optional - Language environment (zh_CN, en_US, etc.), defaults to zh_CN - **queryParsing** (bool) - Optional - Whether to analyze user personalized needs, defaults to true ### Request Example ```json { "place": "西雅图", "placeType": "城市" } ``` ### Response #### Success Response (200) - **hotelId** (string) - Hotel ID - **name** (string) - Hotel name - **address** (string) - Hotel location - **destinationId** (string) - Destination ID - **latitude** (float) - Latitude - **longitude** (float) - Longitude - **starRating** (float) - Star rating - **bookingUrl** (string) - Hotel booking details page URL - **description** (string) - Hotel description - **imageUrl** (string) - Hotel main image URL - **areaCode** (string) - Country code - **price** (float) - Price - **hotelAmenities** (array) - Hotel amenities - **hotelRoomAmenities** (array) - Room amenities - **tags** (array) - Hotel personalized tags - **score** (string) - Personalized score - **currency** (string) - Currency #### Response Example ```json { "hotelId": "string", "name": "string", "address": "string", "destinationId": "string", "latitude": 30.665025, "longitude": 104.066475, "starRating": 5.0, "bookingUrl": "string", "description": "string", "imageUrl": "string", "areaCode": "string", "price": 549.0, "hotelAmenities": [ "咖啡厅咖啡厅", "会议厅会议室" ], "hotelRoomAmenities": [], "tags": [], "score": "string", "currency": "CNY" } ``` ``` -------------------------------- ### getHotelSearchTags Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt Fetches metadata for hotel search tags, providing available options for filtering and refining hotel searches. This includes information on brands, amenities, and other searchable attributes. ```APIDOC ## getHotelSearchTags ### Description Fetches metadata for hotel search tags, providing available options for filtering and refining hotel searches. This includes information on brands, amenities, and other searchable attributes. ### Method POST ### Endpoint /mcp ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, should be "2.0" - **id** (integer) - Required - Request ID - **method** (string) - Required - Should be "tools/call" - **params** (object) - Required - **name** (string) - Required - Tool name, should be "getHotelSearchTags" - **arguments** (object) - Required - No specific arguments are detailed in the source for this tool. ### Request Example ```json { "jsonrpc": "2.0", "id": 4, "method": "tools/call", "params": { "name": "getHotelSearchTags", "arguments": {} } } ``` ### Response (Response structure not detailed in the source text, but would typically include a list of available search tags and their properties.) ``` -------------------------------- ### Extract API Key from Request Headers Source: https://context7.com/longcreat/aigohotel-mcp/llms.txt This function automatically extracts API keys from incoming HTTP request headers, supporting both 'Authorization: Bearer ' and 'X-Secret-Key: ' formats. It raises an exception if called outside an HTTP context or if the key is missing. ```bash # 合法请求 header 示例(curl) # 方式1:Bearer Token curl -X POST http://localhost:8000/mcp \ -H "Authorization: Bearer mcp_your_api_key" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getHotelSearchTags","arguments":{}}}' # 方式2:X-Secret-Key curl -X POST http://localhost:8000/mcp \ -H "X-Secret-Key: mcp_your_api_key" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getHotelSearchTags","arguments":{}}}' # 未传 API Key 时返回错误: # {"error": "未提供 API Key,请在请求 header 中添加 Authorization: Bearer "} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.