hut-reservation-mcp
Enables searching SAC huts, checking availability, and preparing booking or cancellation handoffs on hut-reservation.org with a safety model for writes.
README
hut-reservation MCP
Local-first Model Context Protocol (MCP) server for searching SAC huts, checking availability, and preparing booking or cancellation handoffs on hut-reservation.org.
The server is designed for agent use over stdio. It keeps high-risk upstream writes conservative by default: booking and cancellation confirmation tools prepare browser handoffs unless experimental writes are explicitly enabled.
Capabilities
- Search huts by country, canton cache, text, and distance around coordinates.
- Refresh the hut catalog from
hutsListplushutInfo. - Refresh canton and country area data through an explicitly configured Nominatim-compatible reverse geocoder.
- Search exact-period availability using
YYYY-MM-DDat the MCP boundary and the upstream SwissDD.MM.YYYYformat internally. - Report catalog, area-cache, geocoder, and draft-cache readiness through
auth_status. - Create safe booking and cancellation drafts.
- List reservations through the authenticated
myReservationsendpoint.
Safety model
Headless booking and confirmed-reservation cancellation are intentionally conservative. The public SPA exposes preBook, submit, myReservations, reservationSummary, delete/{id}, and partial-cancellation-fee endpoints, but the complete booking form payload is not documented.
By default, confirmation tools return a browser handoff URL instead of performing writes. Experimental writes require both:
HUT_RESERVATION_EXPERIMENTAL_WRITES=true- A caller-supplied raw payload
Treat session cookies, XSRF tokens, passwords, and raw booking payloads as bearer credentials. Keep them in ignored local files, your MCP client environment configuration, or a secret manager. Do not commit them.
Prerequisites
- Node.js and pnpm.
- A local checkout of this repository.
- Optional: a
hut-reservation.orgaccount or SAC browser session for authenticated reservation tools. - Optional: a Nominatim-compatible reverse geocoder for canton and country area-cache refreshes.
Quick start
Install dependencies:
pnpm install
Run locally over stdio:
pnpm dev
MCP clients should spawn the server rather than connect to an already-running shell process:
pnpm --dir /absolute/path/to/hut-reservation-mcp dev
For built usage, compile first and spawn the compiled entrypoint:
pnpm build
node /absolute/path/to/hut-reservation-mcp/dist/index.js
MCP client configuration
Most MCP clients accept a JSON configuration shaped like this:
{
"mcpServers": {
"hut-reservation": {
"command": "pnpm",
"args": ["--dir", "/absolute/path/to/hut-reservation-mcp", "dev"],
"env": {
"HUT_RESERVATION_CACHE_DIR": "$HOME/.cache/hut-reservation-mcp"
}
}
}
}
Use the built entrypoint after running pnpm build:
{
"mcpServers": {
"hut-reservation": {
"command": "node",
"args": ["/absolute/path/to/hut-reservation-mcp/dist/index.js"]
}
}
}
Codex
MCP tools are not imported into an already-running Codex turn by starting the server manually. The native workflow is:
- Register the MCP server with
codex mcp add. - Start a new Codex session, or reload the client.
- Check
/mcpin the Codex TUI and then ask Codex to use the hut-reservation tools.
For local checkout development, register the source-backed command so MCP sessions run the current TypeScript source:
codex mcp add hut-reservation -- pnpm --dir /absolute/path/to/hut-reservation-mcp dev
For this checkout:
codex mcp add hut-reservation -- pnpm --dir /Users/domwoe/Dev/projects/hut-reservation-mcp dev
Codex stores that server in config.toml. After the next session starts, the MCP tools are available natively to the model rather than through shell commands.
For built or packaged usage:
pnpm build
codex mcp add hut-reservation -- node /absolute/path/to/hut-reservation-mcp/dist/index.js
Claude Code
Use the Claude Code CLI to register the source-backed server:
claude mcp add hut-reservation -- pnpm --dir /absolute/path/to/hut-reservation-mcp dev
For this checkout:
claude mcp add hut-reservation -- pnpm --dir /Users/domwoe/Dev/projects/hut-reservation-mcp dev
For built or packaged usage:
pnpm build
claude mcp add hut-reservation -- node /absolute/path/to/hut-reservation-mcp/dist/index.js
Restart Claude Code after changing MCP configuration so the server is respawned with the updated command and environment.
Claude Desktop
Add the server to your Claude Desktop MCP configuration:
{
"mcpServers": {
"hut-reservation": {
"command": "pnpm",
"args": ["--dir", "/absolute/path/to/hut-reservation-mcp", "dev"],
"env": {
"HUT_RESERVATION_CACHE_DIR": "$HOME/.cache/hut-reservation-mcp"
}
}
}
}
For this checkout:
{
"mcpServers": {
"hut-reservation": {
"command": "pnpm",
"args": ["--dir", "/Users/domwoe/Dev/projects/hut-reservation-mcp", "dev"],
"env": {
"HUT_RESERVATION_CACHE_DIR": "$HOME/.cache/hut-reservation-mcp"
}
}
}
}
For built or packaged usage:
{
"mcpServers": {
"hut-reservation": {
"command": "node",
"args": ["/absolute/path/to/hut-reservation-mcp/dist/index.js"]
}
}
}
Restart Claude Desktop after editing the configuration file.
Configuration
The server loads .env from the current working directory before reading environment variables.
| Variable | Required | Description |
|---|---|---|
HUT_RESERVATION_DOTENV_PATH |
No | Path to a specific .env file. |
HUT_RESERVATION_DOTENV_DISABLED |
No | Set to true to disable dotenv loading. |
HUT_RESERVATION_AUTH_MODE |
No | Authentication mode. Use standard for username/password or sac for SAC browser-session cookies. |
HUT_RESERVATION_USERNAME |
No | Standard hut-reservation.org username. |
HUT_RESERVATION_PASSWORD |
No | Standard hut-reservation.org password. |
HUT_RESERVATION_SESSION_COOKIE |
No | SAC SESSION cookie value. |
HUT_RESERVATION_XSRF_TOKEN |
No | SAC XSRF-TOKEN cookie value. |
HUT_RESERVATION_COOKIE_HEADER |
No | Combined cookie header, for example SESSION=...; XSRF-TOKEN=.... |
HUT_RESERVATION_CACHE_DIR |
No | Cache directory. Defaults to the server's local cache behavior. |
HUT_RESERVATION_REQUEST_TIMEOUT_MS |
No | Upstream request timeout in milliseconds. |
HUT_RESERVATION_EXPERIMENTAL_WRITES |
No | Set to true to allow raw-payload experimental write confirmation. |
NOMINATIM_BASE_URL |
No | Base URL for a Nominatim-compatible reverse geocoder. Required before refresh_area_cache can use geocoding. |
NOMINATIM_USER_AGENT |
No | Identifying User-Agent for geocoder requests. |
NOMINATIM_EMAIL |
No | Contact email for geocoder requests, if required by the provider. |
NOMINATIM_MIN_INTERVAL_MS |
No | Minimum interval between geocoder requests. |
Standard account login
HUT_RESERVATION_AUTH_MODE=standard
HUT_RESERVATION_USERNAME=person@example.com
HUT_RESERVATION_PASSWORD=...
SAC browser-session login
HUT_RESERVATION_AUTH_MODE=sac
HUT_RESERVATION_SESSION_COOKIE=...
HUT_RESERVATION_XSRF_TOKEN=...
You can copy these values from DevTools after logging in through SAC:
Application -> Cookies -> https://www.hut-reservation.org -> SESSION and XSRF-TOKEN.
Alternatively, provide both cookies as one header:
HUT_RESERVATION_AUTH_MODE=sac
HUT_RESERVATION_COOKIE_HEADER="SESSION=...; XSRF-TOKEN=..."
Cache and timeout
HUT_RESERVATION_CACHE_DIR="$HOME/.cache/hut-reservation-mcp"
HUT_RESERVATION_REQUEST_TIMEOUT_MS=15000
Reverse geocoder
NOMINATIM_BASE_URL=https://your-nominatim.example
NOMINATIM_USER_AGENT="hut-reservation-mcp/0.1.0 you@example.com"
NOMINATIM_EMAIL=you@example.com
NOMINATIM_MIN_INTERVAL_MS=1000
The server never uses public Nominatim implicitly. Configure a base URL and identifying User-Agent before calling refresh_area_cache. Follow the provider's usage policy, cache responses, and preserve OpenStreetMap attribution.
Tools
All tool-facing dates are YYYY-MM-DD.
| Tool | Purpose | Notes |
|---|---|---|
auth_status |
Report login, catalog, geocoder, area-cache, and draft-cache readiness. | Use this first when diagnosing setup. |
refresh_hut_catalog |
Refresh cached hut metadata from upstream hut list and detail endpoints. | Run before searching if the local catalog is empty or stale. |
refresh_area_cache |
Refresh cached canton and country area data through a configured reverse geocoder. | Requires NOMINATIM_BASE_URL and identifying geocoder configuration. |
search_huts |
Search cached huts by text, country, canton, or distance around coordinates. | Canton filters depend on a refreshed area cache. |
search_hut_availability |
Search exact-period availability for matched cached huts. | Checks every matched cached hut by default. |
prepare_booking |
Create a safe booking draft. | Does not confirm the booking. |
confirm_booking |
Confirm a prepared booking or return a browser handoff URL. | Raw-payload writes require experimental writes. |
list_bookings |
List reservations through the authenticated myReservations endpoint. |
Requires authenticated upstream access. |
prepare_cancellation |
Create a safe cancellation draft. | Does not confirm cancellation. |
confirm_cancellation |
Confirm a prepared cancellation or return a browser handoff URL. | Raw-payload writes require experimental writes. |
search_hut_availability checks every matched cached hut by default. Set maxCandidates only when you intentionally want a faster partial search; partial responses include truncated, totalCandidates, checkedCandidates, and a warning.
Suggested workflows
Find huts with availability
- Call
auth_status. - If the catalog is missing or stale, call
refresh_hut_catalog. - If you need canton filters, configure the reverse geocoder and call
refresh_area_cache. - Call
search_huts. - Call
search_hut_availabilitywith ISO dates.
Prepare a booking
- Search huts and availability first.
- Call
prepare_booking. - Review the draft details.
- Call
confirm_booking. - Complete the browser handoff unless experimental writes are intentionally enabled.
Prepare a cancellation
- Authenticate with standard credentials or SAC session cookies.
- Call
list_bookings. - Call
prepare_cancellation. - Review the draft details.
- Call
confirm_cancellation. - Complete the browser handoff unless experimental writes are intentionally enabled.
Troubleshooting
auth_statusreports no catalog: runrefresh_hut_catalog.- Canton filters return nothing: configure a Nominatim-compatible geocoder and run
refresh_area_cache. - Availability searches are slow: add narrower search filters first, or set
maxCandidateswhen a partial search is acceptable. - Authenticated tools fail: verify
HUT_RESERVATION_AUTH_MODEand credential variables, then restart the MCP client so it respawns the server with the new environment. - Codex does not see the tools: restart the Codex session or reload the client after
codex mcp add, then check/mcp. - Confirmation returns a browser URL: this is expected unless
HUT_RESERVATION_EXPERIMENTAL_WRITES=trueand a raw payload are supplied.
Verification
pnpm typecheck
pnpm test
pnpm run smoke:mcp:source
pnpm build
pnpm run smoke:mcp:dist
Optional read-only live smoke test:
HUT_RESERVATION_LIVE_SMOKE=true pnpm smoke:read
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.