AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP unreviewed MIT Self-run

Defense Mcp Server

mcp-bottobot-defense-mcp-server Β· by bottobot

πŸ›‘οΈ Defensive Security & System Hardening MCP Server for Linux β€” 31 tools with 250+ actions for blue team ops, compliance, hardening & incident response. DEFENSIVE USE ONLY.

β€” No reviews yet
0 installs
38 views
0.0% view→install

Install

$ agentstack add mcp-bottobot-defense-mcp-server

Open-source listing, not yet scanned by AgentStack. Follow the source repository for install instructions.

Security review

⚠ Flagged

1 finding(s); flagged for manual review. Β· v0.1.0 How review works β†’

  • β€’ Prompt-injection patterns
  • β€’ Secret / credential exfiltration
  • β€’ Dangerous shell & filesystem operations
  • β€’ Untrusted network calls
  • β€’ Known-malicious package signatures
  • high Pipes remote content directly into a shell (remote code execution).

What it can access

  • ● Network access Used
  • βœ“ Filesystem access No
  • βœ“ Shell / process execution No
  • βœ“ Environment & secrets No
  • βœ“ Dynamic code execution No

From automated source analysis of v0.1.0. β€œUsed” means the capability is present in the source β€” more access means more to trust, not that it’s unsafe.

View the full security report β†’

Reliability & compatibility

β€” Not yet reviewed
0 installs to date
β€” no reviews yet
● 2mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work β†’
Are you the author of Defense Mcp Server? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Defense MCP Server

[](https://smithery.ai/server/@bottobot/defense-mcp-server) [](https://www.npmjs.com/package/defense-mcp-server) [](LICENSE) [](https://github.com/sponsors/bottobot) [](https://ko-fi.com/bottobot)

31 defensive security tools. 250+ actions. One MCP server.

A Model Context Protocol (MCP) server that gives AI assistants access to 31 defensive security tools (with 250+ actions) on Linux. Connect it to Claude Desktop, Cursor, Smithery, or any MCP-compatible client to harden systems, manage firewalls, scan for vulnerabilities, and enforce compliance β€” all through natural language conversation.

TLDR ###

It's an all-in-one easy to use MCP server that will help you secure your Linux OS and harden it to external attackers. It's not perfect by any stretch but if you need something that'll take the pain out of hardening a fresh OS install then give it a try. It's as simple as saying "give me a full security audit using the Defense MCP Server" to your favourite LLM agent.

The Story Of This Thing ##

I started experimenting with Kali and I had a weird thought that if someone ever gained control of that system they could do some damage in my network. I found it came with all sorts of interesting defensive tools besides the obvious offensive ones and so I started messing around with automating the hardening process. Eventually I left Kali to the hackers and just switched to a Debian 13 vanilla type setup on my daily driver. All those hacker tools just made me nervous! However I have spent an incredible amount of time learning about system security on Linux building this thing and I think its ready to see the light of day for others to use.

Please don't hesitate to leave feedback or if you think there's a good tool I should include.

Testing So Far ##

So my stack for this that I've tested is VS Codium on Kali and Debian 13 using Roo Code and Claude Code using Anthropic Models. I gotta say I'm pretty happy with how well it does. I've really tried to get it to be a simple all-in-one hardening tool that'll at least plug the major gaps in anyones system. If you're using API's then its really gonna chug down some tokens so be warned. It did go through a few rounds of token efficiency optimisation but it'll eat em up like their Girl Guides Thin Mint cookies.


Install

npm install -g defense-mcp-server

Or via Smithery:

npx -y @smithery/cli install @bottobot/defense-mcp-server --client claude

So What It Does

This server exposes Linux security tools as MCP tools that an AI assistant can invoke on your behalf. Instead of memorizing command syntax for dozens of security utilities, you describe what you want in plain English and the assistant calls the right tool with the right parameters. Sounds pretty good right?

Here are the tools:

| Module | What It Does | |--------|-------------| | Firewall | Manage iptables, nftables, and UFW rules | | Hardening | Apply sysctl settings, file permissions, kernel security, USB device control | | Compliance | Run CIS benchmarks, HIPAA/SOC2/ISO27001 checks | | Patch Management | Check for updates, apply patches, track CVEs | | Access Control | Configure SSH, PAM, user account policies | | Malware | Scan with ClamAV, manage quarantine, deploy YARA rules | | File Integrity | AIDE, rootkit detection, file hashing, drift baselines | | Logging | Set up auditd rules, log rotation, fail2ban | | Encryption | Manage TLS certificates, LUKS volumes, GPG keys | | Certificate Lifecycle | Inventory certs, check renewal, audit CA trust store, OCSP, CT logs | | Backup | Create and restore system state snapshots | | Container Security | AppArmor profiles, seccomp policies, image scanning | | Network Defense | Packet capture, connection monitoring, port scanning | | Network Segmentation | Map zones, verify isolation, test paths, audit VLANs | | Secrets | Scan for leaked credentials, audit SSH keys | | Incident Response | Collect volatile evidence, IOC scan, filesystem timeline | | Forensics | Memory dumps, disk imaging, evidence chain of custody | | eBPF Security | Deploy Falco rules, list eBPF programs | | Supply Chain | SBOM generation, package integrity verification | | Zero Trust Network | WireGuard tunnels, mTLS, microsegmentation | | App Hardening | Harden Apache, Nginx, MySQL, PostgreSQL, Docker | | Sudo Management | Manage sudo elevation, session tracking | | Meta/Workflow | Security posture assessment, defense workflows, auto-remediation | | DNS Security | DNSSEC validation, tunneling detection, domain blocklists, query log analysis | | Vulnerability Management | nmap/nikto scanning, vulnerability lifecycle tracking, risk prioritization | | Process Security | Capability auditing, namespace isolation, anomaly detection | | WAF Management | ModSecurity audit/rules, OWASP CRS deployment, rate limiting | | Threat Intelligence | IP/hash/domain checks against feeds, blocklist application | | Cloud Security | AWS/GCP/Azure detection, IMDS security, IAM credential scanning | | API Security | Local API discovery, auth auditing, rate-limit testing, CORS checking | | Deception/Honeypots | Canary token deployment, honeyport listeners, trigger monitoring | | Wireless Security | Bluetooth/WiFi auditing, rogue AP detection, interface disabling |

Safety Guardrails

Every tool runs with safety guardrails β€” you won't blow up your box:

  • Dry-run by default β€” tools preview what they would do before making changes
  • Command allowlist β€” only pre-approved binaries can execute (no shell interpreters)
  • Input sanitization β€” all parameters validated against injection attacks
  • Backup before changes β€” system state backed up before modifications
  • Rate limiting β€” prevents runaway tool invocations

Automatic Tool Installation

You don't need to pre-install every security tool. The server automatically detects missing dependencies and installs them when needed.

How it works:

  1. Each tool declares which system binaries it requires (e.g., firewall_iptables needs iptables or ufw)
  2. Before executing a tool, the server checks if the required binary is installed
  3. If it's missing, the server installs it using your system's package manager (apt on Kali/Debian, dnf on RHEL, pacman on Arch)
  4. The tool then runs normally

Example: If you ask the assistant to scan for malware but ClamAV isn't installed, the server will run apt install clamav automatically, then proceed with the scan.

Security controls on auto-installation:

  • System packages are installed via the official package manager only
  • npm/pip packages are restricted to a hardcoded allowlist (e.g., yara-python, cdxgen) β€” arbitrary packages cannot be installed
  • Auto-installation requires sudo privileges β€” if running without elevated access, the server will report what needs to be installed manually
  • All installation actions are logged

To disable auto-installation entirely, run with:

DEFENSE_MCP_AUTO_INSTALL=false node build/index.js

Requirements

  • Linux (Kali, Debian, Ubuntu, RHEL, Arch, or any systemd-based distro)
  • Node.js 22+
  • npm 9+

System Dependencies

Most tools will be auto-installed on first use, but you can pre-install everything for faster startup:

Standard Packages (apt)

sudo apt-get install -y \
  aide rkhunter chkrootkit clamav clamav-daemon lynis auditd \
  nmap tcpdump nftables fail2ban apparmor apparmor-utils \
  libpam-pwquality suricata bpftool gitleaks cosign checksec \
  wireguard-tools debsums acct uidmap inotify-tools sysstat \
  htop strace logrotate openssl gnupg cryptsetup curl lsof

Third-Party Tools

These are not available in standard Debian/Ubuntu repos. The instructions below avoid piping remote scripts into a shell (curl | sh) β€” each binary is downloaded, verified, and installed as a discrete step.

> Note: The MCP server can auto-install these tools for you when DEFENSE_MCP_AUTO_INSTALL=true (the default). It uses GPG fingerprint and SHA256 verification internally. The manual steps below are for pre-installation or air-gapped environments.

Falco (eBPF runtime security)
# Import GPG key and verify fingerprint
curl -fsSL https://falco.org/repo/falcosecurity-packages.asc -o /tmp/falco.asc
gpg --show-keys /tmp/falco.asc  # Verify: 478B 2FBB C75F 4237 B731 DA43 6510 6822 B35B 1B1F
sudo gpg --dearmor -o /usr/share/keyrings/falco-archive-keyring.gpg /tmp/falco.asc
rm /tmp/falco.asc

# Add signed repo and install
echo "deb [signed-by=/usr/share/keyrings/falco-archive-keyring.gpg] https://download.falco.org/packages/deb stable main" \
  | sudo tee /etc/apt/sources.list.d/falcosecurity.list
sudo apt-get update && sudo apt-get install -y falco
Trivy (container image scanning)
# Import GPG key and verify fingerprint
curl -fsSL https://aquasecurity.github.io/trivy-repo/deb/public.key -o /tmp/trivy.asc
gpg --show-keys /tmp/trivy.asc  # Verify: 2E2D 3567 4616 32C8 4BB6 CD6F E9D0 A361 6276 FA6C
sudo gpg --dearmor -o /usr/share/keyrings/trivy-archive-keyring.gpg /tmp/trivy.asc
rm /tmp/trivy.asc

# Add signed repo and install
echo "deb [signed-by=/usr/share/keyrings/trivy-archive-keyring.gpg] https://aquasecurity.github.io/trivy-repo/deb generic main" \
  | sudo tee /etc/apt/sources.list.d/trivy.list
sudo apt-get update && sudo apt-get install -y trivy
Grype (vulnerability scanning)
VERSION=v0.110.0
curl -fsSL -o /tmp/grype.tar.gz \
  "https://github.com/anchore/grype/releases/download/${VERSION}/grype_${VERSION#v}_linux_amd64.tar.gz"
curl -fsSL -o /tmp/grype.tar.gz.sha256 \
  "https://github.com/anchore/grype/releases/download/${VERSION}/grype_${VERSION#v}_checksums.txt"

# Verify checksum
cd /tmp && grep "linux_amd64.tar.gz" grype.tar.gz.sha256 | sha256sum -c -
tar xzf grype.tar.gz grype && sudo install grype /usr/local/bin/grype
rm -f /tmp/grype /tmp/grype.tar.gz /tmp/grype.tar.gz.sha256
Syft (SBOM generation)
VERSION=v1.42.3
curl -fsSL -o /tmp/syft.tar.gz \
  "https://github.com/anchore/syft/releases/download/${VERSION}/syft_${VERSION#v}_linux_amd64.tar.gz"
curl -fsSL -o /tmp/syft_checksums.txt \
  "https://github.com/anchore/syft/releases/download/${VERSION}/syft_${VERSION#v}_checksums.txt"

# Verify checksum
cd /tmp && grep "linux_amd64.tar.gz" syft_checksums.txt | sha256sum -c -
tar xzf syft.tar.gz syft && sudo install syft /usr/local/bin/syft
rm -f /tmp/syft /tmp/syft.tar.gz /tmp/syft_checksums.txt
TruffleHog (secret scanning)
VERSION=v3.94.1
curl -fsSL -o /tmp/trufflehog.tar.gz \
  "https://github.com/trufflesecurity/trufflehog/releases/download/${VERSION}/trufflehog_${VERSION#v}_linux_amd64.tar.gz"
curl -fsSL -o /tmp/trufflehog_checksums.txt \
  "https://github.com/trufflesecurity/trufflehog/releases/download/${VERSION}/trufflehog_${VERSION#v}_checksums.txt"

# Verify checksum
cd /tmp && grep "linux_amd64.tar.gz" trufflehog_checksums.txt | sha256sum -c -
tar xzf trufflehog.tar.gz trufflehog && sudo install trufflehog /usr/local/bin/trufflehog
rm -f /tmp/trufflehog /tmp/trufflehog.tar.gz /tmp/trufflehog_checksums.txt
slsa-verifier (supply chain verification)
VERSION=v2.7.1
curl -fsSL -o /tmp/slsa-verifier \
  "https://github.com/slsa-framework/slsa-verifier/releases/download/${VERSION}/slsa-verifier-linux-amd64"
curl -fsSL -o /tmp/slsa-verifier.sha256 \
  "https://github.com/slsa-framework/slsa-verifier/releases/download/${VERSION}/slsa-verifier-linux-amd64.sha256"

# Verify checksum
cd /tmp && echo "$(cat slsa-verifier.sha256)  slsa-verifier" | sha256sum -c -
sudo install slsa-verifier /usr/local/bin/slsa-verifier
rm -f /tmp/slsa-verifier /tmp/slsa-verifier.sha256
cdxgen (CycloneDX SBOM generation)
npm install -g @cyclonedx/cdxgen

Important Notes

  • snort β†’ suricata: Snort has been removed from Debian Trixie (13+) repositories. Suricata is the recommended IDS replacement and is available in standard repos.
  • ufw vs nftables: UFW conflicts with iptables-persistent β€” they cannot coexist on the same system. For modern Debian systems, prefer nftables (the nft command) for firewall management.
  • bpftool: On Debian Trixie, install the bpftool package directly (NOT linux-tools-generic which is Ubuntu-specific).
  • pam_pwquality: This is a PAM module (libpam-pwquality), not a standalone binary. Install via apt-get install libpam-pwquality.

Quick Start

Step 1: Install the server

Pick one method:

npm (recommended):

npm install -g defense-mcp-server

Or clone and build from source:

git clone https://github.com/bottobot/defense-mcp-server.git
cd defense-mcp-server
npm install && npm run build

Step 2: Connect to your AI client

The server supports any MCP client. Pick your client below and add the configuration:

Claude Code (CLI / VS Code / JetBrains):

Create a .mcp.json file in your project root (or ~/.claude/ for global):

{
  "mcpServers": {
    "defense-mcp-server": {
      "command": "defense-mcp-server",
      "env": {
        "DEFENSE_MCP_DRY_RUN": "true",
        "DEFENSE_MCP_ALLOWED_DIRS": "/tmp,/home,/var/log"
      }
    }
  }
}

Claude Desktop:

Edit ~/.config/claude/claude_desktop_config.json (Linux) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "defense-mcp-server": {
      "command": "defense-mcp-server"
    }
  }
}

Restart Claude Desktop. The server will appear in the MCP tools panel.

Cursor / Other MCP clients:

{
  "mcpServers": {
    "defense-mcp-server": {
      "command": "defense-mcp-server"
    }
  }
}

If you cloned and built from source, replace "defense-mcp-server" in the command field with:

"command": "node",
"args": ["/path/to/defense-mcp-server/build/index.js"]

Step 3: Verify it works

Open your AI client and ask:

> "Check my firewall status"

The assistant should call the firewall tool and return your iptables/UFW rules. If it does, you're all set.

Step 4: Elevate when needed

Most audit tools (listing firewall rules, checking patches, reading logs) work without sudo. When a tool needs elevated privileges, the server will tell you. Elevate securely:

> "Elevate sudo with GUI dialog"

This opens a native password dialog (zenity/kdialog) β€” your password never passes through the AI conversation. The session auto-expires after 15 minutes, or you can drop it anytime:

> "Drop sudo privileges"

What happens on first run

  1. Dry-run mode is on by default β€” tools preview what they would do without changing anything
  2. Missing tools are auto-installed β€” if you ask for a malware scan but ClamAV isn't installed, the server installs it via apt/dnf automatically
  3. All file access is restricted β€” only /tmp, /home, and /var/log are accessible by default

To enable live changes (not just previews), set DEFENSE_MCP_DRY_RUN=false in the env config above.

Usage Examples

Once connected, talk to your AI assistant naturally:

  • "Check my firewall status" β†’ calls firewall_iptables with action: list
  • "Harden SSH to disable root login and password auth" β†’ calls access_ssh with harden action and appropriate settings
  • "Run a CIS benchmark on this system" β†’ calls compliance_check with CIS framework
  • "Scan /var/www for malware" β†’ calls malware_clamav on the specified path
  • "Show me what patches are available" β†’ calls patch_update_audit
  • "Create a backup before I make changes" β†’ calls backup with state action
  • "Set up fail2ban for SSH" β†’ calls log_fail2ban to configure jail
  • "Check if any cloud credentials are exposed" β†’ calls cloud_security with `check_

…

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source β€” we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.