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のプルリクエストを作成します
Related MCP server: Maestro
インストール
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,
});Available Tools
4 toolsadvance_loopA
Report the outcome of the last instruction and get the next one. Call this after completing each phase step. The loop persists state between calls.
| Name | Required | Description | Default |
|---|---|---|---|
| event | Yes | The outcome event. One of: BranchCreated, TasksDecomposed, TaskDone, TaskFailed, BuildPassed, BuildFailed, DeployPassed, DeployFailed, IntegPassed, IntegFailed, IntegFixPassed, IntegFixFailed, QualityDone, TreeClean, PrCreated. | |
| tasks | No | For TasksDecomposed: the decomposed or diagnosed task list. | |
| failureReason | No | For TaskFailed: why the task could not be completed. | |
| stderr | No | For BuildFailed or DeployFailed: the error output. | |
| failures | No | For IntegFailed: array of {testFile, testName, description}. | |
| prUrl | No | For PrCreated: the URL of the opened pull request. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the loop persists state between calls, which is useful context. However, it doesn't describe error handling, rate limits, authentication needs, or what happens if called out of sequence. For a stateful tool with no annotations, more behavioral details would be helpful.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise (two sentences) and front-loaded with the core purpose. Every word earns its place, with no redundant information. The structure moves from primary function to usage guidance efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (stateful loop advancement with multiple event types) and 100% schema coverage but no output schema or annotations, the description is mostly complete. It explains the core workflow and when to use it, though it could benefit from mentioning what the tool returns (the 'next instruction') more explicitly since there's no output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 6 parameters thoroughly with their purposes and event-specific usage. The description doesn't add any parameter-specific information beyond what's in the schema, making the baseline score of 3 appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('Report the outcome', 'get the next one') and distinguishes it from siblings by specifying it's for after completing each phase step in a loop. It explicitly mentions the loop persists state, which differentiates it from start_loop or loop_status.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage guidance: 'Call this after completing each phase step.' This tells the agent precisely when to use this tool versus alternatives like start_loop (for initiation) or loop_status (for checking status without advancing).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
loop_statusB
Get the current status of the loop: phase, branch, task list, failure reason, or PR URL.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It indicates this is a read operation ('Get'), but doesn't specify whether it requires authentication, has rate limits, returns real-time or cached data, or handles errors. The description adds minimal behavioral context beyond the basic action, missing key details for safe and effective use.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core action ('Get the current status of the loop') and lists the retrieved data points without unnecessary words. Every element serves a purpose, making it highly concise and well-structured for quick understanding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has gaps. It covers what data is retrieved, but without annotations or an output schema, it doesn't explain the return format (e.g., structure of the status object) or behavioral aspects like error handling. For a status-checking tool, this leaves some contextual needs unmet.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately adds no parameter information, focusing instead on the tool's purpose and output semantics. This aligns with the baseline expectation for tools without parameters, as the schema fully covers the input structure.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with the verb 'Get' and specifies the resource 'current status of the loop', including what information is retrieved (phase, branch, task list, failure reason, PR URL). It distinguishes itself from sibling tools like 'advance_loop', 'start_debug_loop', and 'start_loop' by focusing on status retrieval rather than initiation or progression, though it doesn't explicitly name these alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by listing the specific data points retrieved (e.g., phase, failure reason), suggesting it's for monitoring or checking loop progress. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., when to check status vs. start or advance a loop) or any prerequisites, leaving usage context inferred rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
start_debug_loopC
Start a debug loop from a symptom description. Returns an instruction telling you to diagnose root causes as ranked TDD tasks, then proceeds through the standard TDD pipeline. The PR body will include a diagnosis writeup.
| Name | Required | Description | Default |
|---|---|---|---|
| symptom | Yes | Natural-language description of the observed bug or failure. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions the tool returns an instruction for TDD tasks and that the PR body includes a diagnosis writeup, giving some insight into outputs and workflow. However, it lacks critical details like whether this is a read-only or mutating operation, error handling, or any side effects, which are essential for a tool that starts processes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately concise with two sentences that front-load the core action and follow with output details. Each sentence adds value: the first defines the tool's purpose, and the second explains the return behavior and PR inclusion. There's no wasted text, though it could be slightly more structured for clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (starting a debug process with no annotations or output schema), the description is incomplete. It covers the basic action and some output hints but misses key behavioral aspects like mutation status, error cases, or interaction with sibling tools. Without annotations or an output schema, more detail is needed to fully inform the agent about this process-initiating tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the 'symptom' parameter fully documented as a natural-language bug description. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints. This meets the baseline score of 3, as the schema does the heavy lifting without extra value from the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Start a debug loop from a symptom description.' It specifies the verb ('Start'), resource ('debug loop'), and input trigger ('symptom description'). However, it doesn't explicitly differentiate from sibling tools like 'start_loop' or 'advance_loop', which reduces clarity about when to choose this specific debug variant.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides minimal guidance on when to use this tool. It mentions the tool initiates a debug loop from a symptom, but offers no explicit when/when-not criteria or alternatives. While it implies usage for bug diagnosis, it doesn't compare to sibling tools like 'start_loop' or specify prerequisites, leaving the agent with little contextual direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
start_loopA
Start a new TDD development loop. Returns an instruction telling you what to do first. Keep calling advance_loop after each step until the loop reaches DONE or FAILED. Phases: INIT → DECOMPOSE → TDD_LOOP → BUILD → DEPLOY → INTEG_TEST → INTEG_FIX → QUALITY_REVIEW → CLEAN_TREE_CHECK → PUSH_AND_PR.
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Natural language description of the work to be done. | |
| tasks | No | Pre-decomposed task list. If provided, skips DECOMPOSE. | |
| branch | No | Git branch name. Generated from description if omitted. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses the tool's purpose and procedural flow (phases, interaction with advance_loop), but lacks details about potential side effects, error conditions, authentication needs, or what 'DONE or FAILED' states entail. It provides basic behavioral context but misses important operational details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured in two sentences: the first states the purpose and return value, the second provides crucial procedural guidance and lists all phases. Every element serves a clear purpose with zero wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (managing a multi-phase development loop) and the absence of both annotations and output schema, the description provides adequate procedural context but lacks details about return values, error handling, and operational constraints. It's complete enough to understand the basic workflow but leaves important implementation questions unanswered.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Start a new TDD development loop') and the resource (the loop itself), with a specific verb. However, it doesn't explicitly distinguish this from its sibling 'start_debug_loop' beyond the name difference, leaving some ambiguity about when to choose one over the other.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage guidance: it tells the agent to 'Keep calling advance_loop after each step until the loop reaches DONE or FAILED' and lists all the phases of the loop. This gives clear procedural context for when and how to use this tool in relation to its sibling 'advance_loop'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
advance_loop - First observed
loop_status - First observed
start_debug_loop - First observed
start_loop
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no overlap: advance_loop progresses the loop, loop_status checks current state, start_debug_loop initiates debugging, and start_loop initiates standard development. The descriptions make it impossible to confuse their functions.
All tools follow a consistent verb_noun pattern with snake_case throughout: advance_loop, loop_status, start_debug_loop, and start_loop. The naming is predictable and readable across the set.
Four tools is well-scoped for a development loop server, covering initiation (start_loop, start_debug_loop), progression (advance_loop), and status checking (loop_status). Each tool earns its place without bloat or gaps.
The tool set provides complete lifecycle coverage for TDD development loops: starting loops (standard and debug), advancing through phases, and checking status. No obvious gaps exist for the stated purpose, enabling agents to manage loops end-to-end.
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Devopness MCP server for DevOps happiness! Empower AI Agents to deploy apps and infra, to any cloud.
- JamOAuthdev.jam.mcp
The Jam MCP server provides AI tools with instant bug context without manual prompting, enabling a streamlined workflow from bug identification to ticket creation and pull request generation without switching between tools.
Related MCP Servers
- AlicenseBqualityBmaintenanceMCP server that integrates DevFlow with AI code assistants to enforce structured development workflows including planning, task tracking, and code review gates.6566 npm1MIT
- FlicenseNot gradedqualityDmaintenanceAn autonomous MCP server for AI-assisted development with zero-API approach, auto-correction, inverted TDD, and native pipelines.-
- AlicenseAqualityAmaintenanceAn MCP server that brings senior-QA discipline to AI coding assistants, enabling test planning, TDD, mutation testing, and code review.486Apache 2.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server that adds engineering discipline to AI-assisted development, enforcing evidence-gated TDD, security review, backup strategy, and deployment generation to turn AI-generated code into production-ready software.8 npm12MIT