MCP Policy Gatekeeper
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Policy Gatekeepercheck if 'createUserAccount.js' follows our naming conventions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server as Policy Gatekeeper
Real-time policy enforcement for AI coding agents using Model Context Protocol
Prevent AI agents from violating organizational standards by intercepting and validating their actions before execution.
🎯 Problem
AI coding assistants can bypass:
Naming conventions (camelCase vs snake_case)
Security policies (secrets in code, destructive commands)
Compliance rules (file access, API usage)
Traditional solutions (CI/CD, code review) catch violations after the damage is done.
Related MCP server: hejdar-mcp
✨ Solution
MCP server that acts as a policy gatekeeper - validates every agent action in real-time:
Agent: "Create myFirst--File.txt"
↓
MCP Server: ❌ Violates snake_case policy
↓
Agent: "Creating my_first_file.txt instead"🚀 Quick Start
# Clone & setup
git clone https://github.com/yourusername/mcpServer_as_gatekeeper.git
cd mcpServer_as_gatekeeper
# Install with uv
uv init
uv add mcp
# Run server
uv run server.py🔧 Windsurf Integration
Add to ~/.windsurf/mcp_config.json:
{
"mcpServers": {
"policy-gatekeeper": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcpServer_as_gatekeeper",
"run",
"server.py"
]
}
}
}Restart Windsurf. Done.
📋 Built-in Policies
1. Command Validation
❌ Blocks:
rm -rf /,curl | bash,chmod 777✅ Allows:
git,npm,docker, safe operations
2. File Naming
Enforces:
snake_casefor filesRejects:
camelCase,kebab-case, special characters
3. Sensitive Paths
Blocks:
/etc/shadow,.ssh/id_rsa,.envfiles
4. Network Security
Prevents: Command injection, data exfiltration
🧪 Test It
Prompt your agent:
Create a file called myTest--File.txtExpected: Agent auto-corrects to my_test_file.txt
Validate this command: rm -rf /Expected: Blocked with policy violation ORG-SEC-001
📊 Features
Feature | Status |
Command validation | ✅ |
File naming enforcement | ✅ |
Audit logging | ✅ |
Statistics dashboard | ✅ |
OPA integration | 🔄 Roadmap |
Secret scanning | 🔄 Roadmap |
🏗️ Architecture
┌─────────────────┐
│ AI Agent │
│ (Windsurf) │
└────────┬────────┘
│ MCP Protocol
↓
┌─────────────────────────┐
│ Policy Gatekeeper │
│ - Validate command │
│ - Check naming rules │
│ - Scan for secrets │
│ - Audit log │
└────────┬────────────────┘
│
↓
ALLOW / DENY🎛️ Customize Policies
Edit server.py:
POLICY_RULES = {
"your_rule": {
"patterns": [r"your_regex"],
"message": "Your policy message"
}
}Restart MCP server. Policies update immediately.
📈 Scale Impact
For a 50-developer team:
5,000 daily policy checks (100 per dev)
~100 hours/week saved on manual enforcement
80% of violations prevented before code review
Zero failed CI builds from policy violations
🔐 Enterprise Use Cases
Security: Block secrets, malicious commands
Compliance: Enforce SOC2/HIPAA file access rules
Quality: Consistent naming, code structure
Cost: Prevent expensive CI/CD failures
🛣️ Roadmap
OPA/Rego integration for complex policies
Secret detection (TruffleHog integration)
RBAC (role-based validation)
Multi-team policy federation
VS Code / Cursor support
Dashboard UI for policy management
🤝 Contributing
Have a policy pattern to share? PRs welcome!
Fork the repo
Add your policy to
POLICY_RULESAdd test cases
Submit PR
📄 License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides policy-based access control, incident tracking, and compliance monitoring to govern AI agent behavior. It enables organizations to enforce security rules and maintain audit trails by validating agent actions against trust levels and pattern-based policies.Last updated6
- AlicenseAqualityDmaintenanceRuntime policy enforcement for AI agents. Evaluate every agent action against your organization's policies before execution, with observe and enforce modes.Last updated11MIT
- Flicense-qualityBmaintenanceEnforces team knowledge and workflow policies for AI coding agents by providing context, decisions, and gates before code changes are made.Last updated1

Vaikora Guard MCPofficial
Alicense-qualityBmaintenanceEnforces deterministic policies on AI agent tool calls, evaluating actions against compliance modules (SOC 2, HIPAA, GDPR, etc.) and returning ALLOW, BLOCK, or CONSTRAIN decisions with an audit trail.Last updatedMIT
Related MCP Connectors
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Git-native policy layer for AI agents: check_action verdicts against rules approved via PR.
Responsible-AI guardrails for agents: scoring with policy, injection & PII detection, DPDP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GILSMON/mcpServer_as_gatekeeper'
If you have feedback or need assistance with the MCP directory API, please join our Discord server