Travel MCP Server
A comprehensive travel planning server for flight search, accommodation booking, currency exchange, and weather forecasting.
Travel MCP Server
A Model Context Protocol (MCP) server for comprehensive travel planning, providing flight search, accommodation booking, currency exchange, weather forecasting, and trip budget calculation capabilities.
Features
- 🛫 Flight Search: Find and compare flights with various options
- 🏨 Accommodation Search: Search for hotels, vacation rentals, and other accommodations
- 💱 Currency Exchange: Get real-time exchange rates for travel budgeting
- 🌤️ Weather Forecast: Check weather conditions for your travel dates
- 💰 Trip Budget Calculator: Calculate and plan your travel expenses
Installation
- Clone the repository:
git clone <repository-url>
cd travel-mcp-server
- Install dependencies:
npm install
- Set up environment variables:
- Copy
.env.exampleto.env - Fill in your API keys (see API Keys Setup)
- Copy
API Keys Setup
You'll need to obtain API keys from the following services:
- Flight API: Amadeus, Skyscanner, or similar flight data provider
- Accommodation API: Booking.com, Airbnb, or similar accommodation service
- Currency Exchange API: Fixer.io, ExchangeRate-API, or similar service
- Weather API: OpenWeatherMap, WeatherAPI, or similar weather service
- Google Places API: For attractions and restaurant recommendations
Update your .env file with these keys:
FLIGHT_API_KEY=your_flight_api_key
BOOKING_API_KEY=your_booking_api_key
EXCHANGE_API_KEY=your_exchange_api_key
WEATHER_API_KEY=your_weather_api_key
GOOGLE_PLACES_API_KEY=your_google_places_api_key
Usage
Development
Run the server in development mode with hot reload:
npm run dev
Production
Build and start the server:
npm run build
npm start
Watch Mode
Run with automatic restart on file changes:
npm run watch
Available Tools
The MCP server provides the following tools:
1. Search Flights (search_flights)
Search for flights between destinations with customizable options.
Parameters:
origin: Departure airport/citydestination: Arrival airport/citydepartureDate: Departure datereturnDate: Return date (optional for one-way)passengers: Number of passengersclass: Flight class (economy, business, first)
2. Search Accommodation (search_accommodation)
Find hotels, vacation rentals, and other accommodation options.
Parameters:
destination: City or locationcheckIn: Check-in datecheckOut: Check-out dateguests: Number of guestsrooms: Number of roomstype: Accommodation type (hotel, apartment, etc.)
3. Get Exchange Rate (get_exchange_rate)
Get current exchange rates between currencies.
Parameters:
from: Source currency code (e.g., USD)to: Target currency code (e.g., EUR)amount: Amount to convert (optional)
4. Get Weather Forecast (get_weather_forecast)
Check weather conditions for your travel destination.
Parameters:
location: City or locationdate: Date for forecastdays: Number of days to forecast (optional)
5. Calculate Trip Budget (calculate_trip_budget)
Calculate estimated trip costs including flights, accommodation, and daily expenses.
Parameters:
destination: Travel destinationduration: Trip duration in daystravelers: Number of travelerscategory: Budget category (budget, mid-range, luxury)
Project Structure
travel-mcp-server/
├── src/
│ ├── index.ts # Main server entry point
│ └── services/
│ ├── FlightService.ts # Flight search functionality
│ ├── AccommodationService.ts # Accommodation search
│ ├── CurrencyService.ts # Currency exchange
│ └── WeatherService.ts # Weather forecasting
├── dist/ # Compiled TypeScript output
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── .env # Environment variables (not in repo)
├── .gitignore # Git ignore rules
└── README.md # This file
Integration with MCP Clients
This server can be used with any MCP-compatible client such as:
- Claude Desktop
- Other AI assistants supporting MCP
- Custom MCP client applications
Add the server to your MCP client configuration:
{
"mcpServers": {
"travel-planner": {
"command": "npx",
"args": ["travel-mcp-server"]
}
}
}
Development Guide
Tech Stack
- TypeScript: Type-safe JavaScript development
- Node.js: Runtime environment
- MCP SDK: Model Context Protocol implementation
- Axios: HTTP client for API requests
- Zod: Schema validation
- dotenv: Environment variable management
Adding New Services
- Create a new service class in
src/services/ - Implement the required methods
- Register the service in
src/index.ts - Add corresponding tools and handlers
Running Tests
npm test
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run tests:
npm test - Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
License
This project is licensed under the ISC License - see the LICENSE file for details.
Support
If you encounter any issues or have questions:
- Check the Issues section
- Create a new issue with detailed information
- Provide logs and reproduction steps
Roadmap
- Add more travel service integrations
- Implement caching for API responses
- Add travel itinerary planning
- Support for group travel coordination
- Integration with calendar services
- Mobile app companion
Note: Remember to keep your API keys secure and never commit them to version control. Always use environment variables for sensitive configuration.
相關伺服器
KoGrammar
A Korean grammar and spelling checker powered by the Nara Infotech API.
Confluence MCP Server
Programmatically access and search Confluence spaces, pages, and content using its REST API.
MCP Personal
A collection of MCP servers for various personal productivity tools and utilities.
Brandfolio - Make Your Brand Machine-Readable for AI
Your brand deserves consistency across every AI interaction. Brandfolio transforms your brand identity into a format that works with AI on every platform.
PocketMCP
Turn your Android phone into an MCP (Model Context Protocol) server. AI agents and desktop scripts can call your phone for live data and actions over LAN
Atlassian Confluence
Interact with Atlassian Confluence Cloud spaces, pages, and content in real-time.
Chatvolt Agent Server
A simple notes system with resources, tools, and prompts.
Google MCP Tools
Integrate Google services like Gmail, Calendar, Drive, and Tasks with MCP.
zuckerbot-mcp
Run Facebook ad campaigns from any AI agent. Generate ads, research competitors, analyze markets, and launch Meta campaigns via API.
Todoist
Manage tasks and projects on Todoist using natural language.