fli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFli install and usage skill
Fli 安装与使用指南
Use this skill when the goal is to install Fli and use its CLI or MCP server correctly.
The primary path is:
- install with
pipx install flights - use for terminal searches
fli - use for Claude Desktop or other STDIO MCP clients
fli-mcp - use only when an HTTP MCP endpoint is specifically needed
fli-mcp-http
Do not default to cloning the repository or using a source checkout. Only mention cloning the repo when the user explicitly wants to contribute to Fli itself.
当目标为安装Fli并正确使用其CLI或MCP服务器时,可参考本指南。
核心使用流程如下:
- 执行完成安装
pipx install flights - 使用命令在终端中搜索航班
fli - 为Claude Desktop或其他STDIO MCP客户端使用
fli-mcp - 仅当明确需要HTTP MCP端点时使用
fli-mcp-http
不要默认推荐克隆仓库或使用源码检出版本,仅当用户明确表示要为Fli本身做贡献时,再提及克隆仓库的操作。
What Fli is
Fli 是什么
Fli is a Python package for accessing Google Flights data through direct API interaction.
It has three public surfaces:
- CLI via
fli - Python library via the package
fli - MCP server via and
fli-mcpfli-mcp-http
For this skill, focus on the CLI and MCP server first.
Fli是一个Python包,可通过直接的API交互获取Google Flights的数据。
它对外提供三类使用入口:
- 通过命令使用CLI
fli - 通过包调用Python库能力
fli - 通过和
fli-mcp使用MCP服务器fli-mcp-http
本指南优先聚焦CLI和MCP服务器的使用说明。
Core install rule
核心安装规则
If the user wants to use Fli as a tool, recommend .
pipx install flightsWhy:
- it is the documented recommended install path for CLI and MCP usage
- it keeps the install isolated from other Python projects
- it exposes ,
fli, andfli-mcpon the user's PATHfli-mcp-http
Only fall back to or when:
pip install flightsuvx- is unavailable
pipx - the user wants library-only usage
- the user explicitly prefers another Python package manager
如果用户想将Fli作为工具使用,推荐使用安装。
pipx install flights原因如下:
- 这是官方文档推荐的CLI和MCP使用场景安装路径
- 可将安装环境与其他Python项目隔离
- 会自动将、
fli和fli-mcp加入用户的PATH中fli-mcp-http
仅在以下场景下可改用或安装:
pip install flightsuvx- 环境中没有
pipx - 用户仅想使用其库能力
- 用户明确偏好其他Python包管理器
Standard installation flow
标准安装流程
Preferred install
推荐安装方式
bash
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install flightsIf is already installed, skip directly to:
pipxbash
pipx install flightsbash
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install flights如果已经安装了,可以直接执行:
pipxbash
pipx install flightsVerify installation
验证安装
Run these checks after install:
bash
fli --help
fli-mcp --help
which fli-mcpIf the commands are not found after , have the user run:
pipx install flightsbash
python3 -m pipx ensurepathThen restart the terminal session.
安装完成后运行以下命令检查是否安装成功:
bash
fli --help
fli-mcp --help
which fli-mcp如果执行后提示找不到命令,让用户运行:
pipx install flightsbash
python3 -m pipx ensurepath然后重启终端会话即可。
What the install provides
安装后可用命令
After , these commands should be available:
pipx install flights- - main CLI for flight searches
fli - - MCP server over STDIO
fli-mcp - - MCP server over HTTP, defaulting to
fli-mcp-httphttp://127.0.0.1:8000/mcp/
Important naming detail:
- the package to install is
flights - the commands to run are ,
fli, andfli-mcpfli-mcp-http
Do not tell users to run .
pipx install fli执行后,以下命令将可用:
pipx install flights- - 用于航班搜索的主CLI工具
fli - - 基于STDIO的MCP服务器
fli-mcp - - 基于HTTP的MCP服务器,默认地址为
fli-mcp-httphttp://127.0.0.1:8000/mcp/
重要命名注意事项:
- 需要安装的包名是
flights - 需要运行的命令是、
fli和fli-mcpfli-mcp-http
不要告诉用户运行。
pipx install fliCLI usage
CLI 使用说明
Basic flight search
基础航班搜索
Use:
bash
fli flights JFK LAX 2026-10-25使用方式:
bash
fli flights JFK LAX 2026-10-25Cheapest-date search
最低票价日期搜索
Use:
bash
fli dates JFK LAX --from 2026-01-01 --to 2026-01-31使用方式:
bash
fli dates JFK LAX --from 2026-01-01 --to 2026-01-31Common filters
常用筛选参数
Use filters like these when the user asks for them:
bash
fli flights JFK LHR 2026-10-25 \
--time 6-20 \
--airlines BA KL \
--class BUSINESS \
--stops NON_STOP \
--sort DURATIONSupported language to map correctly:
- cabin classes: ,
ECONOMY,PREMIUM_ECONOMY,BUSINESSFIRST - stop filters: ,
ANY,NON_STOP,ONE_STOPTWO_PLUS_STOPS - sort options: ,
CHEAPEST,DURATION,DEPARTURE_TIMEARRIVAL_TIME
当用户有对应需求时可以使用以下筛选参数:
bash
fli flights JFK LHR 2026-10-25 \
--time 6-20 \
--airlines BA KL \
--class BUSINESS \
--stops NON_STOP \
--sort DURATION支持的参数映射如下:
- 舱位等级:(经济舱)、
ECONOMY(超级经济舱)、PREMIUM_ECONOMY(商务舱)、BUSINESS(头等舱)FIRST - 停留筛选:(不限)、
ANY(直飞)、NON_STOP(一次中转)、ONE_STOP(两次及以上中转)TWO_PLUS_STOPS - 排序选项:(价格最低)、
CHEAPEST(耗时最短)、DURATION(出发时间)、DEPARTURE_TIME(到达时间)ARRIVAL_TIME
CLI shorthand
CLI 快捷用法
Fli supports a convenience shorthand where a non-command invocation is treated as a flights search.
Example:
bash
fli JFK LAX 2026-05-15This behaves like:
bash
fli flights JFK LAX 2026-05-15Use the explicit subcommand in examples unless the user asks for shortcuts.
flightsFli支持便捷简写,不带子命令的调用会被视为航班搜索请求。
示例:
bash
fli JFK LAX 2026-05-15其效果等同于:
bash
fli flights JFK LAX 2026-05-15示例中优先使用显式的子命令,除非用户明确要求使用快捷方式。
flightsMCP usage
MCP 使用说明
Default MCP mode
默认MCP模式
Use for Claude Desktop and other STDIO-based MCP clients.
fli-mcpbash
fli-mcpThis is the default recommendation for local assistant integration.
对于Claude Desktop和其他基于STDIO的MCP客户端,使用即可:
fli-mcpbash
fli-mcp这是本地助手集成的默认推荐方案。
HTTP MCP mode
HTTP MCP模式
Use only when the user needs an HTTP endpoint.
fli-mcp-httpbash
fli-mcp-httpBy default, it serves at:
http://127.0.0.1:8000/mcp/
For HTTP integrations, the client should send:
Accept: application/json, text/event-stream
仅当用户需要HTTP端点时使用:
fli-mcp-httpbash
fli-mcp-http默认服务地址为:
http://127.0.0.1:8000/mcp/
进行HTTP集成时,客户端需要发送以下请求头:
Accept: application/json, text/event-stream
Claude Desktop setup
Claude Desktop 配置
When the user wants Claude Desktop integration, recommend this config first:
json
{
"mcpServers": {
"fli": {
"command": "fli-mcp",
"args": []
}
}
}Suggested config paths:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\\Claude\\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
After editing the config:
- fully quit Claude Desktop
- relaunch it
- start a new conversation
- ask for a flight search
Good validation prompt:
Can you search for flights from JFK to LHR on 2026-03-15?当用户需要集成Claude Desktop时,优先推荐以下配置:
json
{
"mcpServers": {
"fli": {
"command": "fli-mcp",
"args": []
}
}
}推荐的配置文件路径:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\\Claude\\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
编辑完配置后:
- 完全退出Claude Desktop
- 重新启动应用
- 开启新的对话
- 发起航班搜索请求
有效的验证提示词示例:
你能帮我搜索2026年3月15日从JFK到LHR的航班吗?Optional MCP environment variables
可选MCP环境变量
If the user wants defaults, these environment variables are relevant:
FLI_MCP_DEFAULT_PASSENGERSFLI_MCP_DEFAULT_CURRENCYFLI_MCP_DEFAULT_CABIN_CLASSFLI_MCP_DEFAULT_SORT_BYFLI_MCP_DEFAULT_DEPARTURE_WINDOWFLI_MCP_MAX_RESULTS
Example:
json
{
"mcpServers": {
"fli": {
"command": "fli-mcp",
"args": [],
"env": {
"FLI_MCP_DEFAULT_CURRENCY": "EUR",
"FLI_MCP_DEFAULT_CABIN_CLASS": "BUSINESS",
"FLI_MCP_MAX_RESULTS": "10"
}
}
}
}如果用户需要设置默认值,可以使用以下环境变量:
FLI_MCP_DEFAULT_PASSENGERSFLI_MCP_DEFAULT_CURRENCYFLI_MCP_DEFAULT_CABIN_CLASSFLI_MCP_DEFAULT_SORT_BYFLI_MCP_DEFAULT_DEPARTURE_WINDOWFLI_MCP_MAX_RESULTS
示例:
json
{
"mcpServers": {
"fli": {
"command": "fli-mcp",
"args": [],
"env": {
"FLI_MCP_DEFAULT_CURRENCY": "EUR",
"FLI_MCP_DEFAULT_CABIN_CLASS": "BUSINESS",
"FLI_MCP_MAX_RESULTS": "10"
}
}
}
}How to guide users well
如何更好地引导用户
If the user asks to install Fli
如果用户要求安装Fli
Give them the path first.
pipx install flights优先提供的安装路径。
pipx install flightsIf the user asks how to use the command line tool
如果用户询问如何使用命令行工具
Show and examples first.
fli flights ...fli dates ...优先展示和的使用示例。
fli flights ...fli dates ...If the user asks how to connect Claude or another assistant
如果用户询问如何连接Claude或其他助手
Show and the Claude Desktop config first.
fli-mcp优先展示的用法和Claude Desktop的配置方案。
fli-mcpIf the user asks for a web endpoint
如果用户需要Web端点
Then show and mention the path and header.
fli-mcp-http/mcp/Accept再展示的用法,并说明路径和请求头要求。
fli-mcp-http/mcp/AcceptIf the user asks how to contribute or hack on the codebase
如果用户询问如何贡献或修改代码库
That is outside the primary scope of this skill. Only then discuss cloning the repository and using development commands.
这超出了本指南的核心范围,仅在这种场景下讨论克隆仓库和使用开发命令的相关内容。
Common mistakes to prevent
需要避免的常见错误
- telling users to clone the repository when they only want the tool
- telling users to install instead of
fliflights - focusing on the Python API when the user asked for CLI or MCP setup
- giving HTTP MCP instructions when STDIO MCP is enough
- forgetting to tell Claude Desktop users to fully restart the app
- omitting the PATH fix when installs successfully but commands are not found
pipx
- 当用户仅需要使用工具时,引导用户克隆仓库
- 引导用户安装而不是
fli包flights - 当用户需要CLI或MCP配置时,反而聚焦Python API的说明
- 当STDIO MCP足够满足需求时,提供HTTP MCP的使用说明
- 忘记提醒Claude Desktop用户需要完全重启应用
- 当安装成功但找不到命令时,遗漏PATH修复的步骤
pipx
Troubleshooting
故障排查
fli
or fli-mcp
not found
flifli-mcp找不到fli
或fli-mcp
命令
flifli-mcpTry:
bash
python3 -m pipx ensurepathThen restart the terminal.
尝试执行:
bash
python3 -m pipx ensurepath然后重启终端。
Python version problems
Python版本问题
Fli requires Python 3.10 or newer.
Check with:
bash
python3 --versionFli要求Python 3.10或更高版本。
可通过以下命令检查版本:
bash
python3 --versionClaude Desktop does not show the tools
Claude Desktop不显示工具
Check these in order:
- works in a terminal
fli-mcp --help - the Claude Desktop config file path is correct
- the JSON is valid
- Claude Desktop was fully quit and reopened
按以下顺序逐一排查:
- 在终端中运行确认可用
fli-mcp --help - 确认Claude Desktop配置文件路径正确
- 确认JSON格式有效
- 确认Claude Desktop已完全退出并重新启动
Rate limiting or temporary failures
限流或临时故障
Fli includes automatic rate limiting and retries, but live Google Flights requests can still fail temporarily.
If a query fails:
- retry after a short delay
- reduce repeated back-to-back searches
- do not assume the CLI or MCP setup is broken just because one upstream request failed
Fli内置了自动限流和重试机制,但实时的Google Flights请求仍可能临时失败。
如果查询失败:
- 等待一小段时间后重试
- 减少连续重复搜索的频率
- 不要仅因为一次上游请求失败就判定CLI或MCP配置有问题
Public docs
官方文档
Use these docs for product-facing guidance:
- introduction:
https://punitarani-fli.mintlify.app/introduction - installation:
https://punitarani-fli.mintlify.app/installation - MCP setup:
https://punitarani-fli.mintlify.app/mcp/setup - docs index:
https://punitarani-fli.mintlify.app/llms.txt
Use product docs for examples and onboarding. Use the actual installed command names when writing instructions.
面向用户的指导可参考以下官方文档:
- 介绍:
https://punitarani-fli.mintlify.app/introduction - 安装:
https://punitarani-fli.mintlify.app/installation - MCP配置:
https://punitarani-fli.mintlify.app/mcp/setup - 文档索引:
https://punitarani-fli.mintlify.app/llms.txt
示例和引导可参考官方文档,编写操作指引时请使用实际安装后的命令名称。
Summary
总结
The default recommendation is . After that, use for terminal searches, for Claude Desktop and other STDIO MCP clients, and only when an HTTP MCP endpoint is specifically needed.
pipx install flightsflifli-mcpfli-mcp-http默认推荐安装方式为。安装完成后,使用在终端搜索航班,为Claude Desktop和其他STDIO MCP客户端使用,仅当明确需要HTTP MCP端点时使用。
pipx install flightsflifli-mcpfli-mcp-http