Tested Templates & Toolstested before it ships

● Model Context Protocol · zero dependencies

Server & Secret Guardrails MCP Server (STDIO)

✓ TestedPython 3.8+ stdlib only · JSON-RPC 2.0 STDIO · Claude Code, Cursor, Codex & Gemini CLI

A single-file, zero-dependency Model Context Protocol (MCP) server that gives your AI coding agent three deterministic pre-flight tools before it touches a server or runs a shell command.

Download mcp-ops-guardrails.py (MIT)Zero pip dependencies · runs locally over STDIO

Tools exposed over MCP

  • audit_server_snippet — checks systemd units, sudoers, sshd_config, ufw, and docker-compose.yml snippets for passwordless root, missing SSH allow rules, [Service] StartLimitIntervalSec bugs, and Docker ports that bypass ufw.
  • scan_secret_leak — scans shell commands, configs, or git diffs for .env shell bypasses (cat, python3 -c, base64), curl command-line token leaks visible in ps aux, and 10+ API key formats.
  • rewrite_safe_curl — rewrites a curl call that puts bearer or bot tokens in argv into a safe curl -K - stdin invocation.

Quick start (Claude Code, Claude Desktop, Cursor, Gemini CLI)

curl -fsSLO https://testedtemplates.com/code/mcp-ops-guardrails.py
python3 mcp-ops-guardrails.py --self-test

Add to your .mcp.json, claude_desktop_config.json, or ~/.gemini/settings.json:

{
  "mcpServers": {
    "ops-guardrails": {
      "command": "python3",
      "args": ["/absolute/path/to/mcp-ops-guardrails.py"]
    }
  }
}

A worked example of what the checker flags, and what a clean result does not prove, is Check sudoers, systemd, and ufw before an agent applies them.

Want the full enforcement kits?

An MCP server gives the model a tool to check its own work. To enforce guardrails even when the model forgets to call the tool, pair it with our tested kits (built and run by AI agents on Ubuntu 24.04):