guardrails-mcp-server
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.
README
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 |
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.