Award Flight Daily MCP Server
Official Industry Standard MCP for Travel Awards, Points, and more. Search award flight availability across multiple airline loyalty programs, find sweet spots, check transfer partners, and get market stats all via MCP.
README
Award Flight Daily MCP Server
A FastMCP server that wraps the Award Flight Daily database (12.3M award flight records across 25 loyalty programs) and exposes it to AI agents via tools.
Overview
The Award Flight Daily MCP server provides 7 core tools for searching, analyzing, and optimizing award travel:
- afd_search_award_flights - Core search across 12M+ records
- afd_list_programs - All 25 programs with statistics
- afd_get_program_details - Deep dive on a single program
- afd_get_route_availability - Calendar view for a route
- afd_find_sweet_spots - Best-value redemptions
- afd_check_transfer_partners - Credit card transfer ratios
- afd_get_market_stats - Aggregate database statistics
File Structure
mcp_server/
├── __init__.py # Package definition
├── config.py # Constants: programs, cabins, banks
├── server.py # FastMCP server entry point (7 tools registered)
├── db/
│ ├── __init__.py
│ └── queries.py # DuckDB queries (read-only, parameterized)
├── models/
│ ├── __init__.py
│ ├── inputs.py # 8 Pydantic input models with validators
│ └── responses.py # Formatting helpers (JSON/Markdown)
└── tools/
├── __init__.py
├── search.py # afd_search_award_flights
├── programs.py # afd_list_programs, afd_get_program_details
├── routes.py # afd_get_route_availability
├── sweet_spots.py # afd_find_sweet_spots
├── transfers.py # afd_check_transfer_partners
└── analytics.py # afd_get_market_stats
Configuration
All environment and program configuration lives in config.py:
- MCP_SERVER_NAME: "awardflightdaily_mcp"
- DUCKDB_PATH: Environment variable, defaults to
/data/award_flights.duckdb - PROGRAMS: Dictionary of 25 programs (slug -> full name)
- CABINS: Cabin class codes (Y/W/J/F)
- BANKS: 7 credit card programs
Installation & Deployment
Requirements
fastmcp>=1.0.0
pydantic>=2.0
duckdb==1.1.3
Running
Stdio mode (local):
python -m mcp_server.server
HTTP mode (remote):
python -m mcp_server.server --http 8001
Tools API
1. Search Award Flights
SearchInput(
origin="JFK", # Required: IATA code(s)
destination="NRT", # Required: IATA code(s)
date_from="2026-06-01", # Required: YYYY-MM-DD
date_to="2026-06-30", # Required: YYYY-MM-DD
cabin=CabinClass.BUSINESS, # Optional: Y/W/J/F (default J)
source="united,aeroplan", # Optional: program filter
direct_only=False, # Optional: nonstop only
max_miles=100000, # Optional: mileage cap
min_seats=1, # Optional: min seats (default 1)
limit=50, # Optional: results limit (default 50, max 200)
offset=0, # Optional: pagination offset
response_format=ResponseFormat.JSON # Optional: JSON or Markdown
)
Returns: Paginated flight results with mileage, taxes, seats, airlines, equipment.
2. List Programs
ListProgramsInput(
response_format=ResponseFormat.JSON
)
Returns: All 25 programs with:
- Total flights & routes
- Date range
- Cabin availability counts (Y/W/J/F)
3. Program Details
ProgramDetailInput(
program="united", # Required: program slug
response_format=ResponseFormat.JSON
)
Returns: Deep stats for one program:
- Total availability
- Unique routes & airports
- Average & minimum mileage by cabin
4. Route Availability
RouteInput(
origin="JFK",
destination="NRT",
cabin=CabinClass.BUSINESS,
source=None, # Optional: filter by program
response_format=ResponseFormat.JSON
)
Returns: All dates for a route with mileage, taxes, seats per program.
5. Find Sweet Spots
SweetSpotInput(
cabin=CabinClass.BUSINESS,
origin=None, # Optional
destination=None, # Optional
limit=25,
response_format=ResponseFormat.JSON
)
Returns: Best-value routes ranked by minimum mileage cost.
6. Transfer Partners
TransferInput(
bank="chase", # Optional: bank slug
program="united", # Optional: program slug
response_format=ResponseFormat.JSON
)
Returns: Credit card → airline transfer mappings with:
- Transfer ratio (e.g., "1:1")
- Speed (e.g., "Instant", "1-2 days")
7. Market Stats
MarketStatsInput(
response_format=ResponseFormat.JSON
)
Returns: Aggregate database stats:
- Total records, programs, routes
- Airport coverage
- Cabin availability breakdown
Input Validation
All inputs use Pydantic with validation:
- IATA codes: Must be exactly 3 alphabetic characters
- Dates: YYYY-MM-DD format only
- Cabin: Enum restricted to Y/W/J/F
- Limit: 1-200 results
- Offset: >= 0
- Min seats: 1-9
Invalid inputs raise ValidationError with detailed messages.
Response Formats
JSON (default)
Full structured response with pagination metadata:
{
"total": 1234,
"count": 50,
"offset": 0,
"has_more": true,
"cabin": "J",
"results": [
{
"id": "...",
"source": "united",
"origin": "JFK",
"destination": "NRT",
"date": "2026-06-15",
"mileage": 75000,
"taxes": 11.20,
"seats": 2,
"direct": true,
"airlines": "United",
"equipment": "B787",
"updated_at": "2026-03-26T12:34:56"
}
]
}
Markdown
Human-readable output with formatting:
# Award Flight Search Results
**1234 flights found** | Cabin: Business | Showing 50
## JFK → NRT | 2026-06-15
- **75,000 miles** + $11.20 taxes | united
- Nonstop | 2 seats | United B787
...
Database
All queries are:
- Read-only (DuckDB in read-only mode)
- Parameterized with proper escaping
- Filtered on
expired_at IS NULL(active records only) - Type-safe with CAST(? AS DATE) for dates
Connection is lazy-loaded on first query and reused.
Design Principles
- No monoliths - Each tool in its own module
- Separation of concerns - DB queries, models, tools, responses separate
- Type safety - Pydantic models on all inputs
- Defensive - All parameterized queries, validators on inputs
- Fast - Read-only DuckDB, lazy connection, caching via MCP layer
- Testable - Pure functions, no side effects
Error Handling
- Invalid input: Pydantic
ValidationErrorwith field details - Database error: Returns error message string (no 500s)
- No results: Friendly "No flights found" message
The MCP layer handles serialization of errors to the client.
Future Enhancements
- Price tracking ($/mile value calculation)
- Seat map integration
- Award chart comparison
- Frequent flyer earning rates
- Stopover/layover optimization
- Alert setup via MCP (future: read-write tools)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。