ts-travel-mcp-server
Enables Google Gemini to search flights, manage bookings, and interact with the travel booking system through MCP tools.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ts-travel-mcp-server Search for flights from New York to Los Angeles"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Quick Start Guide
New to MCP? Start here! This guide gets you up and running in minutes.
For detailed documentation, see PROJECT_WALKTHROUGH.md.
What We're Building
A complete full-stack travel booking application with:
Backend (MCP Server)
TypeScript MCP server with 8 tools
Mock flight database with real-time state
Booking system with state persistence
Multi-client support (Claude, Codex, Gemini)
Frontend (Web App)
Beautiful React UI with modern design
Flight search interface
Booking management dashboard
Email confirmation preview
Real-time state updates
Fully responsive design
Documentation
Comprehensive guides (see PROJECT_WALKTHROUGH.md)
Setup guides for all AI clients
In-depth code walkthroughs
Architecture explanations
Related MCP server: travel-mcp-server
Prerequisites
Before you begin, make sure you have:
Node.js (v18 or higher) - Download
npm (comes with Node.js)
Git (optional, for cloning)
Optional but recommended:
An AI client configured (Claude Desktop, Codex CLI, or Gemini CLI)
Basic familiarity with TypeScript/JavaScript
️ Project Structure
travel-mcp-server/
│
├── BACKEND MCP SERVER
│ ├── index.ts # Main MCP server (tool definitions & handlers)
│ ├── database.ts # Business logic & data management
│ ├── package.json # Dependencies & scripts
│ ├── tsconfig.json # TypeScript configuration
│ ├── api-server.js # Standalone API server (optional)
│ │
│ ├── data/ # Mock data files
│ │ ├── flights.json # Flight data
│ │ └── bookings.json # Booking records
│ │
│ └── dist/ # Build output (generated by `npm run build`)
│ ├── index.js # Compiled MCP server (used by AI clients)
│ ├── database.js # Compiled database functions
│ └── data/ # Copied data files
│ ├── flights.json
│ └── bookings.json
│
└── FRONTEND WEB APP
├── src/ # React application
│ ├── App.jsx # Main React component
│ ├── main.jsx # React entry point
│ ├── App.css # Styles
│ ├── FlightSearch.jsx # Search interface
│ ├── FlightList.jsx # Flight display
│ ├── BookingForm.jsx # Booking form
│ ├── BookingsList.jsx # Bookings display
│ └── MockEmailModal.jsx # Email confirmation modal
│
├── index.html # HTML entry point
└── vite.config.js # Vite build configurationGetting Started
Step 1: Install Dependencies
# Navigate to project directory
cd travel-mcp-server
# Install all dependencies
npm installWhat this does: Installs TypeScript, MCP SDK, React, Vite, and all required packages.
Step 2: Build the Backend
# Compile TypeScript to JavaScript
npm run buildWhat this does: Compiles index.ts and database.ts into dist/index.js and dist/database.js that AI clients will use.
Expected output:
✓ Built successfullyStep 3: Choose Your Setup Path
You have three options (choose what fits your needs):
Quick Start: Web App Only
Perfect for learning and demos - no AI client setup needed!
Terminal 1: Start API Server
npm run apiTerminal 2: Start Web App
npm run dev:webOpens at http://localhost:3000 - you're ready to go!
AI Integration: MCP Server Only
Perfect for AI CLI integration:
Configure your AI client (choose one):
Claude Desktop → See PROJECT_WALKTHROUGH.md - Claude Desktop Integration
Gemini CLI → See PROJECT_WALKTHROUGH.md - Google Gemini Integration
Codex CLI → See
temp_docs/CODEX_CONFIG.md
Test it:
Open your AI client
Try: "Search for flights from New York to Los Angeles"
Full Stack: Both Web App + MCP Server
Perfect for complete demonstrations:
Terminal 1: MCP Server
npm startTerminal 2: Web App
npm run dev:webTerminal 3: AI Client
Open Claude Desktop, Codex CLI, or Gemini CLI
Both web UI and AI client see the same data!
Tip: For detailed setup instructions, see PROJECT_WALKTHROUGH.md - Integrating with AI Clients
Understanding the Project
How It Works
┌─────────────┐ stdin ┌───────────────┐
│ AI Client │ ─────────────────────> │ MCP Server │
│ (Claude) │ <───────────────────── │ (index.js) │
└─────────────┘ stdout └───────────────┘
│
▼
┌─────────────┐
│ database.js │
│ (functions) │
└─────────────┘The Flow:
AI client sends request via stdin
MCP server processes request
Calls business logic functions
Returns formatted response via stdout
Learn more: See PROJECT_WALKTHROUGH.md - MCP with Stdio Implementation for detailed explanation
Key Concepts
MCP Tools: 8 tools that AI clients can call (search, book, cancel, etc.)
State Persistence: Bookings and seat availability persist across sessions
Business Logic: All logic in
database.ts, tools inindex.tsMock Data: JSON files in
data/directory
Learn more: See PROJECT_WALKTHROUGH.md - Creating MCP Tools for how tools work
Web App Features
Flight Search
Search flights by departure/arrival cities
Quick demo button for NYC → LAX
Results sorted by price
Real-time availability
Flight Display
Beautiful flight cards with airline branding
Shows airline, times, duration, stops, price
Availability indicator (seats remaining)
Quick "Book Now" button
Booking System
Passenger name & email form
Input validation
Real-time availability update
Instant booking confirmation
Email Confirmations
Mock email preview modal
Shows complete booking details
Professional email template
Dismissable modal
Booking Management
View all bookings in one place
Cancel anytime
Seat automatically released on cancel
Real-time updates across all views
Beautiful Design
Modern gradient headers
Responsive cards
Smooth animations
Color-coded status (confirmed/pending/cancelled)
Mobile-friendly responsive design
State Persistence Demo
This is the key teaching moment - demonstrating real backend state management!
Try This Flow:
1. Search flights
→ FL004 shows 22 seats available
2. Book FL004
→ Backend decreases availability
→ FL004 now has 21 seats
3. Search again
→ FL004 still shows 21 seats
→ Change persisted!
4. Cancel the booking
→ FL004 back to 22 seats
→ Seat released!What This Demonstrates:
Real backend state - Not just frontend state
Mutations and updates - Data actually changes
Data consistency - Same data across all views
Business logic execution - Rules enforced server-side
Learn more: See PROJECT_WALKTHROUGH.md - API Functions and Business Logic to understand how state management works
Next Steps
Learn More
PROJECT_WALKTHROUGH.md - Complete documentation with:
How MCP tools are created
Business logic implementation
Function dependencies
Stdio communication details
Full AI client integration guides
Explore the Code
index.ts- MCP server and tool definitionsdatabase.ts- Business logic and data managementsrc/- React components for the web app
Troubleshooting
Web app won't start?
Check Node.js version:
node --version(need v18+)Delete
node_modulesandpackage-lock.json, thennpm install
MCP server not working?
Check that
dist/index.jsexists afternpm run buildVerify AI client configuration path is absolute
Need help?
Check PROJECT_WALKTHROUGH.md - Troubleshooting section
Review AI client configuration guides in PROJECT_WALKTHROUGH.md
Quick Reference
Task | Command |
Install dependencies |
|
Build backend |
|
Start MCP server |
|
Run web app |
|
View docs |
Ready to dive deeper? → PROJECT_WALKTHROUGH.md has everything you need!
Available Tools
9 toolsbook_flightB
Book a flight for a passenger. Returns booking confirmation with booking ID.
Inputs: email (required), flightId (required), passengerName (required).
cancel_bookingA
Cancel a booking and release the seat.
Inputs: bookingId (required).
get_booking_detailsC
Get details about a specific booking.
Inputs: bookingId (required).
get_cheapest_flightC
Get the cheapest available flight for a specific route.
Inputs: arrival (required), departure (required).
get_flight_detailsC
Get detailed information about a specific flight.
Inputs: flightId (required).
list_all_bookingsB
List all bookings made in the system.
Inputs: no named parameters.
remove_bookingA
Remove a cancelled booking from the system. This permanently deletes the booking from the list. Only works for bookings that have been cancelled.
Inputs: bookingId (required).
search_flightsC
Search for available flights between two cities. Returns a list of flights sorted by price by default.
Inputs: arrival (required), departure (required), sortBy.
send_confirmation_emailB
Send a booking confirmation email to the passenger (mock implementation).
Inputs: bookingId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools target distinct operations (search, book, cancel, remove, email). However, search_flights and get_cheapest_flight overlap heavily since the latter is essentially a sorted subset of the former, and remove_booking vs cancel_booking could be confused without careful reading. Overall the descriptions help clarify boundaries.
All tool names use consistent snake_case with a verb_noun pattern (search_flights, book_flight, get_booking_details, cancel_booking, remove_booking, send_confirmation_email). No mixed conventions or vague verbs. Very predictable.
9 tools is well-scoped for a flight booking domain. Each tool serves a clear purpose in the search-book-manage lifecycle, with no redundant or filler tools. Count is neither too thin nor bloated.
Core lifecycle is covered: search, cheapest, book, get flight/booking details, list bookings, cancel, remove, and confirm email. Minor gaps include no tool to modify or update an existing booking (e.g. change flight/date) and limited search filtering, but agents can work around these.
Maintenance
Related MCP Connectors
Flight search MCP server providing search, pagination, and itinerary details for AI assistants.
Search and compare flight offers through a cache-aware Streamable HTTP MCP server for AI agents.
Corporate travel booking and expense management for TripGain, exposed as an MCP server.
Skiplagged MCP Server for flight search, hotel booking, and travel planning
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA proof-of-concept MCP server that allows LLM agents to query live flight booking information via Amadeus, including cheapest tickets, destinations, and airline routes.1-
- FlicenseAqualityDmaintenanceAn AI-powered travel planner MCP server enabling flight and hotel search, weather forecasts, point-of-interest discovery, itinerary generation, and budget management.8-
- FlicenseNot gradedqualityDmaintenanceMulti-domain MCP server enabling AI agents to plan and execute vacation travel and birthday party logistics via local tool pipelines.1-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to find cheap flights through split-ticket routing, trip-shape search, and local event calendars for any destination.1MIT