● 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— checkssystemdunits,sudoers,sshd_config,ufw, anddocker-compose.ymlsnippets for passwordless root, missing SSH allow rules,[Service] StartLimitIntervalSecbugs, and Docker ports that bypassufw.scan_secret_leak— scans shell commands, configs, or git diffs for.envshell bypasses (cat,python3 -c,base64),curlcommand-line token leaks visible inps aux, and 10+ API key formats.rewrite_safe_curl— rewrites acurlcall that puts bearer or bot tokens inargvinto a safecurl -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):
- CLAUDE.md Template Pack ($9) (Buy · $9) —
PreToolUsehooks that block destructive commands before Bash executes. - Agent Ops Kit ($19) (Buy · $19) — single-agent systemd service, preflight audits, and 30%-tax-reserve ledger.
- Multi-Vendor AI Council Ops Kit ($39) (Buy · $39) — multi-agent Linux seat isolation, peer-review Git branches, scoped
sudo, and automatic rate-limit failover.