mcp-hotel-booking-agent
mcp-hotel-booking-agent
A hotel booking assistant built with the Model Context Protocol (MCP). A FastMCP server exposes hotel search/booking tools over stdio, and a Streamlit chat client drives an agent loop with Claude (Anthropic) to call those tools on the user's behalf.
Project structure
mcp-hotel-booking-agent/
├── server/
│ ├── mcp_server.py
│ └── data/
│ ├── hotels.json # mock data
│ └── bookings.json
├── client/
│ └── app.py
├── requirements.txt
├── .env
└── README.mdTools exposed by the MCP server
Tool | Description |
| Search hotels by city with rooms free for given dates |
| Get full details for a hotel by id |
| Check if a hotel has enough free rooms for a date range |
| Create a new booking |
| Look up a booking by id |
| Cancel an existing booking |
Setup
Create and activate a virtual environment (recommended):
python -m venv .venv .venv\Scripts\Activate.ps1Install dependencies:
pip install -r requirements.txtAdd your Anthropic API key to
.envcreate your .env file:ANTHROPIC_API_KEY=your_anthropic_api_key_here
Running
The Streamlit client launches the MCP server
streamlit run client/app.pyThen chat with the assistant, e.g.:
"Find hotels in goaunder budget 3000"
"Book the Sunset Beach Resort for John Smith, same dates, 1 room"
Optional: run the MCP server standalone
Useful for quick manual testing/debugging with an MCP inspector:
python server/mcp_server.pyNotes
server/data/hotels.jsonis static mock data;server/data/bookings.jsonis created/updated automatically as bookings are madeNever commit your real
.envfile or API key.