Vibe Engineering MCP
# VIBE ENGINEERING MCP
> **An Agentic Software-Engineering Operating System & Control Plane** that manages requirements, architecture, tasks, workspaces, execution, verification, integration, and checkpoints for autonomous software development.
[](https://github.com/prabhurajvardhan/Dev-MCP/actions/workflows/ci.yml)
[](LICENSE)
[](tsconfig.json)
[-green)](https://ts.sdk.modelcontextprotocol.io/v2/)
---
## π‘ Core Philosophy
```
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β WORKER INTELLIGENCE (LLM) β
β (Claude Code, Cursor, Gemini, GPT, Custom Agent) β
ββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β JSON-RPC / MCP Protocol
ββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ
β ENGINEERING CONTROL PLANE (MCP) β
β Vibe Engineering MCP β
ββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββ
β β β
ββββββΌββββββββββββββββββ βββββββΌβββββββββββββββββ ββββββββΌββββββββββββββββββ
β Task DAG Scheduler β β Completion Gate β β Checkpoint & Resumptionβ
β Cycle Detection β β Observable Harness β β Git Commit Snapshots β
β Topological Ordering β β Contract Verifier β β Worker Continuation β
ββββββ¬ββββββββββββββββββ βββββββ¬βββββββββββββββββ ββββββββ¬ββββββββββββββββββ
β β β
βββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ
β ISOLATION & EXECUTION POLICIES β
β Git Worktrees Β· Command Policy Β· Path Policy Β· Observer β
ββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ
β DUAL-LAYER STATE STORAGE β
β SQLite (ACID Operational DB) Β· .vibe/ (YAML Specs) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
* **The LLM is NOT the source of truth for project state.**
* **The MCP server is the engineering operating system.**
* A task cannot become `VERIFIED` merely because an LLM claims it is finished.
* A capability is complete only when:
$$\text{Implementation} + \text{Runnable Harness} + \text{Observable Output} + \text{Contract Verification} + \text{Integration Compatibility} + \text{Checkpoint}$$
have all passed with reproducible evidence.
---
## π Task State Machine & Completion Gate
Tasks progress through strict state machine transitions:
$$\text{BLOCKED} \longrightarrow \text{READY} \longrightarrow \text{CLAIMED} \longrightarrow \text{BUILDING} \longrightarrow \text{VERIFYING} \longrightarrow \text{VERIFIED} \longrightarrow \text{INTEGRATING} \longrightarrow \text{VERIFIED}$$
### The Completion Gate (`task_complete`)
When `task_complete` is invoked by a worker:
1. Inspects the task and active workspace.
2. Inspects Git working tree and modified files.
3. Inspects Git diff.
4. Executes unit and component tests.
5. Runs the module's registered **Observable Harness** (CLI, HTTP, DB, AI, UI).
6. Captures standard output, standard error, exit code, and execution time.
7. Evaluates contract rules (exit codes, regex patterns, JSON schema verification, artifact existence).
8. Checks cross-module integration requirements.
9. **On Pass**: Transitions task to `VERIFIED`, updates DAG readiness for dependent tasks, and records state.
10. **On Fail**: Rejects completion, transitions task to `FAILED`, and automatically schedules an **Automated Repair Task** in state `READY` populated with:
* Original task ID
* Failure reason
* Failing command
* Relevant stdout/stderr
* Affected files
* Suggested remediation action
---
## π‘οΈ Git Worktree Workspace Isolation
Unlike naive implementations that share or pollute the project root directory, Vibe Engineering MCP provisions dedicated **Git worktrees** for each worker/task:
* Worktrees are created under `.worktrees/ws-<workerId>-<taskId>` on isolated Git branches (`worker/<workerId>/task-<taskId>`).
* The system never silently falls back to the project root. If worktree provisioning fails, it throws an explicit diagnostic error.
* Worktree metadata is fully tracked (`workspaceId`, `taskId`, `branch`, `worktreePath`, `repositoryPath`, `status`, `createdAt`).
* Worktrees can be safely cleaned up with `cleanupWorkspace` (`git worktree remove --force`).
---
## π Security Model
### Command Policy (`src/security/command-policy.ts`)
* Scopes terminal command execution to the project or designated worktree.
* Blocks destructive commands (`rm -rf /`, formatting disks via `mkfs`, overwrite via `dd`, fork bombs `:(){ :|:& };:`, unauthorized `sudo`).
* Requires execution inside valid workspace boundaries.
* Every command execution records: execution ID, command, cwd, timestamp, exit code, stdout, stderr, and duration to SQLite.
### Path Policy (`src/security/path-policy.ts`)
* Enforces strict containment within project/worktree root.
* Resolves symlinks and prevents directory traversal attacks (e.g. `../../etc/passwd`).
---
## π οΈ Registered MCP Tools (28 Tools)
Migrated to the current **MCP TypeScript SDK V2** (`@modelcontextprotocol/server`):
| Category | Tool | Description |
|---|---|---|
| **PROJECT** | `project_initialize` | Initializes or connects to a project with SQLite state & `.vibe/` directory |
| | `project_inspect` | Full operational snapshot (DAG counts, git status, active workers) |
| | `project_resume` | High-density context briefing for cold model resumption |
| **REQUIREMENTS** | `requirements_compile` | Compiles human specifications into structured capabilities & criteria |
| **ARCHITECTURE** | `architecture_generate` | Records modular boundaries, entrypoints, and contracts |
| | `architecture_validate` | Validates DAG acyclicity and interface consistency |
| **TASKS** | `task_create` | Creates a new task with dependencies and observable contract specification |
| | `task_next` | Returns next highest priority `READY` task (prioritizes repair tasks) |
| | `task_claim` | Assigns a `READY` task to a worker model |
| | `task_complete` | Evaluates task through Completion Gate with auto-repair synthesis |
| | `task_fail` | Explicitly marks a task as `FAILED` with diagnostic reason |
| **WORKSPACE** | `workspace_create` | Creates isolated Git worktree and branch for a worker |
| | `workspace_status` | Inspects all active worker workspaces |
| **REPOSITORY** | `repo_read_file` | Safe file read bounded by workspace containment |
| | `repo_write_file` | Safe atomic file write bounded by workspace root |
| | `repo_delete_file` | Safe workspace file deletion |
| **TERMINAL** | `terminal_exec` | Policy-checked scoped terminal command execution |
| **GIT** | `git_status` | Returns working tree status, staged, modified, and untracked files |
| | `git_diff` | Returns working tree or cached diff |
| | `git_commit` | Stages changes and creates git commit |
| | `git_branch` | Creates and checks out branch |
| | `git_merge` | Merges branch with `--no-ff` |
| **MODULES** | `module_run` | Executes module runnable harness and captures metrics |
| | `module_observe` | Records reproducible observable evidence |
| **VERIFICATION** | `contract_verify` | Evaluates evidence against contract rules |
| | `integration_verify` | Executes cross-module integration test harness |
| **CHECKPOINTS** | `checkpoint_create` | Records comprehensive snapshot (SHA, capabilities, DAG, decisions) |
| | `checkpoint_load` | Loads historic milestone checkpoint |
---
## π Getting Started
### Prerequisites
* **Node.js**: `v20.0.0` or higher (Tested on Node 22 with built-in `node:sqlite`)
* **Git**: `2.30+` with worktree support
### Installation
```bash
git clone https://github.com/prabhurajvardhan/Dev-MCP.git
cd Dev-MCP
npm ci
```
### Typecheck & Test Suite
```bash
npm run typecheck
npm test
```
The test suite includes:
* 4 Unit test suites: Task DAG scheduler, SQLite state store, command security policy, contract engine.
* 4 Integration test suites: Real MCP client protocol over stdio (`@modelcontextprotocol/client`), 19-step autonomous engineering loop, task completion gate & repair generation, MCP server tools interface.
### Build Project
```bash
npm run build
```
Compiles TypeScript into `./dist`.
---
## π Running the MCP Server (Stdio)
The MCP server uses pure stdio JSON-RPC transport (`serveStdio`).
* Standard output (`stdout`) is strictly reserved for JSON-RPC messages.
* All logging and diagnostic outputs are routed to `stderr`.
```bash
npm run mcp
# or
npx tsx src/server/index.ts
```
### Configuration in Claude Code / Claude Desktop
Add to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"vibe-engineering": {
"command": "npx",
"args": ["-y", "tsx", "/path/to/Dev-MCP/src/server/index.ts"]
}
}
}
```
### Configuration in Cursor
In **Cursor Settings** $\to$ **Features** $\to$ **MCP Servers**:
* **Name**: `vibe-engineering`
* **Type**: `command`
* **Command**: `npx -y tsx /path/to/Dev-MCP/src/server/index.ts`
---
## π `.vibe/` Inspectable Project State
In addition to SQLite operational ACID storage, human-readable YAML state is maintained under `.vibe/`:
```
.vibe/
βββ architecture.yaml # System design, modular boundaries, contracts
βββ requirements.yaml # Product goals & acceptance criteria
βββ modules.yaml # Registered modules & runnable harnesses
βββ tasks.yaml # Task DAG and execution status
βββ checkpoints/ # Frozen capability snapshots (latest.yaml + chk-*.yaml)
βββ contracts/ # Interface contracts
βββ observations/ # Reproducible evidence logs (evd-*.yaml)
βββ decisions/ # Architectural decision records
```
---
## β οΈ Current Scope & Limitations (V0)
* **Local Focus**: V0 is optimized for single-machine local development using Git worktrees and SQLite.
* **No Remote Workers**: Distributed worker pools or cloud message brokers are deferred to V1.
* **Synchronous Worktree Operations**: Worktree allocation is local to the filesystem where the MCP server runs.
---
## π License
Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for details.
TDQS
Scored across 28 tools
Most tools have clearly distinct resource-action purposes, with prefixes and descriptions that separate tasks, git, repo, workspace, architecture, and verification concerns. Some overlap exists among status/context tools such as project_inspect, project_resume, workspace_status, and checkpoint_load, but their descriptions make the intended use reasonably clear.
All tool names use consistent snake_case with predictable domain prefixes such as task_, git_, repo_, workspace_, architecture_, and checkpoint_. The verb/noun ordering is not perfectly uniform, but the convention is highly readable and consistent across the set.
28 tools is heavy and exceeds the ideal 3-15 range for a single MCP server. The complex engineering lifecycle justifies many of them, but there is likely room to consolidate status/context tools, making the surface borderline rather than well-scoped.
The set covers the major lifecycle stages: project setup, requirements, architecture, task DAGs, workspaces, file operations, terminal execution, git, modules, contracts, integration verification, and checkpoints. Minor gaps include no explicit task_update/task_list, checkpoint_list, or workspace_cleanup, but agents can work around these through project_inspect and terminal_exec.