npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-travelcode

v1.0.4

Published

MCP server for TravelCode — flights, hotels, orders. Search flights & hotels, manage bookings via AI assistants.

Readme


What is this?

MCP TravelCode is a Model Context Protocol (MCP) server that connects AI assistants to the TravelCode corporate travel API. It lets AI agents search for flights and hotels, create and manage bookings, check real-time flight status, and access delay statistics — all via natural language conversations.

Built for the MCP ecosystem — works with Claude Desktop, Claude Code, Cursor, Windsurf, Cline, Continue, OpenClaw, and any MCP-compatible client.

Key Features

  • 🔍 Flight search — multi-city, one-way, round-trip with cabin class and passenger filters
  • 🏨 Hotel search — star rating, meal plans, refundability, price filters with SSE streaming
  • 📊 Flight status — real-time tracking with delays, gates, terminals, and aircraft info
  • 📈 Delay statistics — historical delay and cancellation data for flights and airports
  • 📋 Order management — create, cancel, modify bookings; check cancellation conditions
  • 🔐 OAuth 2.1 + PKCE — secure browser-based authentication, auto-refreshing tokens
  • 🌍 Airport & airline data — search by name, city, IATA/ICAO code
  • Async polling — automatic background polling for flight search results
  • 🔄 Dual transport — stdio (local) and HTTP/SSE (remote) support

Quick Start

Install & Authenticate

# 1. Authenticate with your TravelCode account (opens browser, one-time)
npx mcp-travelcode-auth auth

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "travelcode": {
      "command": "npx",
      "args": ["mcp-travelcode"]
    }
  }
}

Restart Claude Desktop — done! Ask Claude to search flights, book hotels, or check flight status.

Claude Code

claude mcp add travelcode -- npx mcp-travelcode

ChatGPT Desktop

Go to Settings → Tools → Add MCP Server, then add:

{
  "command": "npx",
  "args": ["mcp-travelcode"]
}

Gemini / Google AI Studio

Add to your MCP server configuration:

{
  "mcpServers": {
    "travelcode": {
      "command": "npx",
      "args": ["mcp-travelcode"]
    }
  }
}

GitHub Copilot (VS Code)

Add to your VS Code settings.json:

{
  "github.copilot.chat.mcpServers": {
    "travelcode": {
      "command": "npx",
      "args": ["mcp-travelcode"]
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "travelcode": {
      "command": "npx",
      "args": ["mcp-travelcode"]
    }
  }
}

Windsurf / Cline / Continue

Add to your MCP configuration (typically mcp_config.json or settings):

{
  "mcpServers": {
    "travelcode": {
      "command": "npx",
      "args": ["mcp-travelcode"]
    }
  }
}

Zed

Add to your Zed settings.json:

{
  "context_servers": {
    "travelcode": {
      "command": {
        "path": "npx",
        "args": ["mcp-travelcode"]
      }
    }
  }
}

JetBrains IDEs (IntelliJ, WebStorm, PyCharm)

Go to Settings → Tools → AI Assistant → MCP Servers → Add, set command to npx with args mcp-travelcode.

OpenClaw

mcp:
  servers:
    travelcode:
      command: npx
      args: ["mcp-travelcode"]

HTTP Transport (Remote / Multi-client)

npx mcp-travelcode --http          # Start HTTP+SSE server
# or
npm run start:http                  # If installed locally

Connect any MCP client to http://localhost:3000/mcp via SSE transport.

Supported Clients

Works with any MCP-compatible client — including all major AI assistants, IDEs, and coding tools:

| Client | Transport | Status | |--------|-----------|--------| | ChatGPT Desktop | stdio | ✅ Compatible | | Claude Desktop | stdio | ✅ Tested | | Claude Code | stdio | ✅ Tested | | Gemini | stdio | ✅ Compatible | | GitHub Copilot | stdio | ✅ Compatible | | Cursor | stdio | ✅ Tested | | Windsurf | stdio | ✅ Compatible | | Cline | stdio | ✅ Compatible | | Continue | stdio | ✅ Compatible | | Zed | stdio | ✅ Compatible | | JetBrains IDEs | stdio | ✅ Compatible | | VS Code | stdio | ✅ Compatible | | OpenClaw | stdio | ✅ Tested | | MCP Inspector | stdio | ✅ Tested | | Any MCP client | stdio / HTTP+SSE | ✅ Compatible |

Tools (19)

✈️ Flight Search & Reference Data

| Tool | Description | |------|-------------| | search_airports | Find airports by name, city, or IATA/ICAO code | | get_airport | Get detailed airport information (location, timezone, terminals) | | search_airlines | Find airlines by name or IATA/ICAO code | | search_flights | Search flights — one-way, round-trip, multi-city. Handles async polling automatically | | get_flight_results | Filter, sort, and paginate existing search results |

📊 Flight Statistics

| Tool | Description | |------|-------------| | get_flight_status | Real-time flight status — delays, gates, terminals, aircraft type | | get_airport_flights | Live airport departure/arrival board for a time window | | get_flight_delay_stats | Historical on-time performance and delay statistics for a flight number | | get_airport_delay_stats | Airport-wide delay and cancellation statistics for a date |

🏨 Hotel Search

| Tool | Description | |------|-------------| | search_hotel_locations | Find cities, regions, or specific hotels by name (returns location IDs for search) | | get_hotel_location | Get location details by ID | | search_hotels | Search hotels with filters — star rating, price range, meal plan, refundability. Results stream via SSE |

📋 Order Management

| Tool | Description | |------|-------------| | list_orders | List all orders with filtering (status, date range) and pagination | | get_order | Get full order details — passengers, segments, pricing, ticket numbers | | create_order | Book a flight from search results — add passengers, contacts, payment | | check_order_cancellation | Check cancellation conditions, penalties, and refund estimate before canceling | | cancel_order | Cancel an order with refund processing | | check_order_modification | Check what modifications are allowed (rebooking, baggage, contacts) | | modify_order | Modify an order — update contacts, passport info, rebook, add baggage |

Example Conversations

Search Flights

You: Find me flights from New York to London on April 15, economy class, 2 passengers

AI: Uses search_airportssearch_flights → returns formatted flight options with prices, durations, and stops

Book a Hotel

You: I need a 4-star hotel in Tokyo for May 1-5, 2 adults, with breakfast included

AI: Uses search_hotel_locationssearch_hotels with star rating and meal plan filters → shows options

Check Flight Status

You: Is my flight AA100 on time today?

AI: Uses get_flight_status → shows real-time departure/arrival times, gate, terminal, any delays

Manage Bookings

You: Show my recent orders. Can I cancel order #12345?

AI: Uses list_orderscheck_order_cancellation → shows cancellation conditions and refund estimate → cancel_order if confirmed

Flight Delay Analysis

You: How often is BA115 delayed? What are the stats?

AI: Uses get_flight_delay_stats → shows historical on-time percentage, average delays, cancellation rate

Authentication

MCP TravelCode uses OAuth 2.1 with PKCE — the modern standard for secure authentication. No API keys to manage or rotate.

# Sign in (opens browser for secure authentication)
npx mcp-travelcode-auth auth

# Check token status and expiration
npx mcp-travelcode-auth status

# Sign out and clear tokens
npx mcp-travelcode-auth logout
  • Tokens are stored in ~/.travelcode/tokens.json
  • Access tokens auto-refresh when expired — no manual intervention needed
  • Each user authenticates with their own TravelCode account

Legacy mode: Set TRAVELCODE_API_TOKEN environment variable to use a static API token (skips OAuth).

Configuration

| Environment Variable | Required | Default | Description | |---------------------|----------|---------|-------------| | TRAVELCODE_API_TOKEN | No | — | Static API token (bypasses OAuth) | | TRAVELCODE_API_BASE_URL | No | https://api.travel-code.com/v1 | API base URL | | TRAVELCODE_POLL_INTERVAL_MS | No | 2000 | Flight search polling interval in milliseconds | | TRAVELCODE_POLL_TIMEOUT_MS | No | 90000 | Flight search timeout in milliseconds |

Development

git clone https://github.com/egorceo/mcp-travelcode.git
cd mcp-travelcode
npm install

npm run dev          # Run with tsx (hot reload)
npm run build        # Compile TypeScript
npm test             # Run tests
npm run inspect      # Test interactively with MCP Inspector
npm run start:http   # Start HTTP+SSE transport server

Project Structure

src/
├── index.ts          # stdio entry point
├── http-server.ts    # HTTP+SSE entry point
├── server.ts         # MCP server setup & tool registration
├── config.ts         # Environment configuration
├── auth/             # OAuth 2.1 PKCE flow & CLI
├── client/           # TravelCode API client
├── tools/            # 19 MCP tool implementations
├── formatters/       # Response formatting
└── polling/          # Async flight search polling

Tech Stack

  • TypeScript — full type safety
  • @modelcontextprotocol/sdk — official MCP SDK
  • Zod — runtime schema validation for all tool inputs
  • Express 5 — HTTP transport server
  • Vitest — testing framework

Use Cases

  • Corporate travel management — search and book business travel through AI assistants
  • Travel agencies — integrate flight and hotel search into AI-powered agent workflows
  • Trip planning — find flights, compare prices, check schedules via natural conversation
  • Flight monitoring — track flight status, delays, gate changes in real-time
  • Travel analytics — analyze flight delay patterns, airport performance, route statistics
  • Booking automation — automate repetitive booking tasks through AI agents
  • Customer support — help travelers check bookings, modify orders, handle cancellations

Related

Contributing

Contributions welcome! Please open an issue or submit a pull request.

License

MIT © Travel Code