Travelcode
No description available
Ask AI about Travelcode
Powered by Claude Β· Grounded in docs
I know everything about Travelcode. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
βοΈ MCP TravelCode
Model Context Protocol server for travel β flights, hotels, bookings
Give your AI assistant the power to search flights, book hotels, manage orders, and track flight status β all through natural language.
Quick Start β’ Tools β’ Clients β’ Examples β’ Auth β’ Development
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 β property type, star rating, meal plans, refundability, price filters with streaming results
- π 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 Streamable HTTP (remote) support
Quick Start
There are three ways to use MCP TravelCode. Pick one:
| What it is | Best for | |
|---|---|---|
| A. Hosted server | Use our managed instance at mcp.travel-code.com | Fastest start; works with Claude Web, Desktop, mobile, IDE clients |
| B. Local stdio | Run as a child process via npx on your machine | Single user, desktop client, no infra |
| C. Self-host HTTP server | Deploy your own HTTP instance under your domain | Teams, compliance, custom OAuth AS β see DEPLOY.md |
A and C use the Streamable HTTP transport (multi-client, per-user OAuth). B uses stdio (one process per user, token in a local file).
A β Hosted server (zero install)
No install, no local token files. Point any MCP-capable client at:
https://mcp.travel-code.com/mcp
On first use the client opens a browser window, you log in to TravelCode, approve the consent screen, and you're done. Works in Claude for Web, Claude Desktop, Claude Code, Cursor, Windsurf, and any other client that supports HTTP+OAuth MCP servers.
| Client | How to add |
|---|---|
| Claude Web / Desktop | Settings β Connectors β Add custom connector β URL https://mcp.travel-code.com/mcp |
| Claude Code | claude mcp add --transport http travelcode https://mcp.travel-code.com/mcp |
| Cursor | Settings β MCP β Add Server β URL https://mcp.travel-code.com/mcp |
| Windsurf / VS Code / JetBrains / others | Use the client's MCP config and set transport = HTTP (Streamable), URL = https://mcp.travel-code.com/mcp |
Once connected, the assistant can search flights, find hotels, view and manage your orders, and pull delay stats β on behalf of the signed-in TravelCode user.
B β Local stdio (npx mcp-travelcode)
For desktop clients without HTTP+OAuth support, or air-gapped/offline setups. Each user runs the server as a child process on their own machine.
# Authenticate once with your TravelCode account (opens browser)
npx mcp-travelcode-auth auth
The token is saved to ~/.travelcode/tokens.json and auto-refreshes.
Configure your client to spawn npx mcp-travelcode (examples below).
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"]
C β Self-host HTTP server
Deploy your own HTTP instance under your domain. The same flow as the
hosted instance β clients connect by URL, OAuth happens in the browser,
tokens come in the Authorization: Bearer header on every request β but
running on your infra and (optionally) against your own OAuth Authorization
Server.
For a quick local smoke test:
npm run build
PORT=3000 \
RESOURCE_URI=http://localhost:3000 \
OAUTH_ISSUER=https://travel-code.com \
TRAVELCODE_API_BASE_URL=https://api.travel-code.com/v1 \
npm run start:http
# β http://localhost:3000/mcp
For a full production deploy (systemd + nginx + TLS + fail2ban), see
DEPLOY.md. It documents the reference setup we run for
mcp.travel-code.com and lists the placeholders to substitute when
deploying under your own domain.
Requirements for self-hosting against your own AS:
- An OAuth 2.1 Authorization Server that exposes RFC 8414 metadata (or you
proxy it from the sidecar, as we do for
travel-code.com). - Issued scopes match
SCOPES_SUPPORTEDinsrc/http-server.ts(currentlyflights:*,airports:read,airlines:read,hotels:search,tourist:read). - Tokens accepted by the upstream TravelCode REST API in the
Authorization: Bearerheader.
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 / Streamable HTTP | β Compatible |
Tools (20)
βοΈ 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 β property type, star rating, price range, meal plan, refundability. Results stream incrementally |
π 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_airportsβsearch_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_locationsβsearch_hotelswith 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_ordersβcheck_order_cancellationβ shows cancellation conditions and refund estimate βcancel_orderif 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/Travel-Code-Inc/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 Streamable HTTP transport server
Project Structure
src/
βββ index.ts # stdio entry point
βββ http-server.ts # Streamable HTTP 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/ # 20 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
- Model Context Protocol β the open standard for AI tool integration
- TravelCode β corporate travel management platform
- MCP Servers Directory β official MCP server registry
- Claude Desktop β AI assistant with MCP support
Contributing
Contributions welcome! Please open an issue or submit a pull request.
License
MIT Β© Travel Code
