Install
openclaw skills install fn-knock-mcpManage fn-knock gateway via its admin API — reverse proxy, DDNS, SSL/ACME, tunnels (FRP/Cloudflared), scanner, whitelist, and more. Requires fn-knock running on localhost:7998.
openclaw skills install fn-knock-mcpfn-knock is a self-hosted gateway/reverse proxy solution for NAS and home lab environments. This MCP Server exposes its admin API (100+ endpoints) as structured tools for AI assistants.
pip install mcp requests
# or with uv
uv tool install fn-knock-mcp # (if published to PyPI)
If installing from source:
cd fn_knock_mcp
pip install -e .
fn-knock's admin API requires HMAC authentication. The MCP auto-resolves the secret using this priority:
方式 A — 环境变量(推荐)
export FN_KNOCK_HMAC_SECRET="your-secret-here"
方式 B — 凭证文件
mkdir -p ~/.config/fn-knock
echo "HMAC_SECRET=your-secret-here" > ~/.config/fn-knock/credentials
chmod 600 ~/.config/fn-knock/credentials
方式 C — 自动检测(仅限本地运行 fn-knock) 如果 fn-knock 正在本机运行(http://localhost:7998),MCP 会自动从页面 HTML 中提取密钥,无需额外配置。
Edit your ~/.openclaw/openclaw.json (or use the OpenClaw web UI):
{
"mcpServers": {
"fn-knock": {
"command": "python",
"args": ["-m", "fn_knock_mcp.server"],
"env": {
"FN_KNOCK_BASE_URL": "http://localhost:7998/api/admin"
}
}
}
}
Or reference the provided mcp.json:
{
"mcpServers": {
"fn-knock": {
"command": "python",
"args": ["-m", "fn_knock_mcp.server"]
}
}
}
Note: The HMAC secret is resolved at startup via env file or auto-detection — do NOT put it in mcp.json.
If fn-knock needs to reach external services (GitHub API, DNS providers, etc.) and you're behind a proxy:
export HTTP_PROXY=http://192.168.31.21:7890
export HTTPS_PROXY=http://192.168.31.21:7890
fnknock_dashboard_stats — Traffic/auth/threat stats (configurable time range)fnknock_realtime_traffic — Current real-time bytes in/outfnknock_get_config — Full gateway configfnknock_update_run_type — Switch mode: direct / reverse_proxy / subdomain_proxy / tunnelfnknock_sync_routes — Trigger immediate route reloadfnknock_get_host_mappings — List all host → target rulesfnknock_add_host_mapping — Add a reverse proxy rulefnknock_delete_host_mapping — Remove a rule by hostfnknock_get_stream_mappings — List port mappingsfnknock_update_stream_mappings — Replace all stream mappingsfnknock_frp_status / frp_start / frp_stop — FRP tunnel controlfnknock_cloudflared_status / cloudflared_start / cloudflared_stopfnknock_ssl_status — Certificate library statusfnknock_acme_overview — ACME jobs & applicationsfnknock_acme_dns_providers — Supported DNS providersfnknock_acme_create_application — Create and submit a cert requestfnknock_ddns_status — Current DDNS state and last IPfnknock_ddns_toggle — Enable/disable DDNSfnknock_ddns_save_config — Save provider configfnknock_ddns_test — Test connectivity and detect public IPfnknock_get_auth_settings — Auth settings (session timeout, 2FA)fnknock_get_totp_status — TOTP 2FA statusfnknock_totp_setup — Initiate TOTP enrollmentfnknock_totp_bind — Complete TOTP bindingfnknock_passkey_list — List registered passkeysfnknock_whitelist_list / whitelist_add / whitelist_deletefnknock_ip_lookup — Batch IP geolocation lookup (up to 20 IPs)fnknock_scanner_settings — Path scanner configfnknock_scanner_blacklist — Blocked suspicious IPsfnknock_scanner_toggle — Enable/disable scanner protectionfnknock_get_events — System event log (filterable)fnknock_delete_events — Delete events by IDfnknock_gateway_logs_dates — Dates with gateway logsfnknock_gateway_logs_entries — Access logs for a datefnknock_notifications_providers — Notification channelsfnknock_notifications_rules — Notification rulesfnknock_notifications_triggers — Historical notification trigger records (可按 status/rule_id 筛选)fnknock_notifications_deliveries — Historical delivery records (可按 status/provider_id/rule_id/trigger_id 筛选)fnknock_notifications_deliveries_clear — Clear delivery records (不传参数则清空全部)fnknock_gateway_settings / gateway_updatefnknock_gateway_visibility — Regional visibility configfnknock_system_reset_firewall — Reset firewall for a run typefnknock_system_dnsmasq_status — DNS proxy statusfnknock_sessions_list — Active user sessionsfnknock_session_kick — Kick a sessionfnknock_terminal_status / terminal_sessions — tmux managementfnknock_backoff_list / backoff_reset — Rate limit statefnknock_backup_export / backup_importfnknock_update_check — Check for fn-knock updatesfnknock_traffic_stats — Traffic statisticsIf fn-knock is running, open its web UI at http://localhost:7998 and check:
x-timestamp, x-nonce, x-signature headers__FN_KNOCK_HMAC_SECRET__The secret is a 64-char hex string. Create the credentials file with it:
mkdir -p ~/.config/fn-knock
echo "HMAC_SECRET=42e0a9e578284ad8313752293a3079680b377c249e0e3306527442b363a4cd78" \
> ~/.config/fn-knock/credentials
"Missing Required Security Headers" → HMAC secret is wrong or not resolved. Check env var or credentials file.
"Request Expired or Time Desynced"
→ System clock is out of sync. Run timedatectl set-ntp true on Linux.
MCP not loading in OpenClaw
→ Verify Python path: which python and confirm mcp package is installed there.
→ Check OpenClaw logs: openclaw logs for MCP initialization errors.
Port 7998 unreachable → fn-knock may be bound to a different interface. Check its listen address in the config.