loading…
Search for a command to run...
loading…
Enables automated device blocking and unblocking operations with authentication, whitelist, and confirmation modes for AF security devices.
Enables automated device blocking and unblocking operations with authentication, whitelist, and confirmation modes for AF security devices.
这是一个基于 FastMCP 最新版本构建的 AiPy 扩展脚手架,用于后续接入 AF 设备联动封禁能力。
device_block_agent/:核心 Python 源码与 MCP 工具实现。docs/:API 整理文档、方案文档与原始 PDF。assets/:图标等静态资源。examples/:白名单样例和参考素材。main.py、manifest.json、requirements.txt、README.md 等项目入口文件。/mcp。addition-system-instruction prompt。auth_login、auth_keepalive、auth_logout、get_confirm_mode、set_confirm_mode 五个认证与风控配置工具。agent_info,用于验证 AiPy 到 MCP 服务的发现链路。block_clear_attackers 已升级为前后基线对比判定。pip install -r requirements.txtpython main.py仓库额外提供了一个基于 docs/ip-ban-api.md 自动生成的本地 API 测试平台。
python run_api_test_platform.pyhttp://127.0.0.1:8010测试平台特性:
examples/whitelist.sample.json 提供本地白名单示例。confirm_mode 支持 手动 和 自动 两种模式,也兼容旧值 manual 和 auto。WHITELIST_FILE 和 CONFIRM_MODE 可通过 manifest.json 的 user_config 注入运行环境。set_confirm_mode 工具切换后,会写入本地 CONFIRM_MODE_FILE,默认路径为 data/confirm-mode.json。set_whitelist_file 工具切换后,会写入本地白名单配置文件,默认路径为 data/whitelist-config.json。CONFIRM_MODE > 默认值 手动。WHITELIST_FILE > 默认样例文件。手动 模式下所有写操作都要求显式确认;自动 模式下仅高风险写操作要求显式确认。LOG_FILE 可用于指定本地 JSONL 审计日志路径。SESSION_FILE 可用于指定本地 JSON 会话持久化路径。SESSION_TIMEOUT_SECONDS 和 SESSION_REFRESH_WINDOW_SECONDS 可用于控制本地会话超时与自动保活窗口。af_host 用于配置默认 AF 主机地址。af_namespace 用于配置默认命名空间,默认 public。af_username 和 af_password 用于配置默认登录账号。af_verify_tls 用于配置默认 HTTPS 证书校验开关。auth_login、auth_keepalive、auth_logout 以及封禁相关工具都可直接复用这些默认值。agent_infoauth_loginauth_keepaliveauth_logoutaccount_config_statusget_confirm_modeset_confirm_modeget_whitelist_configget_whitelist_rulesset_whitelist_filecheck_whitelist_targetsblock_list_exceptionsblock_add_exceptionsblock_delete_exceptionsblock_update_exceptionsblock_update_exceptionblock_list_attackersblock_list_tempblock_list_businessblock_get_total_countblock_get_block_timeblock_add_attackersblock_delete_attackersblock_add_businessblock_delete_tempblock_delete_businessblock_clear_attackersblock_clear_tempblock_clear_businessblock_set_block_timeAdd this to claude_desktop_config.json and restart Claude Desktop.
{
"mcpServers": {
"af-mcp": {
"command": "npx",
"args": []
}
}
}