Andre-Buzeli/mcp-rules-enforcer-zero
If you are the rightful owner of mcp-rules-enforcer-zero and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
MCP Rules Enforcer Zero is a zero-tool Model Context Protocol server designed to automatically enforce rules from markdown files for AI agents, ensuring consistent behavior across various MCP-compatible clients.
MCP Rules Enforcer Zero
A zero-tool Model Context Protocol (MCP) server that automatically enforces rules from markdown files for AI agents. Perfect for ensuring consistent behavior across VSCode, Cursor AI, Claude Desktop, and other MCP-compatible clients.
🚀 Features
- ✅ Automatic rule injection into all AI conversations
- ✅ Environment-based configuration via
RULE_ROOT
- ✅ Hot reload when rules file changes
- ✅ NPX ready - no installation required
- ✅ TypeScript implementation with full type safety
- ✅ IDE integration for VSCode, Cursor AI, Claude Desktop
- ✅ Zero tools - pure automatic functionality
- ✅ Intelligent caching for optimal performance
📦 Installation & Usage
Quick Start (NPX - Recommended)
No installation required! Just use NPX:
npx @andrebuzeli/mcp-rules-enforcer-zero
Global Installation
npm install -g @andrebuzeli/mcp-rules-enforcer-zero
mcp-rules-enforcer-zero
IDE Integration
VSCode / Cursor AI
Add to your .vscode/mcp.json
file:
{
"mcpServers": {
"rules-enforcer-zero": {
"command": "npx",
"args": ["@andrebuzeli/mcp-rules-enforcer-zero"],
"env": {
"RULE_ROOT": "/path/to/your/rules/directory"
}
}
}
}
Claude Desktop
Add to your Claude Desktop MCP configuration:
{
"mcpServers": {
"rules-enforcer-zero": {
"command": "npx",
"args": ["@andrebuzeli/mcp-rules-enforcer-zero"],
"env": {
"RULE_ROOT": "/path/to/your/rules/directory"
}
}
}
}
⚙️ Configuration
Environment Variables
Variable | Description | Default |
---|---|---|
RULE_ROOT | Path to the rules.md file | "rules.md" in current directory |
MCP_SERVER_NAME | Name of the MCP server | "Rules Enforcer Zero" |
AUTO_INJECT | Enable/disable automatic injection | true |
Rules File
Create a rules.md
file and point RULE_ROOT
to it:
## Example Rules
1. Always format code with proper indentation
2. Include detailed comments for complex logic
3. Prefer modern syntax over legacy approaches
📋 How It Works
This server automatically injects rules from your rules.md
file into AI conversations by:
- Resource: Provides a
rules://current
resource that always returns the current rules - Prompt: Automatically injects rules into every conversation via an auto-inject prompt
- Hot Reload: Detects when the rules file changes and automatically updates
🤔 Why Zero Tools?
This version of the MCP Rules Enforcer is designed for simplicity and minimal complexity. By removing all tools, it:
- Reduces complexity
- Provides a pure "set it and forget it" experience
- Focuses solely on rule injection
- Eliminates unnecessary functions
🔧 Testing If It's Working
To verify the rules are being applied:
- Ask directly: "What rules are you following in this conversation?"
- Check behavior: Test if the AI follows your specific rules
- Resource access: Check if
rules://current
resource is available - Logs: Look for success messages in the server logs
🌟 Versions Available
Version | Description | NPM Package |
---|---|---|
Zero | No tools, just rule injection | @andrebuzeli/mcp-rules-enforcer-zero |
Simple | One multi-purpose tool | @andrebuzeli/mcp-rules-enforcer-simple |
Full | Multiple specialized tools | @andrebuzeli/mcp-rules-enforcer |
📄 License
MIT