Skip to main content
Glama
ERDL MCP Server

ERDL MCP Server

by OpenOBA

ERDL MCP Server

Stop reminding your Agent to behave. Teach it. One when/then sentence is all it takes.

npm version npm downloads license tests MCP MIT

πŸ“– δΈ­ζ–‡η‰ˆ

npx -y @openoba-ai/erdl-mcp

30 rules. 5 tools. Zero config. Unlimited custom rules. Free forever.

ERDL demo β€” intercepting rm -rf /


The Problem

You tell your Agent "don't use any", "keep it short", "ask before adding dependencies". It nods. Five turns later, it's back to its old habits.

Prompt-based rules don't work. LLMs forget. They reinterpret. They rationalize. You're not guiding them β€” you're negotiating with them.


Related MCP server: Claude Critical Rules MCP Server

The Solution

ERDL (Entity-Rule Definition Language) is a deterministic rule engine that runs as an MCP Server. Your Agent doesn't try to follow rules β€” the engine enforces them before every tool call.

You say

What actually happens

"Never use any"

Blocked. The engine intercepts write_file calls, scans the content, and rejects any before the write happens.

"Don't start with 'In today's world'"

Denied. Writing rules fire before every output. The Agent receives the correction before it speaks.

"Ask before adding npm dependencies"

Intercepted. exec of npm install is stopped. You approve it, or it doesn't happen.

"Why did you do that?"

Explained. erdl_explain shows exactly which rule fired, what condition matched, and what happened.


How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Agent Workflow                        β”‚
β”‚                                                         β”‚
β”‚  User says: "Write me a function"                       β”‚
β”‚       β”‚                                                 β”‚
β”‚       β–Ό                                                 β”‚
β”‚  LLM plans: use write_file(path, code)                  β”‚
β”‚       β”‚                                                 β”‚
β”‚       β–Ό                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚    ERDL Action Guard (MCP Server)    β”‚  ← Protocol   β”‚
β”‚  β”‚                                      β”‚    Layer      β”‚
β”‚  β”‚  1. Load 30 built-in rules           β”‚               β”‚
β”‚  β”‚  2. Evaluate: field/operator/value   β”‚               β”‚
β”‚  β”‚  3. Decision: ALLOW / DENY / CORRECT β”‚               β”‚
β”‚  β”‚  4. Return badge card + explanation  β”‚               β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚       β”‚                                                 β”‚
β”‚       β–Ό                                                 β”‚
β”‚  Tool executes (or is blocked)                          β”‚
β”‚                                                         β”‚
β”‚  No prompt engineering. No negotiation. Protocol-level. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

# One command. 30 rules active immediately.
npx -y @openoba-ai/erdl-mcp

That's it. No account. No API key. No configuration.

Chinese / δΈ­ζ–‡οΌš

npx -y @openoba-ai/erdl-mcp --lang zh

Add it to your MCP client:

{
  "mcpServers": {
    "erdl": {
      "command": "npx",
      "args": ["-y", "@openoba-ai/erdl-mcp@latest"]
    }
  }
}

Or let ERDL generate the config:

npx @openoba-ai/erdl-mcp@latest --setup

Supported clients: Claude Desktop Β· Cursor Β· VS Code / Copilot Β· OpenClaw Β· WorkBuddy Β· any MCP-compatible client.


ERDL vs Prompt Rules

Prompt / SKILL.md

ERDL

Enforcement

LLM "tries" to follow

Deterministic engine β€” guarantees execution

Reliability

May forget after 5 turns

Condition match is mathematical β€” zero hallucination

Visibility

Can't tell if it worked

erdl_explain shows every decision, every rule

Testing

Manual verification

erdl_simulate β€” 3 auto-generated scenarios

Portability

Tied to one platform

All MCP-compatible Agents

Overridability

LLM can "reinterpret"

Protocol-layer block β€” Agent cannot bypass


What's Included

30 Built-in Rules

Category

Count

Covers

engineering

13

Pipeline gates, no shortcuts, self-verify, decision logging, no force-push, no stash

coding

6

No any, no @ts-ignore, naming conventions, one-commit-one-change, dependency hygiene

security

6

No eval with input, no hardcoded secrets, no string SQL, validate all input, security headers, no stack traces

testing

2

Coverage never drops, no behavior without test

writing

2

Direct tone, no AI jargon

observability

1

No secrets in logs

5 MCP Tools

Tool

Use it when

erdl_evaluate

Before every tool call β€” mandatory Action Guard

erdl_simulate

Test a rule against 3 scenarios before creating it

erdl_create_rule

User says "remember this" β†’ create a rule from NL

erdl_list_rules

User asks "what rules are active?"

erdl_explain

User asks "why did you do that?" β†’ full decision trail

2 Resources

Resource

Purpose

erdl://rules/list

All active rules as JSON

erdl://status

Runtime status: rule counts by category, agent role


Creating a Rule

Turn your pain points into rules, one sentence at a time β€” banned, period. Turn your experience into rules, one sentence at a time β€” shared, forever.

Every pain point is a when(…) then(…) sentence:

when [trigger] Β· then [action]

Variable

Meaning

Example

when

What triggers it

code contains any Β· logs contain secrets Β· git stash used

then

What happens

Block it Β· Correct it Β· Allow with a warning Β· Pause for approval

Fill in the blanks:

when code contains any then block it.

That's a rule.

You β†’   "Never use `any` in TypeScript."

Agent β†’ 1. erdl_simulate   β†’ tests against 3 scenarios
        2. erdl_create_rule β†’ saves to ~/.openoba/rules/
        3. Rule is active.  β†’ next `any` is blocked.

You β†’   "Why was my code rejected?"

Agent β†’ erdl_explain β†’ full decision trail:
         βœ… no_any: tool.name in [write_file, edit, apply_patch] AND content contains "any"
         β†’ DENY: Do not use `any` type.

Or write rules by hand in ~/.openoba/rules/ (ERDL SPEC Β§5 format):

protocol: "erdl/v1"
version: "1.0.0"

rules:
  - name: "no_console_log"
    description: "Don't commit console.log statements"
    priority: 10
    when:
      logic: AND
      conditions:
        - field: "tool.name"
          operator: in
          value: ["write", "edit", "apply_patch"]
        - field: "tool.args"
          operator: match
          value: "console\\.log"
    then: DENY
    message: "Remove console.log before committing"

πŸ“š Full Tutorial β†’ Β· πŸ“– Rule Reference (30 rules) β†’


Free vs Pro

Free

Pro

5 MCP Tools

βœ…

βœ…

30 Preset Rules

βœ…

βœ…

Unlimited Personal Rules

βœ…

βœ…

Chinese / English

βœ…

βœ…

All 11 Operators

βœ…

βœ…

MIT Open Source

βœ…

βœ…

Execution Rings 1–2 (REQUEST_HUMAN, ESCALATE, ROLLBACK, QUARANTINE)

β€”

βœ…

Guardian Agent Role

β€”

βœ…

Audit Export (OCSF / OTLP)

β€”

βœ…

Team Rules

β€”

βœ…

Dashboard (hit statistics)

β€”

βœ…

Enterprise Compliance (GB/Z 185, NIST, EU AI Act)

β€”

Enterprise

Get a Pro License β†’


CLI Reference

npx @openoba-ai/erdl-mcp@latest           # Start (auto-latest via npx)
npx @openoba-ai/erdl-mcp@latest --lang zh  # Chinese mode
npx @openoba-ai/erdl-mcp@latest --upgrade   # Force upgrade
npx @openoba-ai/erdl-mcp@latest --uninstall # Clean removal
npx @openoba-ai/erdl-mcp@latest --setup     # Show MCP config
npx @openoba-ai/erdl-mcp@latest --help      # Full usage

From Source

git clone https://github.com/OpenOBA/erdl-mcp-server.git
cd erdl-mcp-server
npm install
npm run build
npm test        # 92 tests
node bin/erdl-mcp.js

Contributing

ERDL MCP Server is MIT-licensed and open to contributions. See CONTRIBUTING.md for guidelines.


Star History

If ERDL helps your workflow, give us a ⭐ on GitHub β€” it helps others discover the project.

Star History Chart


License

MIT Β· OpenOBA Β· @OpenOBA

Deterministic architecture, not prompt engineering.

Available Tools

5 tools
erdl_create_ruleCreate ERDL RuleA

Create a new ERDL rule from natural language. Use this when the user corrects your behavior and wants you to "remember" it.

EXAMPLE SCENARIOS:

  • User: "Never use 'any' types" β†’ Create: coding rule, intent: "write typescript code", DENY if "any" appears

  • User: "Don't start with 'in today's world'" β†’ Create: writing rule, intent: "write blog post", DENY

  • User: "Always use Tailwind, never inline styles" β†’ Create: design rule, intent: "create UI", ALLOW with instruction

The rule is saved to ~/.openoba/rules/ and takes effect immediately (no restart needed).

Inputs: category (required), decision (required), instruction (required), naturalLanguage (required), +2 more.

erdl_evaluateERDL Action Guard β€” Tool Call InterceptorA

ERDL Action Guard β€” evaluates planned tool call against loaded rules BEFORE execution.

YOU MUST call this BEFORE every tool call (exec, write_file, edit, web_search, etc). This is MANDATORY. The Guard cannot be bypassed.

After calling, check the decision:

  • ALLOW β†’ proceed with the tool call, follow any instructions

  • DENY β†’ STOP. Do not execute the tool. Tell the user what was blocked.

  • CORRECT β†’ fix the request and retry

  • REQUEST_HUMAN β†’ ask the user for approval before proceeding

Always show the result to the user as a badge card.

RESPONSE (compact badge card format):

  • "ALLOW": βœ… ERDL Guard Β· N rules

  • "DENY": πŸ›‘ ERDL Blocked Β· reason

  • "REQUEST_HUMAN": πŸ‘€ ERDL Approval Β· reason

  • "CORRECT": πŸ”§ ERDL Correct Β· correction

  • "EMERGENCY_HALT": 🚨 ERDL HALT Β· reason

  • "PASS": πŸ”΅ ERDL Pass Β· N rules checked

Inputs: tool_name (required), agent_id, tool_args, session_id.

erdl_explainExplain ERDL DecisionA

Show the FULL decision trail for the last action. Answers "why did you do that?" β€” shows every rule that was checked and whether it fired.

Use this when:

  • User asks "why did you act that way?"

  • User is confused about a DENY or unexpected ALLOW

  • You want to show transparency in your decision-making

Inputs: tool_name (required), tool_args.

erdl_list_rulesList ERDL RulesA

List all currently loaded ERDL rules. Use this when the user asks "what rules do you have?" or wants to see what constraints are active. Categorize by type: coding, engineering, writing, design, security, performance, testing, compliance, accessibility, custom.

Inputs: category.

erdl_simulateSimulate ERDL RuleA

Test a potential rule against 3 scenarios BEFORE creating it. This prevents "wishful thinking" rules that sound right but don't work.

Always call this BEFORE erdl_create_rule when the user says "remember this" or "create a rule". Show the simulation results and ask if the user wants to proceed.

Inputs: category (required), decision (required), keywords (required), ruleName (required), +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: create, evaluate, explain, list, simulate. No overlap or ambiguity between them.

    Naming Consistency5/5

    All tools use a consistent 'erdl_' prefix and verb-based naming (e.g., create_rule, evaluate, explain, list_rules, simulate). Minor variation in noun inclusion is acceptable.

    Tool Count5/5

    5 tools is well-scoped for a rule management server. Each tool covers a necessary function without redundancy or bloat.

    Completeness3/5

    The tool set covers creation, evaluation, explanation, listing, and simulation, but lacks update and delete capabilities for rules, which are notable gaps for a rule management system.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Centralizes AI behavior rules and applies them across tools like Codex, Claude Code, and Cursor, enabling agents to fetch up-to-date rules before responding.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Deterministic policy enforcement for AI agent tool calls. It evaluates every tool call against user-defined rules before execution, with no LLM in the authorization path.
      4
      MIT