Agent Daemon Integration
adr-ledger does not ship its own MCP server binary.
The supported model is:
adr-ledgerowns the ledger, governance rules, chain state, and NixOS modules.securellm-mcpprovides the MCP transport/runtime.- ADR agents run as isolated system users with granular filesystem access, but all of them execute the
securellm-mcppackage as backend.
NixOS module layout
The flake now exports three modules:
nixosModules.adr-ledgernixosModules.adr-ledger-syncnixosModules.adr-ledger-agents
For host usage, the normal entrypoint is nixosModules.adr-ledger, which imports sync plus agent daemon management.
Minimal host example
{
imports = [
inputs.adr-ledger.nixosModules.adr-ledger
];
services.adr-ledger = {
enable = true;
ledgerPath = /var/lib/adr-ledger;
autoSync = true;
};
services.adr-ledger-agents = {
enable = true;
ledgerRoot = "/var/lib/adr-ledger";
agents = {
cerebro = {
role = "agent";
};
spectre = {
role = "engineer";
repoAccess = "propose";
};
architect = {
role = "architect";
repoAccess = "maintain";
};
};
};
}
Security model
Each configured agent gets:
- a dedicated system user and primary group
- a private home, cache, log, and workspace directory
- role-derived
ADR_ALLOWED_ACTIONS - role-derived repository write scope
- hardened
systemdsettings such asProtectSystem=strict,PrivateTmp=true,NoNewPrivileges=true, and bounded writable paths
The service exposes:
ADR_AGENT_NAMEADR_AGENT_ROLEADR_ALLOWED_ACTIONSADR_REPO_PATHMCP_WORKDIRNODE_ENVMCP_ENV
Repository access levels
Current repository access presets are:
read-only: no write access to the ledger treepropose: write access only toadr/proposedmaintain: write access toadr,.chain,knowledge, andreports
These defaults can be tightened further with:
extraReadOnlyPathsextraReadWritePathsextraGroupsenvironment
Runtime package
The module expects securellm-mcp from the flake input and uses its package output as the daemon backend.
By default:
services.adr-ledger-agents.package = inputs.securellm-mcp.packages.${pkgs.system}.default
You can override that package explicitly if needed.
What is intentionally not supported here
The following model is intentionally deprecated for this repository:
- a local
adr-mcp-serverbinary shipped byadr-ledger - a standalone
scripts/adr-ledger-mcp.serviceas the primary deployment method - docs that imply ADR MCP transport is implemented independently from
securellm-mcp
If you need a manual daemon outside NixOS, document it in terms of securellm-mcp invoking the ADR tools, not a separate MCP server living in this repo.