Skip to main content
Glama

dev-loop-mcp

Ein MCP-Server (Model Context Protocol), der eine KI-gesteuerte TDD-Entwicklungsschleife ausführt. Er verallgemeinert die Zustandsmaschine der Entwicklungsschleife, um mit jedem Projekt über eine einfache Konfigurationsdatei zu funktionieren.

Was er tut

Es stehen zwei Schleifentypen zur Verfügung – beide nutzen dieselbe TDD-Pipeline; sie unterscheiden sich nur darin, wie Aufgaben erstellt werden:

flowchart LR
    subgraph start_loop["start_loop (feature)"]
        direction LR
        A("description<br/>or tasks") --> B["DECOMPOSE<br/>AI breaks into tasks"]
        B --> C[/"tasks"/]
    end

    subgraph start_debug_loop["start_debug_loop (bug)"]
        direction LR
        D("symptom<br/>+ context files") --> E["DIAGNOSE<br/>AI ranks hypotheses"]
        E --> F[/"tasks"/]
    end

    C --> Pipeline["TDD pipeline"]
    F --> Pipeline

    subgraph Pipeline["Shared TDD pipeline"]
        direction LR
        I[INIT] --> T[TDD_LOOP<br/>per task]
        T --> Bu[BUILD]
        Bu --> De[DEPLOY<br/>optional]
        De --> It[INTEG_TEST<br/>optional]
        It -->|pass| Qr[QUALITY_REVIEW]
        It -->|fail| If[INTEG_FIX<br/>up to 5×]
        If --> Qr
        Qr --> Ct[CLEAN_TREE<br/>CHECK]
        Ct --> Pr[PUSH_AND_PR]
        Pr --> Done(["✓ DONE<br/>PR opened"])
    end

Vollständige Zustandsmaschine

flowchart TD
    start_loop --> INIT
    start_debug_loop -->|"DIAGNOSE:<br/>ranked hypotheses → tasks"| INIT

    INIT -->|"pre-loaded tasks"| TDD_LOOP
    INIT -->|"description only"| DECOMPOSE
    DECOMPOSE -->|"AI → Task[]"| TDD_LOOP

    TDD_LOOP -->|"task done, more remain"| TDD_LOOP
    TDD_LOOP -->|"all tasks done"| BUILD
    TDD_LOOP -->|"task failed"| FAILED

    BUILD -->|pass| DEPLOY
    BUILD -->|fail| FAILED

    DEPLOY -->|"pass / skipped"| INTEG_TEST
    DEPLOY -->|fail| FAILED

    INTEG_TEST -->|"pass / skipped"| QUALITY_REVIEW
    INTEG_TEST -->|fail| INTEG_FIX

    INTEG_FIX -->|fixed| QUALITY_REVIEW
    INTEG_FIX -->|"still failing<br/>(retry, max 5)"| INTEG_FIX
    INTEG_FIX -->|"5 attempts exhausted"| FAILED

    QUALITY_REVIEW --> CLEAN_TREE_CHECK
    CLEAN_TREE_CHECK --> PUSH_AND_PR
    PUSH_AND_PR --> DONE

    DONE(["✓ DONE"])
    FAILED(["✗ FAILED"])

    style DONE fill:#22c55e,color:#fff
    style FAILED fill:#ef4444,color:#fff
    style start_loop fill:#6366f1,color:#fff
    style start_debug_loop fill:#f59e0b,color:#fff

TDD-Zyklus pro Aufgabe

Jede Aufgabe in TDD_LOOP durchläuft diesen inneren Zyklus (bis zu 5 Programmieriterationen):

flowchart LR
    A["Write scenarios<br/>scenarios/scenarios-*.md"] --> B["Write failing tests<br/>*.test.ts"]
    B --> C{"Tests<br/>fail?"}
    C -->|"no — tester error"| Z["✗ task failed"]
    C -->|yes| D["Implement"]
    D --> E{"Tests<br/>pass?"}
    E -->|yes| F["✓ commit & next task"]
    E -->|"no (retry)"| D

Phasenreferenz:

  • INIT: Erstellt den Git-Branch

  • DECOMPOSE: KI wandelt eine Beschreibung in ein Task[] um

  • DIAGNOSE: (nur Debug-Schleife) KI liest Symptome + Kontextdateien und erstellt bewertete Ursachenhypothesen als Task[]

  • TDD_LOOP: Pro Aufgabe: Szenarien → fehlschlagende Tests → Implementierung (bis zu 5 Programmieriterationen pro Aufgabe)

  • BUILD: Führt buildCommand aus

  • DEPLOY: Führt deployCommand aus – wird übersprungen, wenn nicht konfiguriert

  • INTEG_TEST: Führt integTestCommand aus – wird übersprungen, wenn nicht konfiguriert

  • INTEG_FIX: KI diagnostiziert und behebt Fehler bei Integrationstests (bis zu 5 Versuche)

  • QUALITY_REVIEW: KI überprüft den vollständigen Branch-Diff und wendet Qualitätskorrekturen an

  • CLEAN_TREE_CHECK: Committet automatisch alle nicht committeten Dateien

  • PUSH_AND_PR: Pusht den Branch und öffnet einen GitHub-PR

Installation

npm install -g dev-loop-mcp

Oder verwenden Sie npx:

npx dev-loop-mcp

Konfiguration

Erstellen Sie eine dev-loop.config.json im Stammverzeichnis Ihres Projekts:

{
  "buildCommand": "npm run build",
  "testCommand": "npm test",
  "deployCommand": "npm run deploy",
  "integTestCommand": "npm run test:integ",
  "branchPrefix": "claude/",
  "model": "claude-sonnet-4-6"
}

Alle Felder sind optional. Standardwerte:

  • buildCommand: "npm run build"

  • testCommand: "npm test"

  • deployCommand: nicht vorhanden (DEPLOY-Phase übersprungen)

  • integTestCommand: nicht vorhanden (INTEG_TEST-Phase übersprungen)

  • branchPrefix: "claude/"

  • model: "claude-sonnet-4-6"

Umgebungsvariablen

Variable

Erforderlich

Beschreibung

ANTHROPIC_API_KEY

Ja

Ihr Anthropic-API-Schlüssel

DEV_LOOP_ROOT

Nein

Projektstammverzeichnis (Standard ist cwd)

MCP-Einrichtung

Fügen Sie dies zu Ihrer MCP-Client-Konfiguration hinzu (z. B. Claude Desktop claude_desktop_config.json):

{
  "mcpServers": {
    "dev-loop": {
      "command": "dev-loop-mcp",
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-...",
        "DEV_LOOP_ROOT": "/path/to/your/project"
      }
    }
  }
}

Verfügbare Tools

start_debug_loop

Startet eine Debug-Schleife basierend auf einer Symptombeschreibung. Die KI diagnostiziert die Ursachen als bewertete TDD-Aufgaben, führt dann die Standard-TDD-Pipeline pro Hypothese aus und öffnet einen PR mit einem vollständigen Diagnosebericht.

{
  "symptom": "read_website returns failure on most real URLs",
  "context_files": ["src/tools/read-website.ts", "src/http/client.ts"]
}

Parameter:

  • symptom (erforderlich) — natürlichsprachliche Beschreibung des beobachteten Fehlers oder Ausfalls

  • context_files (optional) — relative Pfade zu Quelldateien, die die KI während der Diagnose lesen soll

Der DIAGNOSE-Schritt wird vor der Standard-TDD-Pipeline ausgeführt (siehe Zustandsmaschine oben). Der PR-Text enthält das Symptom, die identifizierten Ursachen und was behoben wurde.

Der Branch wird benannt als <branchPrefix>debug/<symptom-slug>.

start_loop

Startet eine neue Entwicklungsschleife.

{
  "description": "Add email validation to the user registration flow",
  "branch": "claude/email-validation"
}

Oder mit vorab zerlegten Aufgaben:

{
  "tasks": [
    {
      "id": 1,
      "title": "Add email validator function",
      "scope": "src/utils/email.ts",
      "acceptance": "validateEmail returns true for valid emails and false for invalid ones"
    }
  ],
  "branch": "claude/email-validation"
}

resume_loop

Setzt eine unterbrochene Schleife fort:

{}

loop_status

Überprüft den aktuellen Schleifenstatus:

{}

Verwendung als Bibliothek

import { runLoop, loadConfig, RealShellAdapter, AnthropicDevWorker } from "dev-loop-mcp";
import Anthropic from "@anthropic-ai/sdk";

const config = await loadConfig("/path/to/project");
const client = new Anthropic();
const shell = new RealShellAdapter();
const aiWorker = new AnthropicDevWorker(client, config.model, shell);

const finalState = await runLoop(initialState, {
  shell,
  aiWorker,
  stateFilePath: "/path/to/project/.loop-state.json",
  repoRoot: "/path/to/project",
  config,
});
-
security - not tested
F
license - not found
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/soynog/dev-loop-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server