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: Hivelore
β¨ 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
Available Tools
5 toolscreate_fileB
Create a new file (automatically applies snake_case naming convention)
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Desired file path (will be normalized to snake_case) | |
| content | No | File content |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the automatic snake_case naming convention, which is useful, but doesn't address critical behavioral aspects like whether this operation requires specific permissions, what happens if the file already exists, whether it's idempotent, or what the response looks like.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that immediately states the core functionality and includes the important behavioral detail about naming conventions. There's zero wasted text, and it's perfectly front-loaded with essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a file creation tool with 2 parameters and no output schema, the description is minimally adequate but has significant gaps. It covers the naming convention behavior but misses important context about error handling, permissions, file existence checks, and what distinguishes it from sibling tools like 'write_file'.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds the important semantic detail about automatic snake_case normalization for the path parameter, but doesn't provide additional context about content parameter usage or file format considerations beyond what's in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Create') and resource ('a new file'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'write_file' (which might update existing files) or mention what type of file is being created.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'write_file' or 'list_files'. There's no mention of prerequisites, error conditions, or typical use cases, leaving the agent to infer usage from the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_fileC
Delete a file
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. 'Delete a file' implies a destructive mutation, but it doesn't specify whether deletion is permanent, reversible (e.g., moves to trash), requires specific permissions, or has side effects (e.g., affecting linked resources). This leaves critical behavioral traits unaddressed for a destructive operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with just three words, front-loaded with the core action. There's no wasted language, making it easy to parse quickly, though this brevity contributes to gaps in other dimensions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (destructive operation with no annotations and no output schema), the description is incomplete. It doesn't cover behavioral aspects like permanence or permissions, output details (e.g., confirmation message), or error handling, which are crucial for safe and effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the 'path' parameter documented as 'File path'. The description adds no additional meaning beyond this, such as path format examples or constraints. According to the rules, with high schema coverage (>80%), the baseline is 3 even without param info in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Delete a file' clearly states the action (delete) and resource (file), which is better than a tautology. However, it doesn't differentiate from sibling tools like 'create_file' or 'write_file' beyond the verb, and it lacks specificity about what type of file deletion occurs (permanent vs. trash, etc.).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'write_file' for modifications or 'create_file' for new files. It doesn't mention prerequisites (e.g., file must exist) or exclusions, leaving the agent to infer usage from context alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_filesC
List all files in directory
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Directory path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe important behavioral aspects: whether it returns file metadata or just names, if it handles permissions errors, if it follows symbolic links, or what happens with invalid paths. For a file system tool with zero annotation coverage, this leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is perfectly concise at just four words, front-loading the essential information with zero wasted language. Every word earns its place by specifying the action, scope, and target resource efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, no output schema, and a file system operation that could have complex behaviors (permissions, recursion, error handling), the description is insufficiently complete. It doesn't explain what format the listing returns, how errors are handled, or important constraints. For a tool interacting with file systems, more context is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with the single parameter 'path' clearly documented in the schema. The description adds no additional parameter information beyond what's already in the structured data. The baseline score of 3 reflects adequate but minimal value addition when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('List') and resource ('files in directory'), making the purpose immediately understandable. It distinguishes from siblings like create_file or delete_file by focusing on retrieval rather than modification. However, it doesn't specify whether this lists only immediate files or includes subdirectories, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention whether this is for browsing directory contents, checking file existence, or other use cases. With siblings like read_file available, there's no indication of when list_files is preferred over directly reading specific files.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_fileC
Read contents of a file
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. While 'Read' implies a non-destructive operation, it doesn't disclose important behavioral traits like file format handling, encoding issues, maximum file size limits, permission requirements, or error conditions for missing files.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is perfectly concise at 4 words, front-loaded with the core action, and contains zero wasted words. Every element ('Read', 'contents', 'of a file') contributes essential meaning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a file reading tool with no annotations and no output schema, the description is insufficient. It doesn't explain what gets returned (text content, binary data, encoding), error handling, or constraints. Given the complexity of file operations and lack of structured information, more context is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents the single 'path' parameter. The description adds no additional meaning about the path parameter beyond what the schema provides, such as path format examples or relative/absolute path handling.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Read') and resource ('contents of a file'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_files' which also reads information about files but doesn't read their contents.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. With siblings like 'list_files' (for metadata) and 'write_file' (for modification), there's no indication of when reading file contents is appropriate versus other file operations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
write_fileB
Write to an existing file (naming convention enforced on creation only)
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path | |
| content | Yes | File content |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions 'naming convention enforced on creation only', which adds some behavioral context about constraints. However, it doesn't disclose critical traits like whether this operation overwrites or appends content, requires specific permissions, has side effects, or what happens on errors. For a mutation tool with zero annotation coverage, this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that is front-loaded with the core purpose ('Write to an existing file') and includes a clarifying note. There is zero wasteβevery word earns its place, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a file write operation (a mutation with potential side effects), no annotations, and no output schema, the description is incomplete. It lacks details on behavior (e.g., overwrite vs. append), error handling, permissions, or return values. The naming convention note is helpful but insufficient for safe and effective use by an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both parameters ('path' and 'content') clearly documented in the schema. The description doesn't add any meaning beyond what the schema providesβit doesn't explain parameter formats, constraints, or examples. Baseline 3 is appropriate when the schema does the heavy lifting, but no extra value is added.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Write to') and resource ('an existing file'), making the purpose immediately understandable. It distinguishes from 'create_file' by specifying 'existing file', though it doesn't explicitly mention all siblings like 'delete_file' or 'read_file'. The naming convention note adds specificity but isn't essential to the core purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by specifying 'existing file', which distinguishes it from 'create_file' for new files. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'read_file' or 'delete_file', nor does it mention prerequisites or exclusions. The context is implied rather than explicitly stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose targeting specific file operations: create, delete, list, read, and write. There is no overlap or ambiguity between these functions, making tool selection straightforward for an agent.
All tools follow a consistent verb_noun pattern (e.g., create_file, delete_file) using snake_case throughout. The naming is predictable and aligns perfectly with the operations performed.
With 5 tools, the server is well-scoped for file management, covering essential CRUD operations (create, read, update via write, delete) and listing. Each tool earns its place without being excessive or insufficient.
The tool set provides complete coverage for basic file operations in the domain, including create, read, update (write), delete, and list. There are no obvious gaps, and agents can perform full file lifecycle management without dead ends.
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 Connectors
MCP enforcement layer that intercepts AI agent actions and blocks rule violations before execution.
Governance layer for AI coding agents: knowledge-graph grounding, session audit, policy controls.
Pre-execution governance for AI agents. Deterministic PASS/FAIL/REVIEW verdicts, replayable proof.
Security reviews for coding agents: diffs checked against your org policy and live infrastructure.
Related MCP Servers
- AlicenseAqualityDmaintenanceRuntime policy enforcement for AI agents. Evaluate every agent action against your organization's policies before execution, with observe and enforce modes.11MIT
- AlicenseAqualityAmaintenanceEnforces team knowledge and workflow policies for AI coding agents by providing context, decisions, and gates before code changes are made.2151Apache 2.0

corbatofficial
AlicenseAqualityBmaintenancePolicy and quality engine for AI coding agents that enforces team coding standards and provides validation gates for agent-assisted software delivery.7544MIT
Rigour MCPofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents to self-govern by scanning code for hardcoded secrets, structural violations, and AI drift in real-time, providing fix packets for automatic remediation.26MIT
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