📝 Architecture write-up & engineer's notes: tanayshah.dev/projects/travel-mcp-server/ — by Tanay Shah, AI engineer in NYC.
Travel MCP Server
An MCP server that gives AI assistants real-time access to flights, hotels, and weather data.
Why I Built This
I wanted to see if I could make Claude actually useful for travel planning - not just chatting about trips, but actually searching flights, comparing hotel prices, and checking weather forecasts. The Model Context Protocol (MCP) makes this possible by letting AI assistants call external tools.
The hard part wasn't the MCP integration - it was getting reliable travel data. Google Flights blocks scrapers aggressively, so flights fall back to sample data. Booking.com is more forgiving, so hotel scraping actually works. Weather uses Open-Meteo's free API which just works.
What It Does
| Tool | Data Source | Status |
|---|---|---|
get_latest_flight_data | Google Flights (via fast-flights) | Sample data fallback |
get_latest_hotel_data | Booking.com (Playwright scraper) | Live scraping |
get_weather_on_dates | Open-Meteo API | Live API |
Quick Start
# Install
pip install -e .
playwright install chromium
# Start MongoDB
docker run -d --name mongodb -p 27017:27017 mongo:latest
# Test it
travel-mcp test weather --city Paris --start 2025-06-15
travel-mcp test hotels --city "New York"
travel-mcp test flights --from JFK --to LAX --date 2025-06-15
Use with Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"travel": {
"command": "travel-mcp",
"args": ["serve"]
}
}
}
Then ask Claude things like:
- "Find me hotels in Tokyo under $200/night"
- "What's the weather like in Paris next week?"
- "Search flights from JFK to LAX"
CLI Commands
travel-mcp serve # Run MCP server
travel-mcp test flights ... # Test flight search
travel-mcp test hotels ... # Test hotel search
travel-mcp test weather ... # Test weather search
travel-mcp cache stats # View cache statistics
travel-mcp cache clear # Clear cached data
Architecture
Claude Desktop
↓ (MCP protocol)
Travel MCP Server
↓
┌────────────┬─────────────┬──────────────┐
│ Flights │ Hotels │ Weather │
│ fast-flights│ Playwright │ Open-Meteo │
└────────────┴─────────────┴──────────────┘
↓ ↓ ↓
MongoDB (cache layer)
Tech Stack
- Python 3.11+ with asyncio
- MCP SDK for Claude integration
- Playwright for browser automation
- MongoDB for caching with TTL indexes
- Typer for CLI
- Loguru for logging
License
MIT