βœ“
Security MCP Server AI for SecOps & Auditing Read-Only Analysis Featured Verified Nov 2026

Gitleaks & TruffleHog Secrets MCP

Scan git commit history, local diffs, and Docker layers for exposed credentials while keeping secret values masked.

Prerequisites & Step-by-Step Installation

Copy & run inside isolated lab

Before You Start (Prerequisites)

  • + Gitleaks (>= 8.20) or TruffleHog v3 installed locally
  • + Local git repository workspace
  • + --redact flag enabled (CRITICAL so secret values never leave stdout into cloud prompts)
1

Install Gitleaks and test redacted scanning locally

gitleaks detect --source . --redact --no-git

CRITICAL: Always pass --redact when piping secret scanner output into any AI assistant.

2

Register redacted Secrets MCP bridge

claude mcp add secrets-mcp -- secrets-mcp --redact --read-only

Returns file paths, commit hashes, and rule IDs while masking actual credential bytes.

Verify Setup Works
gitleaks version
Expected output: v8.2x.x

Client Integration & Configuration Files

Review scope limits before wiring
claude mcp add gitleaks-trufflehog-secrets-mcp-server -- secrets-mcp --redact --read-only
{
    "mcpServers": {
        "gitleaks-trufflehog-secrets-mcp-server": {
            "command": "secrets-mcp",
            "args": [
                "--redact",
                "--read-only"
            ],
            "env": {
                "TOOLWAR_SAFE_MODE": "strict",
                "AUTH_TOKEN": "YOUR_SCOPED_TOKEN_HERE"
            }
        }
    }
}
{
    "mcpServers": {
        "gitleaks-trufflehog-secrets-mcp-server": {
            "command": "secrets-mcp",
            "args": [
                "--redact",
                "--read-only"
            ]
        }
    }
}
services:
  gitleaks-trufflehog-secrets-mcp-server:
    image: toolwar-sandbox/mcp-runner:latest
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true

How to Use & Defensive Workflow

Authorized assessment protocol

Typical Scenario: Verify staged commits and historical branches contain zero leaked API keys or private certs without sending raw credentials into model context.

  1. 01. Confirm --redact mode is active so raw secrets are replaced with REDACTED placeholders.
  2. 02. Scan staged changes and recent commit history.
  3. 03. Rotate exposed credentials first, then scrub git history and add pre-commit gitleaks hooks.
Example Defensive Prompt / Run Command
Run redacted Gitleaks scan on the last 50 commits, list matching file paths and rule IDs, and draft a pre-commit hook configuration to block future leaks.
Security Hardening & Authorized Scope Guidelines

Bind the MCP server exclusively inside a read-only workspace or isolated container (`read_only: true`, `--cap-drop=ALL`). Enforce strict CIDR/directory allowlists and never expose local MCP stdio or SSE ports on untrusted network interfaces without mutual authentication.

Technical Architecture & Deployment Brief

Overview & Role in Security Engineering

Gitleaks & TruffleHog Secrets MCP (Security MCP Server) is engineered to support practitioners focused on secret-leak detection across commit histories with mandatory value redaction before findings reach LLM context. Within the ToolWar ecosystem, it serves as an explicit bridge between AI reasoning layers and verifiable cybersecurity telemetry.

Technical Architecture & Data Flow

The Model Context Protocol (MCP) separates the language model reasoning layer from privileged binary execution. Rather than letting an AI assistant invoke unconstrained shell commands, this server exposes typed, schema-validated read/inspection tools with explicit scope boundaries.

Unlike ad-hoc prompt wrappers that execute unconstrained strings directly in a shell, structured integration enforces typed parameter validation, bounded scope allowlists, and explicit separation between untrusted analyzed artifacts (source files, telemetry logs, network banners, or binary samples) and system-level control instructions.

Recommended Deployment Practice

  1. Isolate the Execution Boundary: Deploy integrations inside ephemeral containers or dedicated analysis VMs so untrusted repositories, binaries, or HTTP responses cannot affect primary workstations.
  2. Enforce Least-Privilege Scoping: Use read-only filesystem mounts, non-privileged service tokens, and target CIDR allowlists before enabling interactive assistant sessions.
  3. Verify Outputs Deterministically: Pair this connector with least-privilege runtime profiles and inspect every returned JSON schema before forwarding findings into automated tickets or dashboards.

Integration & Operational Caveats

  • Treat all external content ingested by an LLM (including code comments, HTML titles, log lines, and MCP responses) as potential prompt-injection vectors.
  • Review configuration JSON and SKILL.md manifests carefully before binding credentials or running inside automated CI/CD pipelines.

Bridged ToolWar Classic Arsenal

1 linked tools

Community Field Notes (0)

No notes posted yet. Share verified runtime configs or hardening tips below.