Skip to main content
Glama
README.md
# hoteldata

hoteldata is a small local bridge to the hosted HasData
Google Hotels MCP server, which returns Google Hotels
search results as JSON. Give it a place or a property
name together with check-in and check-out dates, and
it fetches the matching hotels and vacation rentals:
each property's name, link, location, nightly and
total rates, hotel class, guest rating and review
counts, images, amenities and nearby places, as
returned upstream. Searches can be shaped by the
guest mix (adults, plus children with their ages),
by localisation (country, language and currency),
and by a wide filter set covering price range, sort
order, property types, amenities, minimum rating,
brands, hotel class, free cancellation, special
offers, eco-certification, vacation-rental mode with
bedroom and bathroom minimums, and paging tokens.

The bridge stores no results of its own. It serves
the upstream server's tool list locally, exactly as
captured from the live endpoint, and forwards each
tool call upstream, returning the result untouched.
The captured surface is a single read-only search:
there is no booking, reservation or payment tool
in it.

## Tools

- `hasdata_google_travel_hotels_getGoogleHotels` —
  search Google Hotels for one stay. Required: `q`
  (the search query: a city, neighbourhood or hotel
  name), `checkInDate` and `checkOutDate` (both in
  `yyyy-MM-dd` form). Optional: `gl` (country),
  `hl` (language), `currency`, `adults`, `children`
  and `childrenAges` (comma-separated ages matching
  the child count), `sortBy` (`lowestPrice` /
  `highestRating` / `mostReviewed`), `minPrice` and
  `maxPrice` per night, `propertyType__` (hotel and
  rental property types), `amenity__` (hotel and
  rental amenities), `rating` (minimum guest rating),
  `brands`, `hotelClass`, `freeCancellation`,
  `specialOffers`, `ecoCertified`, `vacationRentals`,
  `bedrooms`, `bathrooms`, `nextPageToken` (paging)
  and `propertyToken` (one property's detail).
  Returns per-property rates, price comparisons,
  ratings, reviews, amenities, deals and pagination
  tokens.

## Configuration

- `HASDATA_GOOGLE_HOTELS_MCP_URL` (optional) —
  override the upstream endpoint. Defaults to
  `https://mcp.hasdata.com/mcp?apis=google_travel_hotels`.
  (The override hook is this rebuild's own labelled
  reconstruction.)
- `HASDATA_API_KEY` (optional) — when set, every
  upstream request carries an `x-api-key: <key>`
  header, for the caller's own HasData API key. When
  it is not set, no key header is sent. (The header
  name and the env name are pinned by the original's
  registry record; forwarding the key from this env
  var is a labelled reconstruction — the original
  surface was captured keyless.)

### Forwarding mechanics

On the first tool call the client opens a streamable
HTTP session with the upstream: a JSON-RPC
`initialize` request (protocolVersion `2025-03-26`,
clientInfo name `hoteldata`), then a
`notifications/initialized` notification, then the
`tools/call` request carrying the caller's arguments
unchanged. When the upstream answers `initialize`
with an `Mcp-Session-Id` header, that value rides on
every later request of the session, which is reused
for the life of the process. Replies may arrive as
plain JSON or as server-sent events; both are read.

Successful upstream results pass through verbatim,
including any `isError` flag the upstream sets.
Failures — a JSON-RPC error, a non-2xx status, an
unreadable response, or a request that cannot be
completed — come back as an `isError` result whose
text starts with `hoteldata error:` (this rendering
is this rebuild's own labelled reconstruction).

## CLI

The tool is also a subcommand taking one JSON
argument string:

```bash
npx @reneturcios/hoteldata hasdata_google_travel_hotels_getGoogleHotels '{"q":"San Francisco","checkInDate":"2026-11-10","checkOutDate":"2026-11-12","adults":2,"sortBy":"lowestPrice"}'
npx @reneturcios/hoteldata --version
```

Exit codes: `0` on success, `1` on an `isError`
result, `2` on a usage error.

## MCP server

```bash
npx -y @reneturcios/hoteldata mcp
```

MCP client config:

```json
{
  "mcpServers": {
    "hoteldata": {
      "command": "npx",
      "args": ["-y", "@reneturcios/hoteldata", "mcp"]
    }
  }
}
```

## Docker

```bash
docker run -i ghcr.io/cloudcorprecords/hoteldata
docker run --rm ghcr.io/cloudcorprecords/hoteldata --version
```

The container's default command is `mcp`, so the first
form is a stdio MCP server; any other arguments reach
the CLI normally.

## Development

```bash
npm install
npm run build
npm test
npm run dev
```

The test suite runs entirely against a stubbed
JSON-RPC upstream — no live network calls.

## License

MIT — see `LICENSE`.