routes-mcp

jbandu/routes-mcp

3.2

If you are the rightful owner of routes-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Production-ready MCP server for airline route optimization, network planning, and competitive intelligence.

Tools
10
Resources
0
Prompts
0

Routes & Network Intelligence MCP Server

Production-ready MCP server for airline route optimization, network planning, and competitive intelligence.

Built for Copa Airlines' design partnership with Number Labs as part of the Airline Agentic Operating System.

🎯 Overview

This MCP (Model Context Protocol) server provides intelligent route network analysis, optimization, and competitive intelligence for airline operations. It serves as the canonical source of truth for:

  • Route Network Planning - Comprehensive route database with schedules, frequencies, and performance
  • Route Optimization - AI-powered network optimization considering profitability, demand, and constraints
  • Competitive Intelligence - Market analysis, competitor tracking, and strategic insights
  • Demand Forecasting - ML-based demand predictions with seasonal patterns
  • Feasibility Analysis - Validate new route proposals against operational and commercial constraints
  • Hub Connectivity - Analyze and optimize hub operations and connection quality

🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐
│         ROUTES & NETWORK INTELLIGENCE MCP SERVER            │
│                                                              │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐     │
│  │   Route      │  │  PostgreSQL  │  │    Neo4j     │     │
│  │   Scraper    │→ │   Database   │→ │  Network     │     │
│  │   Agents     │  │              │  │   Graph      │     │
│  └──────────────┘  └──────────────┘  └──────────────┘     │
│                           ↓                ↓                 │
│                    ┌─────────────┐  ┌─────────────┐        │
│                    │ Optimization│  │ Competitive │        │
│                    │   Engine    │  │ Intelligence│        │
│                    └─────────────┘  └─────────────┘        │
│                           ↓                                  │
│                    ┌─────────────┐                          │
│                    │ MCP Protocol│                          │
│                    └─────────────┘                          │
└────────────────────────┬────────────────────────────────────┘
                         │
            ┌────────────┼────────────┐
            ↓            ↓            ↓
    Network Planner  Revenue Mgmt  Schedule Optimizer

🛠️ Tech Stack

  • Backend: Node.js/TypeScript
  • MCP SDK: @modelcontextprotocol/sdk
  • Database: PostgreSQL (route data, performance metrics)
  • Graph DB: Neo4j (network topology, connectivity analysis)
  • Scraping: Playwright + Cheerio
  • Optimization: Custom algorithms + mathjs
  • LLM: Ollama (local) / Claude API (production)
  • Testing: Jest
  • Deployment: Railway / Vercel

📋 Prerequisites

  • Node.js >= 18.0.0
  • PostgreSQL >= 14
  • Neo4j >= 5.0 (optional, for graph analysis)
  • Ollama (for AI-powered analysis)

🚀 Quick Start

1. Install Dependencies

cd routes-mcp
npm install

2. Configure Environment

cp .env.example .env

Edit .env with your configuration:

# PostgreSQL Database
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=routes_network_db
POSTGRES_USER=your_username
POSTGRES_PASSWORD=your_password

# Neo4j (optional)
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=your_password
ENABLE_NEO4J=true

# LLM Configuration
LLM_MODE=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.1:latest

3. Set Up Database

# Create PostgreSQL database
createdb routes_network_db

# Run migrations
npm run db:migrate

# Seed sample data
npm run db:seed

4. Build and Run

# Build TypeScript
npm run build

# Start server
npm start

# Or run in development mode
npm run dev:mcp

5. Test with MCP Inspector

npm run inspector

🔧 Available Tools

The MCP server exposes 10 powerful tools:

1. get-airline-routes

Get comprehensive route network for an airline including schedules, frequencies, and performance metrics.

Input:

{
  "airline_code": "CM",
  "route_type": "international",
  "include_performance": true
}

2. analyze-route-profitability

Comprehensive profitability analysis for specific routes including revenue, costs, and optimization recommendations.

Input:

{
  "airline_code": "CM",
  "origin": "PTY",
  "destination": "MIA",
  "analysis_period": "last_quarter"
}

3. get-competitive-intelligence

Competitive analysis for route pairs including all operating airlines, market share, and strategic insights.

Input:

{
  "origin": "PTY",
  "destination": "LAX",
  "analysis_depth": "strategic"
}

4. optimize-route-network

AI-powered route network optimization considering aircraft availability, demand forecasts, and profitability.

Input:

{
  "airline_code": "CM",
  "optimization_objective": "maximize_profit",
  "constraints": {
    "min_load_factor": 0.75,
    "must_serve_airports": ["PTY", "BOG", "LIM"]
  }
}

5. get-seasonal-demand-patterns

Analyze historical seasonal demand patterns to optimize capacity allocation and pricing.

Input:

{
  "route_identifier": "PTY-MIA",
  "historical_years": 3,
  "include_events": true
}

6. validate-route-feasibility

Comprehensive feasibility check for new route proposals.

Input:

{
  "airline_code": "CM",
  "origin": "PTY",
  "destination": "MAD",
  "aircraft_type": "737-MAX9"
}

7. get-hub-connectivity-analysis

Analyze hub airport connectivity, connection quality, and optimization opportunities.

Input:

{
  "hub_airport": "PTY",
  "airline_code": "CM"
}

8. get-route-alternatives

Find all alternative routing options between two airports.

Input:

{
  "origin": "GUA",
  "destination": "JFK",
  "max_connections": 1
}

9. forecast-route-demand

Generate AI-powered demand forecasts for existing or proposed routes.

Input:

{
  "route_identifier": "PTY-BOG",
  "forecast_horizon": "6_months",
  "include_scenarios": true
}

10. update-route-data

Trigger automated update of route data from external sources.

Input:

{
  "airline_code": "CM",
  "data_sources": ["airline_website", "oag"]
}

📊 Database Schema

The server uses PostgreSQL with 12 core tables:

  • airlines - Airline information
  • airports - Airport details
  • routes - Route definitions
  • route_schedules - Flight schedules
  • route_performance - Historical performance data
  • competitive_routes - Competitor analysis
  • demand_forecasts - AI demand predictions
  • route_costs - Cost modeling
  • seasonal_patterns - Seasonal analysis
  • route_constraints - Operational constraints
  • hub_connections - Hub connectivity
  • route_alternatives - Alternative routing

See database/schema.sql for complete schema.

🧪 Testing

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

🔗 Integration with Other MCPs

This MCP integrates with:

  • Aircraft Database MCP - Validate aircraft range and performance
  • Crew Qualifications MCP - Check crew base coverage

Configure integration URLs in .env:

AIRCRAFT_MCP_URL=http://localhost:3000
CREW_MCP_URL=http://localhost:3001

📈 Development Roadmap

Phase 1: Foundation (Prompt 1-2)

  • Project setup and database schema
  • Database migrations and seeding

Phase 2: Core Engines (Prompt 3-4)

  • Route optimization engine
  • Profitability analyzer
  • Demand forecaster
  • Web scrapers

Phase 3: MCP Tools (Prompt 5-6)

  • Implement all 10 MCP tools
  • Integration with aircraft-mcp and crew-mcp

Phase 4: Testing & Deployment (Prompt 7-10)

  • Comprehensive test suite
  • Copa Airlines configuration
  • Production deployment

🎯 Copa Airlines Demo (December 15th)

Key metrics to demonstrate:

  • 5-10% route profitability improvement
  • Real-time competitive intelligence on 50+ routes
  • Hub connectivity optimization at PTY
  • Demand forecasting with 85%+ accuracy
  • Route feasibility validation in < 5 seconds

📝 License

MIT License - see LICENSE file for details

🤝 Contributing

Built by Number Labs for Copa Airlines design partnership.

📧 Support

For issues or questions, please open an issue on GitHub.


Part of the Airline Agentic Operating System 🛫