MCP Integration
sentrux runs as an MCP server, giving your AI agent real-time access to architectural health.
Claude Code
Section titled “Claude Code”/plugin marketplace add sentrux/sentrux/plugin install sentruxCursor / Windsurf / OpenCode / any MCP client
Section titled “Cursor / Windsurf / OpenCode / any MCP client”Add to your MCP configuration:
{ "mcpServers": { "sentrux": { "command": "sentrux", "args": ["--mcp"] } }}Agent workflow
Section titled “Agent workflow”Agent: scan("/Users/me/myproject") → { quality_signal: 7342, files: 139, bottleneck: "modularity" }
Agent: session_start() → { status: "Baseline saved", quality_signal: 7342 }
... agent writes 500 lines of code ...
Agent: session_end() → { pass: false, signal_before: 7342, signal_after: 6891, summary: "Quality degraded during this session" }The agent sees its own impact. If quality drops, it knows immediately.
Available tools
Section titled “Available tools”| Tool | Purpose |
|---|---|
scan | Scan a directory, get quality signal + file list |
health | Detailed root cause breakdown with diagnostics |
session_start | Save baseline before agent session |
session_end | Compare against baseline, detect degradation |
rescan | Re-scan after changes (faster than full scan) |
check_rules | Validate against .sentrux/rules.toml |
git_stats | Git history analysis — hotspots, churn, bus factor |
dsm | Design Structure Matrix (dependency matrix) |
test_gaps | Find untested code paths |
Example MCP response
Section titled “Example MCP response”{ "quality_signal": 7342, "bottleneck": "modularity", "root_causes": { "modularity": { "score": 6700, "raw": 0.45 }, "acyclicity": { "score": 10000, "raw": 0 }, "depth": { "score": 10000, "raw": 4 }, "equality": { "score": 6100, "raw": 0.35 }, "redundancy": { "score": 8800, "raw": 0.12 } }}The agent targets the lowest-scoring root cause for maximum improvement per change.
The feedback loop
Section titled “The feedback loop”sentrux (sensor) → quality_signal → AI agent (controller) → code changes (actuator) → codebase (system) → sentruxThis is classical cybernetics (Wiener 1948). The loop converges naturally — each iteration the agent fixes the biggest bottleneck, improvements become marginal, convergence is reached.