Skip to main content
Glama
ExpertVagabond

guardrails-mcp-server

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

Tool

Description

validate_input

Validate and sanitize incoming requests through all guardrail checks

filter_output

Filter and redact sensitive data (PII, secrets, credentials) from responses

check_policy

Evaluate a request against security policies (RBAC, resource access, quotas)

get_audit_logs

Query the audit log with filtering by type, user, time range

get_stats

Get engine statistics including active users, block rate, request counts

update_config

Update guardrail configuration at runtime

Related MCP server: SentinelGate

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    F
    maintenance
    Unified MCP safety server that detects prompt injection (75 patterns), scans LLM outputs for leaked secrets/PII, enforces API cost budgets, and creates signed audit trails. Zero ML dependencies, pure Python.
    17
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Open-source MCP proxy that enforces security policies, content scanning, and audit logging between AI agents and tool servers
    25
    AGPL 3.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that enforces runtime governance on AI agent actions — file access, command execution, delegation chains, and permission escalation.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server that provides runtime defense for AI agents, protecting against prompt injection, data exfiltration, and other adversarial attacks through a ranked pipeline of up to 36 inline defenses and 3 output scanners.
    3
    Apache 2.0