Travel MCP Server

Travel MCP Server

Enables comprehensive travel planning by providing tools for flight and accommodation searches, real-time currency exchange, and weather forecasting. It also allows users to calculate estimated trip budgets based on destination, duration, and traveler preferences.

Category
访问服务器

README

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

  1. Clone the repository:
git clone <repository-url>
cd travel-mcp-server
  1. Install dependencies:
npm install
  1. Set up environment variables:
    • Copy .env.example to .env
    • Fill in your API keys (see API Keys Setup)

API Keys Setup

You'll need to obtain API keys from the following services:

  1. Flight API: Amadeus, Skyscanner, or similar flight data provider
  2. Accommodation API: Booking.com, Airbnb, or similar accommodation service
  3. Currency Exchange API: Fixer.io, ExchangeRate-API, or similar service
  4. Weather API: OpenWeatherMap, WeatherAPI, or similar weather service
  5. 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/city
  • destination: Arrival airport/city
  • departureDate: Departure date
  • returnDate: Return date (optional for one-way)
  • passengers: Number of passengers
  • class: Flight class (economy, business, first)

2. Search Accommodation (search_accommodation)

Find hotels, vacation rentals, and other accommodation options.

Parameters:

  • destination: City or location
  • checkIn: Check-in date
  • checkOut: Check-out date
  • guests: Number of guests
  • rooms: Number of rooms
  • type: 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 location
  • date: Date for forecast
  • days: 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 destination
  • duration: Trip duration in days
  • travelers: Number of travelers
  • category: 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

  1. Create a new service class in src/services/
  2. Implement the required methods
  3. Register the service in src/index.ts
  4. Add corresponding tools and handlers

Running Tests

npm test

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Run tests: npm test
  5. Commit your changes: git commit -m 'Add feature'
  6. Push to the branch: git push origin feature-name
  7. 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:

  1. Check the Issues section
  2. Create a new issue with detailed information
  3. 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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选