Skip to content

rule-mcp

Preferences
  • Theme
  • Display
  • Getting started

    This chapter tells you how to install RuleMCP and connect your agent.

    What RuleMCP does

    RuleMCP is an MCP server. It does three things:

    1. It routes a free-text request to the skill that owns it.
    2. It serves skills as MCP tools, resources, and prompts.
    3. It checks generated code with deterministic guardrails.

    No model runs inside the server. Any agent that speaks MCP can use it. The tools and the guardrails give the same result with any model.

    Requirements

    Item Version Check
    Node.js 24 or newer node --version
    pnpm 11 or newer pnpm --version

    The server stops at start if the Node.js version is too old. There is no npm package, so you install from a clone or from a release tarball.

    Install

    git clone https://github.com/pixu1980/rule-mcp.git
    cd rule-mcp
    pnpm setup
    

    pnpm setup deletes node_modules and pnpm-lock.yaml, installs again, adds the global rule-mcp command, and starts the setup wizard. The wizard needs a terminal. In a pipe, the plain runner uses the same defaults.

    The wizard finds your agents, writes their MCP configuration, and runs the health check. Install and uninstall lists each step.

    To keep the lockfile, run pnpm install --frozen-lockfile and then ./scripts/install.sh.

    Do a check of the install

    rule-mcp doctor
    

    The report shows the registered tools, the detected agents, and the state of the hooks. Restart your agent after the install. The agent reads MCP entries only when it starts.

    Prepare a project

    Do this step in your own project, not in this repository:

    cd ~/my-project
    
    rule-mcp init
    

    rule-mcp init creates the recorder directory, installs the commit-msg and pre-push git hooks, refreshes the rules block, and reports the dependency pins. It also indexes the project with TokenSave. Use --no-tokensave to skip the index.

    The main flows

    Next steps