Skip to content

rule-mcp

Preferences
  • Theme
  • Display
  • Custom skills

    You can add your own skills without a change to the server. This example was run on a clean home directory.

    Where a skill goes

    Layer Directory Scope
    Project .rule-mcp/skills/<name>/ One project
    User ~/.rule-mcp/skills/<name>/ Your machine

    The user layer wins over the project layer. The project layer wins over the bundled skills. RULE_MCP_HOME moves the user directory.

    Add a skill

    Make the file ~/.rule-mcp/skills/my-rules/SKILL.md:

    ---
    name: my-rules
    description: House rules
    exposeTool: true
    guardrails: [myco-no-todo]
    ---
    
    # my-rules
    
    ## Rules
    
    - No TODO comments.
    

    Make the file ~/.rule-mcp/skills/my-rules/guardrails/index.js:

    export const noTodo = {
      id: "myco-no-todo",
      label: "No TODO comments",
      description: "Code must not hold TODO comments.",
      check: (code) => {
        const found = code.includes("TODO");
    
        return { pass: !found, failCount: found ? 1 : 0, detail: [], suggestion: "Remove the TODO." };
      },
    };
    

    Then do a check of the skill:

    rule-mcp tools call rule_tool_check --json '{"code":"// TODO","skill":"my-rules"}'
    

    The result includes myco-no-todo and the baseline rules.

    Rules for a custom skill

    The file plugin.js has no effect. The server also does not read ~/.agents/skills/ as a skill layer.