Skip to content

MCP Integration

sentrux runs as an MCP server, giving your AI agent real-time access to architectural health.

/plugin marketplace add sentrux/sentrux
/plugin install sentrux

Cursor / 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: 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.

ToolPurpose
scanScan a directory, get quality signal + file list
healthDetailed root cause breakdown with diagnostics
session_startSave baseline before agent session
session_endCompare against baseline, detect degradation
rescanRe-scan after changes (faster than full scan)
check_rulesValidate against .sentrux/rules.toml
git_statsGit history analysis — hotspots, churn, bus factor
dsmDesign Structure Matrix (dependency matrix)
test_gapsFind untested code paths
{
"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.

sentrux (sensor) → quality_signal → AI agent (controller)
→ code changes (actuator) → codebase (system) → sentrux

This is classical cybernetics (Wiener 1948). The loop converges naturally — each iteration the agent fixes the biggest bottleneck, improvements become marginal, convergence is reached.