Introduction¶
On small Linux servers, handling SSH brute-force attacks and suspicious web requests often relies on manually digging through logs and writing iptables rules. Full-blown SIEM or heavy EDR solutions are often too costly for VPS or personal nodes, while pure scripts are difficult to align with daily AI Agent workflows. This article introduces Mini-HIDS on SkillHub: a lightweight host detection and banning capability encapsulated as a universal Skill, allowing Agents to query status, read alerts, and execute bans via local MCP.
What is This¶
Mini-HIDS is located at @user_9a8108cb/minihids on SkillHub. The current version is v1.2.6, sourced from the community (community), categorized under it-ops-security (subcategories include server operations and security scanning), and published by user_9a8108cb (displayed as author netkr). The official one-liner description is: Use an Agent to take over your server firewall (send the link to an Agent to encapsulate it as a skill).
The Skill package is based on the standard SKILL.md format, corresponding to the underlying GitHub project netkr/mini-hids: a lightweight Linux host intrusion detection system implemented with the Python standard library, focusing on single-machine use, auditability, and native Agent integration. The SkillHub tags indicate requires_api_key=false, meaning installing the Skill does not depend on an additional API Key.
Core Features¶
The following capabilities are derived from the SKILL.md and module descriptions within the Skill package; only explicitly documented capabilities are listed.
- Logs & Detection: Sliding time window statistics for SSH login failures; identification of obvious attack payloads in web access logs; incremental webshell heuristic scanning for common script directories.
- Banning & Persistence: Ban status is written to SQLite; supports firewall backends like iptables, nftables, and fail2ban (auto-detected or explicitly configured).
- Agent / MCP:
mcp_server.pyexposes MCP tools via stdio for Agent invocation, serving as the interface for Agents rather than a human-facing CLI entry point. - MCP Tools (currently exposed list):
mini_hids_statusmini_hids_get_alertsmini_hids_get_blacklistmini_hids_ban_ipmini_hids_unban_ipmini_hids_scan_webshell
Key code roles: mini_hids.py (daemon); hids_core.py (control plane API); hids_common.py (configuration, persistence, and firewall logic); config.json (shared configuration for daemon and MCP).
The SkillHub page sidebar shows approximately 1168 downloads for this Skill; Tencent Security scan results in the page metadata indicate “Safe, No Risk” (refer to the SkillHub details page for the specific report chain).
Installation & Activation¶
Installing to Agent via SkillHub¶
The installation prompt provided on the official page is: read the SkillHub installation documentation first, then install this Skill.
Please install @user_9a8108cb/minihids according to https://skillhub.cn/install/skillhub.md.
If the skillhub CLI is already installed, you need to install the Skill to the current Agent’s skills directory (the documentation requires using --dir, otherwise the default ./skills/ might not be recognized). Example:
command -v skillhub && skillhub --version
skillhub install @user_9a8108cb/minihids --dir <your Agent skills directory>
Common paths (excerpted from SkillHub installation documentation):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
You can also download the Zip from SkillHub (the page link looks like https://api.skillhub.cn/api/v1/download?slug=@user_9a8108cb/minihids, corresponding to v1.2.6), extract it, and place the Skill directory in the skills paths mentioned above. The page also provides an “Install to Local Agent” entry (marked as supporting clients like WorkBuddy).
Running Detection & MCP on the Target Server¶
The typical server-side steps described in the Skill documentation are as follows:
- Modify
config.jsonaccording to the environment (log paths, web root, ban duration,TRUSTED_IPS, etc.). - Start the daemon (usually requires root to read logs and write to the firewall):
sudo python3 mini_hids.py
- Start the local MCP service:
python3 mcp_server.py
- Configure the stdio startup method in your MCP client, for example:
{
"mcpServers": {
"mini-hids": {
"command": "python3",
"args": ["/absolute/path/to/mini-hids/mcp_server.py"]
}
}
}
The Skill package also includes examples/claude_desktop_mcp.json for path replacement reference.
Another way to get started (stated in the Skill): send https://github.com/netkr/mini-hids to an Agent and ask “Help me encapsulate this project as a skill,” allowing the Agent to complete the cloning and MCP encapsulation. This is an alternative to the pre-encapsulated version on SkillHub; choose based on your actual workflow.
Typical Usage¶
Initial deployment after encapsulation: Edit LOG_PATHS, WEB_ROOT, MAX_FAILURES, WINDOW_SECONDS, BAN_TIME, etc. in config.json, then run sudo python3 mini_hids.py to start the daemon.
Agent queries status: Call mini_hids_status via MCP, returning structured JSON, for example:
{
"success": true,
"data": {
"is_running": true,
"pid": 12345,
"firewall_backend": "iptables"
}
}
Responding to security incidents: The Agent can read mini_hids_get_alerts, check mini_hids_get_blacklist, and then call mini_hids_ban_ip / mini_hids_unban_ip as needed; mini_hids_scan_webshell can be called for immediate web directory scanning.
Configuration should only be changed in config.json; do not modify the Python source code manually. IPs in TRUSTED_IPS will not be banned by the daemon or MCP; leaving FIREWALL_BACKEND empty indicates auto-detection.
Use Cases & Caveats¶
Suitable for: VPS, small business machines, personal operation nodes; where detection logic should be simple and readable; where AI Agents are used for query and ban orchestration via MCP in a local high-privilege environment.
Not suitable for (explicitly stated in the Skill): Multi-host correlation analysis, kernel-level telemetry, or production-grade security platforms requiring extremely low false positive rates.
Notes:
- Risk of false bans: Improper maintenance of
TRUSTED_IPSmay lock yourself out of the machine; banning operations should be treated as high-privilege actions. - Heuristic detection: Web attack and webshell detection are based on heuristic rules; alerts should be treated as signals rather than final verdicts.
- Deployment topology: MCP and the daemon should be deployed on the same side to access local logs and firewalls; remote Agents need to resolve SSH and permission boundaries themselves. The Skill documentation emphasizes that local or server-side MCP is the reasonable access method.
Conclusion¶
The Mini-HIDS Skill consolidates single-machine log detection, SQLite blacklists, and firewall actions into a set of MCP tools callable by Agents. It is suitable for one-click installation into clients like Cursor and Claude Code via SkillHub, followed by starting the daemon and mcp_server.py on the target Linux host according to config.json.
Official Entry Points:
- SkillHub Page: https://www.skillhub.cn/skills/user_9a8108cb/minihids
- API Coordinates: https://api.skillhub.cn/user_9a8108cb/minihids
- Upstream Project: https://github.com/netkr/mini-hids