How simonives/redwrench works
RedWrench is a Fedora-hosted MCP server that lets an AI agent request system diagnostics and administration without receiving a general shell. Requests enter over HTTP, pass bearer-token authentication, and reach MCP tool dispatch; command invocations are checked against custom rules and a tiered policy before execution, then audited. The product also exposes policy-inspection tools and supports streaming command output. The graph follows documented capabilities and shown imports/calls; some runtime wiring is evidenced only by README statements or the source index, not fully sampled implementation.
Main entry points: mod.rs MCP dispatch · main.rs HTTP server · config.rs Configuration · audit.rs Audit logging
Components 19
Server entry
- CLI options
src/cli.rs - HTTP server
src/main.rs - Bearer auth
src/auth.rs - Configuration
src/config.rs
Policy controls
- Policy engine
src/policy/mod.rs - Tier rules
src/policy/tiers.rs - Policy introspection
src/policy/introspection.rs
MCP tools
- MCP dispatch
src/tools/mod.rs - Capability tools
src/tools/introspection.rs - Service controls
src/tools/systemctl.rs - Journal reader
src/tools/journalctl.rs - Package manager
src/tools/dnf.rs - Network diagnostics
src/tools/network.rs - Command runner
src/tools/run_command.rs
Execution and audit
- Process executor
src/executor.rs - Audit logging
src/audit.rs
Other components
- MCP agent
- Fedora host
- Systemd journal
Connections 22
- MCP agent → HTTP server: sends MCP requests
README.md - CLI options → HTTP server: provides options
src/main.rs - HTTP server → Configuration: loads settings
README.md - HTTP server → Bearer auth: guards requests
src/main.rs - HTTP server → MCP dispatch: serves MCP
src/main.rs - HTTP server → Audit logging: initializes logging
src/main.rs - Configuration → Tier rules: selects baseline
src/config.rs - Configuration → Policy introspection: loads policy rules
src/config.rs - MCP dispatch → Policy engine: checks commands
src/tools/mod.rs - MCP dispatch → Process executor: runs permitted commands
src/tools/mod.rs - MCP dispatch → Audit logging: records invocations
src/tools/mod.rs - Policy engine → Tier rules: uses tier rules
src/policy/mod.rs - Capability tools → Policy introspection: queries capabilities
src/tools/introspection.rs - MCP dispatch → Capability tools: routes capability tools
src/tools/mod.rs - MCP dispatch → Service controls: routes service tools
src/tools/mod.rs - MCP dispatch → Journal reader: routes journal tools
src/tools/mod.rs - MCP dispatch → Package manager: routes package tools
src/tools/mod.rs - MCP dispatch → Network diagnostics: routes diagnostics
src/tools/mod.rs - MCP dispatch → Command runner: routes command tools
src/tools/mod.rs - Process executor → Fedora host: spawns processes
README.md - Journal reader → Systemd journal: reads entries
README.md - Audit logging → Systemd journal: writes audit records
src/audit.rs