loading…
Search for a command to run...
loading…
An AI-powered customer service automation system designed to handle flight disruptions by providing real-time flight status, sentiment-aware passenger communica
An AI-powered customer service automation system designed to handle flight disruptions by providing real-time flight status, sentiment-aware passenger communication, and personalized engagement activities. It streamlines rebooking, airport recommendations, and human agent handoffs to improve the passenger experience during delays.
AI-Powered Customer Service Automation for Weather-Related Flight Disruptions
Python Version FastMCP License
This project presents a Model Context Protocol (MCP) server-based system designed to reduce customer support costs for Indigo airline during weather-related flight delays. The airline operates a major hub in Mumbai with over 5,000 daily flights and faces peak support demand, long wait times, customer dissatisfaction, and high operational costs during delays.
The solution uses a microservices architecture with six specialized MCP servers coordinated by a main orchestrator:
┌─────────────────────────────────────────────────────────────┐
│ Main MCP Orchestrator │
│ (FastMCP Server - Python) │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────┼─────────────────────┐
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│Authentication│ │ Flight │ │ Mood │
│ Server │ │ Information │ │ Analysis │
│ │ │ Server │ │ Server │
└──────────────┘ └──────────────┘ └──────────────┘
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Engagement/ │ │ Itinerary/ │ │ Human │
│ Games │ │ Food │ │ Agent │
│ Server │ │ Server │ │ Transfer │
└──────────────┘ └──────────────┘ └──────────────┘
cd /path/to/your/workspace
git clone <repository-url>
cd airline-delays-mcp-server
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
-- Connect to PostgreSQL
psql -U postgres
-- Create database
CREATE DATABASE airline_delays_db;
-- Connect to database
\c airline_delays_db
-- Enable pgvector extension (if using vector operations)
CREATE EXTENSION IF NOT EXISTS vector;
Create a .env file (copy from env.example):
cp env.example .env
Edit .env with your configuration:
# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your_password
DB_NAME=airline_delays_db
# OpenAI (or use Azure/Anthropic)
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4-turbo-preview
# Server
PORT=3003
TRANSPORT=httpStream
ENVIRONMENT=development
python -c "import asyncio; from src.config.database import init_database; asyncio.run(init_database())"
python run.py
The server will start on http://localhost:3003/mcp
The MCP server exposes 6 tools that can be called by AI assistants:
authenticate_passengerAuthenticate a passenger and create a session.
{
"pnr": "ABC123",
"last_name": "Smith",
"email": "[email protected]"
}
get_flight_informationGet real-time flight status and rebooking options.
{
"flight_number": "6E-123",
"passenger_id": "P12345",
"include_alternatives": true
}
analyze_moodAnalyze passenger sentiment and get communication recommendations.
{
"session_id": "session_abc123",
"message": "This delay is completely unacceptable!",
"analyze_trend": true
}
suggest_engagementSuggest entertainment activities for delayed passengers.
{
"delay_minutes": 120,
"passenger_mood": "frustrated",
"destination": "DEL",
"activity_type": "any"
}
recommend_servicesRecommend airport/destination dining and activities.
{
"service_type": "airport_food",
"airport_code": "BOM",
"dietary_restrictions": ["vegetarian"],
"budget": "moderate"
}
transfer_to_humanTransfer to human agent with full context.
{
"session_id": "session_abc123",
"reason": "high_frustration",
"urgency": "high",
"summary": "Passenger frustrated with long delay and missed connection"
}
airline-delays-mcp-server/
├── src/
│ ├── config/
│ │ ├── __init__.py
│ │ ├── environment.py # Environment variable management
│ │ ├── database.py # PostgreSQL connection pool
│ │ └── llm.py # LLM client (OpenAI/Azure/Anthropic)
│ ├── tools/
│ │ ├── __init__.py
│ │ ├── authentication.py # Authentication Server
│ │ ├── flight_information.py # Flight Information Server
│ │ ├── mood_analysis.py # Mood Analysis Server
│ │ ├── engagement_games.py # Engagement/Games Server
│ │ ├── itinerary_food.py # Itinerary/Food Server
│ │ └── human_handoff.py # Human Agent Transfer Server
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── logger.py # Structured logging
│ │ └── helpers.py # Utility functions
│ ├── interfaces/
│ │ └── __init__.py # Type definitions
│ ├── __init__.py
│ └── server.py # Main MCP server orchestrator
├── docs/
│ └── ARCHITECTURE.md # Detailed architecture documentation
├── tests/
│ └── (test files)
├── .env # Environment configuration (create from env.example)
├── env.example # Example environment configuration
├── requirements.txt # Python dependencies
├── run.py # Server startup script
├── Dockerfile # Docker container definition
├── docker-compose.yml # Docker Compose configuration
└── README.md # This file
See env.example for all available configuration options.
Key variables:
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 3003 |
TRANSPORT |
Transport type (stdio/httpStream) | httpStream |
DB_HOST |
PostgreSQL host | localhost |
OPENAI_API_KEY |
OpenAI API key | - |
MOOD_FRUSTRATION_THRESHOLD |
Frustration threshold for escalation | 0.6 |
DELAY_GAME_THRESHOLD_MINUTES |
Min delay for games | 30 |
FREQUENT_FLYER_MIN_FLIGHTS |
Min flights for FF status | 10 |
Enable/disable features via environment:
ENABLE_MOOD_ANALYSIS=true
ENABLE_GAMES=true
ENABLE_FOOD_RECOMMENDATIONS=true
ENABLE_HUMAN_HANDOFF=true
docker build -t airline-delays-mcp-server .
docker-compose up -d
This starts:
docker-compose down
Run tests:
pytest tests/ -v
Run with coverage:
pytest tests/ --cov=src --cov-report=html
The server uses structured JSON logging. Set log level via:
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_FORMAT=json # json or text
Key metrics tracked:
Passenger: "My flight is delayed. What's happening?"
System Flow:
Passenger: "This is unacceptable! I demand to speak to a manager!"
System Flow:
Delay: 3+ hours
System Actions:
Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"airline-delays": {
"command": "python",
"args": ["/path/to/airline-delays-mcp-server/run.py"],
"env": {
"TRANSPORT": "stdio"
}
}
}
}
For HTTP integration:
import requests
response = requests.post(
"http://localhost:3003/mcp",
json={
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_flight_information",
"arguments": {
"flight_number": "6E-123"
}
}
}
)
print(response.json())
MIT License - see LICENSE file for details
For issues and questions:
Built with:
Made with ❤️ for better customer experiences during travel disruptions
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"airline-flight-delays-mcp-server": {
"command": "npx",
"args": []
}
}
}