dev-loop-mcp
dev-loop-mcp
AI駆動のTDD開発ループを実行するMCP (Model Context Protocol) サーバーです。シンプルな設定ファイルを通じて、あらゆるプロジェクトで開発ループのステートマシンを汎用的に利用できるようにします。
何ができるか
2種類のループタイプが利用可能です。どちらも同じTDDパイプラインを共有しており、タスクの生成方法のみが異なります。
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フルステートマシン
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サイクル
TDD_LOOP 内の各タスクは、この内部サイクルを実行します(最大5回のコーディング反復):
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フェーズリファレンス:
INIT: Gitブランチを作成します
DECOMPOSE: AIが説明文を
Task[]に変換しますDIAGNOSE: (デバッグループのみ) AIが症状とコンテキストファイルを読み取り、ランク付けされた根本原因の仮説を
Task[]として生成しますTDD_LOOP: タスクごと: シナリオ → 失敗するテスト → 実装(タスクごとに最大5回のコーディング反復)
BUILD:
buildCommandを実行しますDEPLOY:
deployCommandを実行します(設定されていない場合はスキップ)INTEG_TEST:
integTestCommandを実行します(設定されていない場合はスキップ)INTEG_FIX: AIが統合テストの失敗を診断し、修正します(最大5回試行)
QUALITY_REVIEW: AIがブランチ全体の差分をレビューし、品質修正を適用します
CLEAN_TREE_CHECK: 未コミットのファイルを自動コミットします
PUSH_AND_PR: ブランチをプッシュし、GitHubのプルリクエストを作成します
インストール
npm install -g dev-loop-mcpまたは npx を使用します:
npx dev-loop-mcp設定
プロジェクトのルートディレクトリに dev-loop.config.json を作成します:
{
"buildCommand": "npm run build",
"testCommand": "npm test",
"deployCommand": "npm run deploy",
"integTestCommand": "npm run test:integ",
"branchPrefix": "claude/",
"model": "claude-sonnet-4-6"
}すべてのフィールドはオプションです。デフォルト値:
buildCommand:"npm run build"testCommand:"npm test"deployCommand: なし (DEPLOYフェーズはスキップ)integTestCommand: なし (INTEG_TESTフェーズはスキップ)branchPrefix:"claude/"model:"claude-sonnet-4-6"
環境変数
変数 | 必須 | 説明 |
| はい | Anthropic APIキー |
| いいえ | プロジェクトのルートディレクトリ (デフォルトは |
MCPの設定
MCPクライアントの設定に追加します(例: 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"
}
}
}
}利用可能なツール
start_debug_loop
症状の説明からデバッグループを開始します。AIが根本原因をランク付けされたTDDタスクとして診断し、仮説ごとに標準のTDDパイプラインを実行し、診断結果をまとめたプルリクエストを作成します。
{
"symptom": "read_website returns failure on most real URLs",
"context_files": ["src/tools/read-website.ts", "src/http/client.ts"]
}パラメータ:
symptom(必須) — 観察されたバグや障害の自然言語による説明context_files(オプション) — 診断中にAIが読み込むべきソースファイルへの相対パス
DIAGNOSEステップは標準のTDDパイプラインの前に実行されます(上記のステートマシンを参照)。プルリクエストの本文には、症状、特定された根本原因、修正内容が含まれます。
ブランチ名は <branchPrefix>debug/<symptom-slug> となります。
start_loop
新しい開発ループを開始します。
{
"description": "Add email validation to the user registration flow",
"branch": "claude/email-validation"
}または、事前に分解されたタスクを指定する場合:
{
"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
中断されたループを再開します:
{}loop_status
現在のループステータスを確認します:
{}ライブラリとして使用する
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,
});This server cannot be installed
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