Skip to main content

Crate futu_mcp

Crate futu_mcp 

Source
Expand description

FutuOpenD-rs MCP 服务器

通过 Model Context Protocol 把 Futu 行情/账户能力暴露给 Claude / LLM 客户端。

授权有两种模式:

  • Scope 模式--keys-file <path> 启用。stdio 客户端通过 FUTU_MCP_API_KEY 提供进程级 key;HTTP 客户端的每个 /mcp 请求必须 携带有效 Authorization: Bearer。服务器按 scope + 限额放行。
  • Legacy 模式:未提供 keys-file 时回退到旧的 --enable-trading / --allow-real-trading 两级开关。

Modules§

card_num_expand 🔒
Standalone MCP allowed_card_nums expansion helpers.
guard 🔒
Scope 守卫 + 限额检查 + 审计日志
handlers 🔒
工具实现(按域拆分)
http 🔒
qot_sdk_adapter 🔒
state 🔒
共享状态:网关连接 + 订阅状态 + 授权
tool_account 🔒
MCP account-locator helpers shared by thin tool wrappers.
tool_args 🔒
MCP tool request/parameter schemas.
tool_auth 🔒
MCP caller-auth helper types and pure policy decisions.
tool_enums 🔒
v1.4.84 §5 B2: 结构化 MCP tool enum 类型 + 泛型 int/string 双接 deserializer
tools 🔒
MCP 工具实现;公开 wrapper/catalog 由 surface manifest 静态生成,业务逻辑在 handlers/。
trade_pwd 🔒
交易密码来源封装
transport 🔒
Resilient stdio transport for MCP server (v1.4.90 P0-A).
trd_sdk_adapter 🔒

Structs§

Cli 🔒
FutuOpenD-rs MCP server
FileConfig 🔒
TOML 配置文件映射——字段名与 CLI 参数完全一致
RmcpDrainEventFields 🔒
SuppressExpectedRmcpDrainClose 🔒

Functions§

is_cli_explicit 🔒
codex 0547 F5 (P3) fix: clap ValueSource 区分 “CLI 显式传” vs “默认值”.
is_expected_rmcp_drain_close 🔒
main 🔒
serve_stdio 🔒
stdio 模式:MCP 客户端启动子进程,stdin/stdout 传协议帧
setup_logging 🔒
初始化 stderr 日志 + 可选 audit JSONL 层