@flightmaster/dast-cli
v1.0.2
Published
DAST MCP CLI — fixed single-server client for Flight Master aviation data
Downloads
130
Maintainers
Readme
@flightmaster/dast-cli
DAST MCP 命令行客户端。固定对接单一 MCP Server(dast_mcp),将工具发现与调用封装为简洁命令,方便 AI Agent 集成与本地调试。
默认上游:https://fly.huoli.com/mcp/dast_mcp
安装
npm install -g @flightmaster/dast-cli本地开发:
npm install
npm run build
npm link配置
export DAST_API_KEY=sk_phone_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- DAST_API_KEY 从 https://dast.133.cn 获取
| 变量 | 说明 | 默认值 |
| :--- | :--- | :--- |
| DAST_API_KEY | 必填 | - |
| DAST_MCP_URL | 自定义 MCP 服务地址 | https://fly.huoli.com/mcp/dast_mcp |
| DAST_TIMEOUT | 全局请求超时(毫秒) | 20000 |
请求超时
超时指 CLI 等待 MCP 网关 HTTP 响应的最长时间(毫秒),适用于 list / schema / info / call。
| 方式 | 作用范围 | 示例 |
| :--- | :--- | :--- |
| 默认 | 未配置时 | 20000 |
| DAST_TIMEOUT | 当前 shell / 进程环境 | export DAST_TIMEOUT=60000 |
| -t / --timeout | 仅本次命令 | dast call <tool> -a '...' -t 60000 |
优先级:命令行 -t > 环境变量 DAST_TIMEOUT > 默认 20000。个别慢工具建议用 -t 临时加长,不必改全局环境变量。
快速入门
# 列出全部工具
dast list
# 导出 Schema(供 Agent 初始化)
dast schema
# 查看某个工具的参数说明
dast info dast_flight_dynamic
# 调用工具
dast call dast_flight_dynamic -a '{"fnum":"CA1831","date":"2026-09-09"}'命令速查
| 命令 | 说明 |
| :--- | :--- |
| dast list | 列出 dast_mcp 下全部工具 |
| dast schema | 导出工具 Schema(JSON) |
| dast info <tool> | 查看工具描述与参数 |
| dast call <tool> -a '<json>' | 调用工具;可用 -t / --timeout 设置超时 |
输出格式:list / call 支持 -o json 或 -o table(call 默认 json)。
退出码
| Exit Code | 名称 | 说明 |
| :--- | :--- | :--- |
| 0 | SUCCESS | 成功 |
| 101 | GATEWAY_ERROR | 网关/网络错误 |
| 102 | NOT_FOUND | 工具不存在 |
| 103 | INVALID_ARGS | 参数非法(含 JSON 解析失败) |
| 104 | UNAUTHORIZED | 认证失败 |
| 105 | TIMEOUT | 超时 |
| 106 | INTERNAL_ERROR | CLI 内部错误 |
Agent 集成
- 启动时执行
dast schema,将工具定义注入模型。 - 按用户意图选择 tool,用
dast info <tool>核对参数(或直接读 schema)。 - 执行
dast call <tool> -a '<json>'。 - 按 Exit Code 决定重试或修正参数。
安装包时会通过 postinstall 尝试把 skills/SKILL.md 复制到 Cursor / Claude 等 Agent 的 skills 目录。
与 aviation-dast-mcp 的关系
| 包 | 形态 | 场景 |
| :--- | :--- | :--- |
| @flightmaster/aviation-dast-mcp | stdio MCP bridge | Cursor / Claude 原生 MCP |
| @flightmaster/dast-cli | Shell CLI | Agent Skill、脚本、本地调试 |
二者共用同一上游 dast_mcp。
License
ISC
