Skip to main content
Glama
Kavach MCP Server

Kavach MCP Server

by VAMFI

Kavach

CI Python 3.11+ License: MIT SARIF 2.1.0

Agent-first, harness-agnostic defensive server security auditor, SARIF 2.1.0 correlator, Policy-as-Code gate, and read-only MCP server — built with zero external runtime dependencies.


What is Kavach? (In Plain English)

Kavach (Sanskrit for armor / shield) is a free, open-source safety layer for protecting backend servers and AI coding agents.

Most security scanners are noisy and hard for AI assistants to use safely: every tool prints a different format, secrets can accidentally leak into chat context, and blind automated fixes can lock you out of SSH or your firewall. Kavach solves this in four simple steps:

  1. Scan everything read-only: Runs built-in zero-dependency checks on your Linux/Proxmox server, websites/TLS endpoints, and AI agent MCP/skill configs — and automatically plugs into top OSS scanners (Trivy, Opengrep, Gitleaks, Checkov, Lynis, testssl.sh) when installed.

  2. Prioritize by real exposure: Checks live sockets (ss -tulnp) and firewalls (nftables, pve-firewall, ufw) so public internet risks jump to the top while scrubbing any leaked secrets before an AI sees them.

  3. Enforce Policy-as-Code: Checks findings against declarative budgets and expiring waivers (kavach policy-check) plus baseline drift (kavach diff --fail-on high).

  4. Stage lockout-safe fixes: Emits non-destructive drop-in config patches (00-kavach-sshd.conf, 99-kavach-sysctl.conf, kavach-edge-headers.conf) and human-approved runbooks with syntax checks and 120s rollback timers — never mutating your server behind your back.


Related MCP server: agent-sec-mcp

30-Second Quick Start

Prerequisites: Python >= 3.11 (standard library only — zero pip packages required).

git clone https://github.com/VAMFI/kavach.git
cd kavach

# One-command unified check (repo agent audit + external tools + policy + staged patches)
./bin/kavach protect --repo . --policy ./examples/policy.strict.json --emit-patches --out-dir /tmp/kavach-out

# Audit a Linux / Proxmox server + authorized HTTPS edge + repo together
./bin/kavach protect --host --repo . --url https://example.com --policy ./examples/policy.strict.json --emit-patches --out-dir /tmp/kavach-out

Example Output (Sanitized)

# Kavach Defensive Action Packet — `api.example.com`

- **Posture Score:** `76/100` (Grade `C`)
- **Tools Ingested:** `kavach-web`
- **Effective Counts:** critical `0` | high `2` | medium `1` | low `0` | info `0`

1. **[HIGH]** `kavach-web/HTTP-MISSING-CSP` (raw `medium`, exposure `public-internet`)
   - **Skill / Gate:** `tls-http-surface-audit` (`human-approval-lockout-safe`)
   - **Action:** Stage a conservative `Content-Security-Policy-Report-Only` policy before enforcing.

How Kavach Works

  Built-in Zero-Dep Auditors                    External OSS Scanners
  ──────────────────────────                    ──────────────────────
  • audit-host (sshd -T, nft -j, apt, auditctl, • Trivy / Checkov (SARIF)
    sysctl, perms, Proxmox pveproxy/pct)        • Opengrep / Gitleaks (SARIF)
  • audit-web (passive TLS + HTTP headers/CORS) • Lynis (.dat) / testssl.sh (.json)
  • audit-agent (MCP configs + SKILL.md safety)
                        │                                    │
                        └───────────────┬────────────────────┘
                                        ▼
                       kavach protect / correlate
                   (redact + exposure-aware risk + skill route)
                                        │
        ┌───────────────────┬───────────┴──────────┬──────────────────┐
        ▼                   ▼                      ▼                  ▼
  posture.sarif       policy-verdict         patches/           kavach diff
  & agent-brief.md    (budgets + waivers)    (00-sshd, sysctl,  (regression gate)
                                              edge headers)

CLI Reference

Command

Purpose

Mutates Host?

kavach protect

Unified orchestrator: host + repo/agent + web + external SARIF + policy + staged patches

No (read-only)

kavach audit-host

Zero-dep Linux & Proxmox VE security audit (sshd -T, nft -j, apt-get -s, auditctl, sysctl)

No (read-only)

kavach audit-web --url <URL>

Strictly passive TLS version/expiry + OWASP security header/CORS/cookie check

No (passive)

kavach audit-agent --target <DIR>

Audit MCP JSON configs & SKILL.md/AGENTS.md for secrets, unpinned runners, injection

No (read-only)

kavach policy-check

Enforce Policy-as-Code severity budgets, allowed ports, IPv6 parity, and expiring waivers

No (offline)

kavach remediate-plan

Generate phased runbook + optional --emit-patches <DIR> drop-in hardening snippets

No (read-only)

kavach correlate

Normalize, redact, exposure-weight, and export OASIS SARIF 2.1.0 + Action Packet

No (offline)

kavach diff

Compare baseline vs current posture.json; --fail-on exits 2 on regressions

No (offline)

kavach capture-exposure

Capture ss -tulnp TCP LISTEN sockets + nftables/pve-firewall summary

No (read-only)

kavach doctor

Detect installed defensive OSS scanners (trivy, opengrep, gitleaks, lynis, testssl.sh, etc.)

No (read-only)

kavach scan --target <DIR>

Run installed local read-only OSS scanners (--dry-run supported) and correlate

No (read-only)

kavach skill-map

Group findings by paired /skill-foundry SKILL.md and safety gate

No (offline)

kavach mcp

Start stdio MCP server (7 default tools, --print-manifest SHA-256 pinning, --allow-live-host-audit)

No (read-only)


Paired /skill-foundry Defensive Skills (7 Total)

Skill

Focus

Primary OSS Stack

linux-server-security-audit

Host hardening, sshd -T, nftables, Proxmox VE

sshd, nft, lynis, oscap

backend-vuln-sbom-scan

Dependencies, containers, SBOMs, IaC

trivy, syft, grype, vuls, checkov

backend-sast-secrets-audit

SAST & redacted secret hygiene

opengrep (LGPL-2.1), gitleaks --redact

tls-http-surface-audit

Passive TLS, headers, cookies, CORS, edge diff

testssl.sh, openssl, curl -sSI, kavach audit-web

linux-runtime-defense-audit

Runtime defense & FIM posture

crowdsec, falco, wazuh-agent, aide, auditd

agent-mcp-security-audit

MCP config safety, SHA-256 tool pinning, prompt safety

kavach audit-agent, kavach mcp --print-manifest

policy-as-code-sarif-gates

Policy budgets, expiring waivers, SARIF drift loops

kavach policy-check, kavach diff, OPA/Rego, DefectDojo


Documentation for Humans & AI Agents

  • For AI Agents & Harnesses: Read AGENTS.md and llms.txt for exact CLI/MCP contracts, SHA-256 tool pinning, and mandatory lockout-safe human gates.

  • Cross-Harness MCP & CI Integration: See docs/harnesses.md for Antigravity, Claude Code, Codex CLI, Cursor, Gemini CLI, GitHub Code Scanning, and DefectDojo setup.

  • Starter Strict Policy: See examples/policy.strict.json.

  • Security Policy: See SECURITY.md — strictly defensive, authorized targets only, zero offensive modules.


Verification & Contributing

PYTHONPATH=src python3 -m unittest discover -s tests -v

Contributions are welcome — see CONTRIBUTING.md.

License

MIT License — Copyright (c) 2026 VAMFI Inc. (vamfi.org). See LICENSE.

Available Tools

7 tools
kavach_audit_agentB

Audit MCP JSON configs and AI skill/instruction markdown files in a local workspace for secrets, unpinned runners, and prompt-injection hazards.

Inputs: target (required), max_findings.

kavach_correlateB

Normalize and correlate SARIF, Lynis, testssl.sh, and socket exposure files into a redacted, exposure-aware Action Packet.

Inputs: host, lynis_paths, sarif_paths, max_findings, +3 more.

kavach_diff_baselineA

Compare baseline vs current Kavach posture.json files to detect new regressions, escalations, and resolved items.

Inputs: current_path (required), baseline_path (required).

kavach_doctorB

Detect installed defensive OSS scanners (Trivy, Opengrep, Gitleaks, Checkov, Lynis, testssl.sh, CrowdSec, Falco, ss/nft) on the host.

Inputs: no named parameters.

kavach_policy_checkC

Evaluate a Kavach posture.json against a declarative Policy-as-Code JSON file with time-bounded waivers.

Inputs: policy_path (required), posture_path (required).

kavach_remediate_planB

Generate a lockout-safe, human-approved remediation runbook from an existing Kavach posture.json.

Inputs: posture_path (required).

kavach_skill_mapC

Group correlated posture findings by recommended /skill-foundry defensive skill and safety gate.

Inputs: posture_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools are cleanly separated by stage of the posture workflow: detect scanners, correlate outputs, diff baselines, map to skills, plan remediation, audit AI configs, and check policy. The closest overlap is between kavach_skill_map, kavach_remediate_plan, and kavach_policy_check, which all consume posture.json and emit guidance, but their descriptions (skill grouping vs. runbook vs. policy/waiver evaluation) give enough signal to choose correctly.

    Naming Consistency4/5

    All seven tools share a consistent kavach_ prefix and snake_case convention, making the set instantly recognizable as one family. The suffix style varies (noun like _doctor, bare verb like _correlate, noun_verb like _skill_map, _diff_baseline, _remediate_plan), which is a minor deviation from a strict verb_noun pattern but never ambiguous.

    Tool Count5/5

    Seven tools is well within the sweet spot and each maps to a distinct stage of a security posture pipeline rather than duplicating functionality. No tool feels like filler, and none are obviously missing from the count perspective.

    Completeness3/5

    The surface covers detection, correlation, baseline diffing, prioritization, remediation planning, and policy evaluation, but there is no tool to actually execute the detected scanners or emit/write the Action Packet, so kavach_correlate depends on artifacts produced outside the server. It is also unclear how waivers for kavach_policy_check are managed, and there is no post-remediation verification step, leaving notable gaps in the loop.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables LLMs and AI agents to perform defensive security posture assessments, privilege escalation surface audits, and post-quantum cryptography readiness checks through read-only diagnostic tools.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables authorized security auditing of AI-agent supply chains and agent-facing surfaces: deterministic local skill-bundle audits against eight attack patterns, secrets scanning, and scope-gated read-only recon of agent endpoints and MCP surfaces.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to run read-only AWS security audits and receive normalized, severity-ranked findings about account posture, such as stale access keys, missing MFA, public buckets, open security groups, and CloudTrail coverage.
      11
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to run deterministic, fully local static security and compliance audits of code, configurations, and dependencies through 32 MCP tools covering 24 vulnerability categories. It also detects the project stack, generates risk reports and checklists, suggests stack-aware remediations, and re-validates fixes to confirm vulnerabilities were eliminated.
      32
      1
      MIT