
This is a Model Context Protocol (MCP) server that connects to the Amadeus API to provide flight search, booking, and analysis capabilities for AI assistants.
概览
This is a Model Context Protocol (MCP) server that connects to the Amadeus API to provide flight search, booking, and analysis capabilities for AI assistants. - : Find flights between airports with various parameters - : Search for airports by keyword, city, or country - : Get price metrics for routes to determine if current prices are high or low - : Find the most economical dates to travel - : Get detailed information about specific flight offers The server provides several pre-configured prompts for common travel planning scenarios: 1. (analyze-flight-prices): Analyze flight prices for a route with insights on pricing trends 2. (find-best-deals): Find the best flight deals for a specific route and date 3. (plan-multi-city-trip): Plan a complete multi-city itinerary with optimal routing 4. (find-cheapest-travel-dates): Identify the most economical dates to travel - Node.js 16.x or higher - Amadeus API credentials (Client ID and Secret) 3. Create a .
README
以下为原文 README 节选,完整内容请查看原文。
Amadeus MCP Server
This is a Model Context Protocol (MCP) server that connects to the Amadeus API to provide flight search, booking, and analysis capabilities for AI assistants.
Features
- Flight Search: Find flights between airports with various parameters
- Airport Information: Search for airports by keyword, city, or country
- Price Analysis: Get price metrics for routes to determine if current prices are high or low
- Cheapest Dates: Find the most economical dates to travel
- Flight Details: Get detailed information about specific flight offers
Prompts
The server provides several pre-configured prompts for common travel planning scenarios:
- Analyze Flight Prices (
analyze-flight-prices): Analyze flight prices for a route with insights on pricing trends - Find Best Deals (
find-best-deals): Find the best flight deals for a specific route and date - Plan Multi-City Trip (
plan-multi-city-trip): Plan a complete multi-city itinerary with optimal routing - Find Cheapest Travel Dates (
find-cheapest-travel-dates): Identify the most economical dates to travel
Setup
Prerequisites
- Node.js 16.x or higher
- Amadeus API credentials (Client ID and Secret)
Installation
- Clone the repository:
git clone https://github.com/yourusername/amadeus-mcp-server.git
cd amadeus-mcp-server
- Install dependencies:
npm install
- Create a
.envfile in the root directory with your Amadeus API credentials:
AMADEUS_CLIENT_ID=your_client_id
AMADEUS_CLIENT_SECRET=your_client_secret
Running the Server
Build and start the server:
npm run build
npm start
For development:
npm run dev
Testing and Development
This project uses Jest for testing and Biome for linting and formatting.
Run unit tests:
npx jest
Run tests with watch mode:
npx jest --watch
Run tests with coverage:
npx jest --coverage
Run integration tests (requires Amadeus API credentials):
npm run test:integration
Run linting:
npm run lint
Format code:
npm run format
Integration Testing
The project includes comprehensive integration tests that verify the server’s interaction with the real Amadeus API. These tests help ensure that our API clients work correctly with the actual API endpoints and handle responses appropriately.
Requirements for Integration Tests
-
Amadeus API Credentials: Tests require valid Amadeus API credentials in the
.envfile:AMADEUS_CLIENT_ID=your_client_id AMADEUS_CLIENT_SECRET=your_client_secret -
Test Environment: Tests are configured to use the Amadeus Test Environment, not the production API.
Running Integration Tests
npm run test:integration
The integration tests are located in __tests__/integration and validate the following API features:
- Airport Search: Searching for airports by code or keyword
安装
npx jest