pub(crate) struct Cli {
pub(crate) gateway: String,
pub(crate) verbose: bool,
pub(crate) keys_file: Option<PathBuf>,
pub(crate) api_key: Option<String>,
pub(crate) enable_trading: bool,
pub(crate) allow_real_trading: bool,
pub(crate) audit_log: Option<PathBuf>,
pub(crate) http_listen: Option<String>,
}Expand description
FutuOpenD-rs MCP server
Fields§
§gateway: String网关地址(可用 FUTU_GATEWAY 环境变量覆盖)
verbose: bool启用 debug 日志
keys_file: Option<PathBuf>Scope 模式:加载 keys.json 文件(API Key 授权)。
启用后所有工具调用必须带 FUTU_MCP_API_KEY 环境变量, scope / 限额由 keys.json 配置决定;此时 –enable-trading / –allow-real-trading 被忽略。
api_key: Option<String>调用方 API Key 明文(等价于 FUTU_MCP_API_KEY 环境变量)
生产环境强烈建议用环境变量而非命令行参数(后者会进 ps 输出)。
enable_trading: bool[Legacy] 启用交易写工具(place / modify / cancel)。默认关闭。
开启后默认仅允许 simulate 环境;要操作真实账户需额外 –allow-real-trading。 注意:下单前网关必须已 unlock_trade(密码不经过 MCP / LLM)。 若提供了 –keys-file,此开关被忽略,改由 key 的 scope 决定。
allow_real_trading: bool[Legacy] 允许交易写工具对 real 环境执行。必须与 –enable-trading 搭配。
audit_log: Option<PathBuf>审计日志输出:JSONL 文件路径或目录
- 带扩展名(
/var/log/futu-mcp-audit.jsonl)→ 单文件 append - 不带扩展名 / 以
/结尾 → 每日滚动futu-audit.log+ 日期
只记录 auth / 交易 事件(target = futu_audit)。
http_listen: Option<String>以 HTTP transport 启动(streamable HTTP),监听该端口(格式 host:port 或 :port)
默认 stdio:LLM 客户端启子进程走 stdin/stdout。开 HTTP 后可以让多个
客户端连同一个 MCP 进程,并同时暴露 /metrics。per-call key 覆盖依然
走 tool args 的 api_key 字段;HTTP-layer 的 Authorization header 未来
版本再接(v1.0 先做传输层切换)。
例:--http-listen 127.0.0.1:3000 / --http-listen :3000
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.