Back to Directory/Developer Tools

io.github.ExpertVagabond/guardrails

AI Agent Guardrails MCP server - security layer

Developer ToolsRustv1.0.1

guardrails-mcp-server

[!License: MIT](https://opensource.org/licenses/MIT) [!MCP](https://modelcontextprotocol.io) [!Node.js](https://nodejs.org)

MCP server for AI agent security guardrails. Provides input validation, prompt injection detection, PII redaction, output filtering, policy enforcement, rate limiting, and comprehensive audit logging.

Tools

ToolDescription
validate_inputValidate and sanitize incoming requests through all guardrail checks
filter_outputFilter and redact sensitive data (PII, secrets, credentials) from responses
check_policyEvaluate a request against security policies (RBAC, resource access, quotas)
get_audit_logsQuery the audit log with filtering by type, user, time range
get_statsGet engine statistics including active users, block rate, request counts
update_configUpdate guardrail configuration at runtime

Security Features

  • Prompt Injection Detection -- 12 regex patterns for jailbreak, DAN mode, system prompt override
  • PII Detection and Redaction -- SSN, credit card, email, phone, IP, API keys, AWS keys, JWT, passwords, private keys, connection strings
  • Malicious Code Blocking -- eval, exec, subprocess, child_process, shell injection
  • Policy Engine -- Block sensitive paths, dangerous tools, unauthenticated destructive ops, URL allowlist, maintenance windows
  • Rate Limiting -- Per-user sliding window (configurable requests/minute)
  • Audit Logging -- Timestamped events with metrics, log rotation, external handler support

Install

npm install

Configuration

{
  "mcpServers": {
    "guardrails": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/guardrails-mcp-server/index.js"]
    }
  }
}

Project Structure

src/engine/GuardrailsEngine.js    # Core orchestration
src/validators/InputValidator.js   # Prompt injection and PII detection
src/filters/OutputFilter.js        # Redaction and harmful content blocking
src/policies/PolicyEngine.js       # RBAC, quotas, maintenance windows
src/audit/AuditLogger.js           # Event logging and metrics

License

MIT

Installation

Source-derived launch command. Check the maintainer’s required arguments and credentials before running:

bash
npx -y guardrails-mcp-server

Set up in your AI client

Merge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.

json
{
  "mcpServers": {
    "io-github-expertvagabond-guardrails": {
      "command": "npx",
      "args": [
        "-y",
        "guardrails-mcp-server"
      ]
    }
  }
}

Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.

Claude Desktop setup reference

Package

guardrails-mcp-servernpm

Compatible MCP Clients

io.github.ExpertVagabond/guardrails works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.

  • Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.
  • Cursor~/.cursor/mcp.jsonRestart Cursor for changes to take effect.
  • VS Code.vscode/mcp.jsonReload VS Code window for changes to take effect.
  • Windsurf~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect.
  • Claude Code.mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.

Learn More