@cobusgreyling/loop-mcp-server

July 6, 2026 · View on GitHub

MCP (Model Context Protocol) server for loop-engineering — exposes patterns, skills, state, budget, and audit tools as runtime-queryable resources for AI agents.

Instead of stuffing all loop documentation into the prompt, agents can query only what they need on-demand via MCP.

Quick Start

npx @cobusgreyling/loop-mcp-server

From a cloned loop-engineering repo:

cd tools/mcp-server && npm ci && npm test
node dist/index.js

Set LOOP_PROJECT_ROOT to your target project (defaults to cwd).

Configure in Claude Code / Grok / any MCP client

Add to your MCP config (.mcp.json or equivalent):

{
  "mcpServers": {
    "loop-engineering": {
      "command": "npx",
      "args": ["-y", "@cobusgreyling/loop-mcp-server"],
      "env": {
        "LOOP_PROJECT_ROOT": "."
      }
    }
  }
}

Resources

URIDescription
loop://registryPattern registry (all 7 patterns with metadata, costs, phases)
loop://configLOOP.md — cadence, budget, gates, scheduling
loop://budgetloop-budget.md — token caps, kill switch
loop://run-logloop-run-log.md — append-only run history
loop://safetySafety docs — denylists, auto-merge policy, MCP scopes
loop://patterns/{id}Full pattern documentation by ID
loop://skills/{name}Skill definition (SKILL.md) by name
loop://state/{file}State file content

Tools

ToolDescription
loop_list_patternsList all patterns with goals, cadences, risk levels
loop_list_skillsList available skills with locations
loop_list_state_filesList state files in the project
loop_get_patternGet full pattern docs + registry metadata
loop_get_skillGet SKILL.md content for a named skill
loop_get_stateRead a state file for current loop status
loop_recommend_patternRecommend patterns for a use case description
loop_estimate_costEstimate daily token cost for a pattern at L1/L2/L3

Environment

VariableDefaultDescription
LOOP_PROJECT_ROOTcwd()Root directory of the project to serve

Development

cd tools/mcp-server
npm install
npm run build
npm test

Architecture

Agent (Claude Code / Grok / Codex)

  ├─ MCP Resource Read ──→ loop://patterns/daily-triage
  ├─ MCP Tool Call ──→ loop_recommend_pattern("watch CI failures")
  └─ MCP Tool Call ──→ loop_estimate_cost("ci-sweeper", "L2")


loop-mcp-server (stdio transport)

  ├─ resolver.ts ──→ reads patterns/, skills/, STATE.md, LOOP.md, etc.
  └─ index.ts ──→ MCP protocol handlers

The server reads from the local filesystem at LOOP_PROJECT_ROOT. It is read-only — it never writes to the project.

See Also