tool: enforce_architecture
input: {
rules?: Array<{
from: string, // glob pattern: "src/controllers/**"
to: string, // glob pattern: "src/models/**"
allowed: boolean // false = this dependency is forbidden
}>,
filePath?: string, // check specific file against rules
autoDetect?: boolean // infer rules from existing module structure
}
output: {
violations: Array<{
from: string,
to: string,
rule: string,
severity: "error" | "warning"
}>,
passed: boolean,
suggestions: string[]
}
Summary
Add an
enforce_architectureMCP tool that validates proposed changes against architectural rules. dependency-cruiser does this for humans — nobody does it for AI agents via MCP.Motivation
Proposed API
Features
Acceptance Criteria
Priority
Short-term — Unique capability no competitor offers via MCP.