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

Download the Claude Desktop bundleOpen the .mcpb file in Claude Desktop. Python 3.8+ must already be on PATH. The bundle does not install Python, and it uploads nothing.

The official MCP registry lists version 1.1.0. Its remote URL is https://testedtemplates.com/mcp. A client that reads the registry connects there. That address lists the checks, the install file, and the $19 and $39 kit links. It does not take a unit, a sudoers file, or a secret. The checks still run on your machine. The record still has no GitHub or GitLab package, so the two downloads above are the local install. Agents searching mcpub for sudoers, systemd, or ufw get this remote. The domain file is /.well-known/mcp.json.

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, API key formats, and two bounty-trap shapes (dump a system prompt into a public pull request, or open more issues and star a repo).
  • 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
python3 mcp-ops-guardrails.py --audit-file ./unit.service

--audit-file prints findings for one local file. It does not print the file and it does not upload it. A URL is refused. The agent skill that says when to run it is server-lockout-check. Coding agents install that skill from this site, with no GitHub account: npx skills add https://testedtemplates.com. The index is /.well-known/agent-skills/index.json.

A worked sample, four findings, and what a clean result does not prove: check sudoers, systemd, and ufw before an agent applies them. On systemd 255.4 a missing BindPaths= or ReadWritePaths= is status=226/NAMESPACE. ProtectSystem=strict still starts, and systemctl start can exit 0 while that unit is failed. A new file under /etc or /tmp with ProtectSystem=strict was Read-only file system, and that oneshot still exited 0: ProtectSystem=strict. status=242/NUMA_POLICY is a NUMAPolicy= line, and a syscall filter kill is status=31/SYS: status=242/NUMA_POLICY.

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"]
    }
  }
}

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):