armamentarium-fs
Runs whitelisted git commands (e.g. git log, git push) against allowlisted repositories through argv-only exec rules with typed slots and option allowlists, while forcing hardening on every call: fsmonitor off, hooksPath pinned to a root-owned directory of operator-approved hooks, protocol.ext disabled, and no external diff or textconv. The filesystem router additionally refuses writes under .git/, .githooks/ and tests/hooks/ even with a grant.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
armamentarium
Give an AI agent real access to your machines, on your terms.
armamentarium is a host-side MCP server and CLI for people who run Claude (or any MCP client) against their own Linux machines. It provides:
A filesystem router that serves only the directories you allowlist, read-only or read-write, with
..and symlink escapes blocked.arma_exec, a command runner that executes only the command shapes you've written down. Anything that changes things waits for a time-boxed grant that only you can give.Fleet config sync that captures and restores dotfiles across machines, without trusting the shared store it syncs through.
Session roaming that moves Claude Desktop chat sessions between machines.
An armamentarium is the complete kit one brings to a task. This one is built around a simple rule: the agent can ask for anything, but only the operator can grant it, and every grant ends.
Status: v0.1, in daily use on a small Debian fleet. Linux only. Single operator. See Status for what is and isn't done.
Contents
Related MCP server: ScopeRail
Security model
armamentarium enforces policy at the tool boundary. The rules:
Fail closed. With no config, the router serves no paths, and with no exec policy, no commands run. A malformed config refuses everything.
The operator owns the policy, and agents can't reach it.
router.json,exec.jsonand the grants file live in~/.config/armamentarium/, which you should never allowlist. The loaders refuse a policy that is group/world-writable or not owned by you.Grants are time-boxed and only the operator can make them.
arma-elevateis installed root-owned in/usr/local/binand run by you in your own shell. No tool writes grants. A grant enables a named rule or path for minutes (default 15 for exec, hard cap 4 hours), then it lapses on its own.argv, never a shell.
arma_exectakes a list of arguments and runs it withshell=False. Pipes,;,$()and globs mean nothing. Programs are looked up on a fixed system PATH, so a writable~/bincan't shadowgit. The environment is minimal and stdin is closed.Allowlist the shape, not the string. A rule is an argv pattern with typed slots, plus a list of the only options allowed.
git log --output=…,journalctl --vacuum-time, andgit -c core.sshCommand=…are refused by construction, because they aren't listed. No blacklist to keep current.Things git would execute are switched off.
.git/and hook directories are unwritable through the router, even with a grant. Every git call also runs with fsmonitor off,hooksPathpointed at a root-owned directory of hooks you've approved,protocol.extdisabled, and no external diff or textconv.Refusals teach. A refusal names the rule that came closest and the token that failed. When a grant would help, it gives the exact
arma-elevatecommand.Everything is logged. Every decision, allowed or refused, goes to
~/.local/state/armamentarium/exec.log. Every grant that ends goes togrants.log. Two logs, two questions: what was allowed, and what actually ran.Shared storage is untrusted. Anything an agent can write, like a synced config store, is treated as hostile when read back. See Fleet config.
What it is not
Not a sandbox. The server runs as your user. It controls what its own tools will do. It can't stop an agent that also has a different, broader tool (another MCP server with write access, a shell). Audit everything you connect, and treat armamentarium as the narrow door you want everything to go through.
Not multi-user. One operator per machine. Grants are local to the host they're made on.
Not remote, yet.
arma_execruns on the local host only. Ahostargument exists, but remote execution (a dedicated user plus a forced-command shim on each target) isn't built yet.
Install
Requires Python ≥ 3.10 on Linux. Install into a venv. On PEP 668 systems (Debian, Ubuntu) that's the only sane option, and it keeps the MCP dependency tree away from apt's Python.
git clone <this repo> ~/src/armamentarium
python3 -m venv ~/.venvs/armamentarium
~/.venvs/armamentarium/bin/pip install ~/src/armamentariumThis installs three commands into the venv: armamentarium-fs (the MCP server),
armamentarium, and arma (the CLI, two names for the same thing). Link the CLI onto
your PATH if you want it there:
ln -s ~/.venvs/armamentarium/bin/arma ~/.local/bin/armaGrant tooling, root-owned. This matters: if an agent can write the script you use to grant access, it can grant itself access.
sudo install -o root -g root -m 0755 bin/arma-grant /usr/local/bin/arma-grant
sudo ln -sf arma-grant /usr/local/bin/arma-elevate
sudo ln -sf arma-grant /usr/local/bin/arma-revokeApproved git hooks (optional). Agent git calls use this directory as hooksPath,
never the repo's own hooks. Leave it empty for no hooks, or copy in hooks you've reviewed,
for example one that refuses commits that drop an exec bit:
sudo install -d -o root -g root -m 0755 /usr/local/share/armamentarium/git-hooksHook it into your MCP client. It's a local stdio server:
{
"mcpServers": {
"armamentarium": {
"command": "/home/youruser/.venvs/armamentarium/bin/armamentarium-fs"
}
}
}Restart the client fully after changing its config. MCP servers keep the arguments they were launched with.
Filesystem router
The router serves nothing until ~/.config/armamentarium/router.json grants roots:
mkdir -p ~/.config/armamentarium
cp config/router.example.json ~/.config/armamentarium/router.json
$EDITOR ~/.config/armamentarium/router.jsonEach root has "access": "r" or "rw". Paths are resolved (~, symlinks) before the
allowlist check, so ../ and symlink escapes can't leave a root. The config is found
through $ARMAMENTARIUM_ROUTER_CONFIG, then ~/.config/armamentarium/router.json.
A path grant (arma-elevate path <dir> [r|rw] [ttl]) can add a root for a while, or
temporarily upgrade a read-only root to read-write. A grant never downgrades access.
Writes and deletes under .git/, .githooks/ or tests/hooks/ are always refused.
Tools
Tool | What it does |
| Read a UTF-8 text file (truncation cap) |
| Atomic write; refuses to overwrite or create parents unless asked |
| Delete a file or directory; requires |
| Entries with type and size |
| Type, size, mtime, mode |
| Find by name glob and/or literal content, depth- and result-bounded |
| Run one command allowed by |
| List the exec rules, roots, and active exec grants |
| Loaded roots, backends, and active grants with time left |
Running commands: arma_exec
arma_exec runs a command only if a rule in ~/.config/armamentarium/exec.json
matches it. Start from the example:
cp config/exec.example.json ~/.config/armamentarium/exec.json
chmod 0644 ~/.config/armamentarium/exec.jsonRule format
"roots": {
"repos-read": ["~/projects/*"],
"repos-write": ["~/projects/*/*"]
},
"rules": {
"git-log": {
"mode": "always",
"argv": ["git", "-C", "{path:repos-read}", "log"],
"options": {"--oneline": null, "-n": "{int}", "--since": "{time}"},
"args": ["{ref?}"]
},
"git-push": {
"mode": "elevated",
"argv": ["git", "-C", "{path:repos-write}", "push"],
"options": {"-u": null},
"args": ["{word?}", "{name?}"],
"timeout": 60
}
}argvis a fixed prefix. Each element is a literal, ana|balternative, or a typed slot.Slots:
{int}{name}{word}{unit}{host}{time}{text}{ref}{dataset}. A?suffix makes a slot optional.{path:ROOT}must resolve (realpath) under one of the named root's patterns, and the command runs with the resolved path, not the caller's spelling.optionsare the only flags allowed after the prefix, each with a value type, ornullfor a bare flag. Bundled short flags (-sb) aren't expanded: write-s -b.argsare the positional arguments after the options.mode:alwaysruns with no grant.elevatedneeds a live grant for that rule on this host. A rule without a mode is elevated.sudo: trueruns throughsudo -n(never prompts). It needs a NOPASSWD sudoers line for that exact command; there is no blanket sudo.hosts(default all),timeout(seconds),max_output(bytes).
A good rule of thumb: reads are always, anything that changes state is elevated.
Leave out reads that return secrets entirely (env, git config, unrestricted
systemctl show), since everything a command prints lands in the conversation.
What a call returns
{"allowed": true, "reason": "allowed by 'git-log' (always)", "rule": "git-log",
"exit_code": 0, "stdout": "...", "stderr": "", "truncated": false,
"timed_out": false, "duration_ms": 18, "ran": ["/usr/bin/git", "-c", "...", "log", "..."]}ran is the exact argv that executed, hardening included. A refusal looks like this:
{"allowed": false, "rule": "git-push",
"reason": "needs rule 'git-push', which requires the operator's approval and there is no active grant for it on myhost",
"hint": "arma-elevate exec git-push [ttl]", "ran": []}User services and the session bus
Commands like systemctl --user need XDG_RUNTIME_DIR and the user's D-Bus, and MCP
servers are often launched without them. The runner fills them in from
armamentarium.session_env. It accepts an inherited or derived value only if it checks
out: /run/user/<uid> must be a real directory you own with mode 0700, and the bus a
socket you own inside it. You can use the same module from any shell:
eval "$(~/.venvs/armamentarium/bin/python -m armamentarium.session_env)"
~/.venvs/armamentarium/bin/python -m armamentarium.session_env --check # explains each decision(If --check reports a bus in /tmp, your desktop was probably started under
dbus-run-session, which gives it a private bus separate from systemd's. Starting the
compositor without that wrapper is usually the fix.)
Grants: arma-elevate / arma-revoke
Run these yourself, never with sudo:
arma-elevate exec <rule> [host] [ttl] # enable a named exec rule (default 15m)
arma-elevate path <dir> [r|rw] [ttl] # add or upgrade a filesystem root (default rw, 1h)
arma-elevate list [expired] [--since T] # active grants, or the ledger of ended ones
arma-revoke exec <rule> [host] # end one grant now
arma-revoke path <dir>
arma-revoke all # end everything
arma-revoke # refuses and lists, never an implicit 'all'TTL is 900, 30s, 15m, 2h or 1d. The hard cap is 4 hours; longer requests are
clamped, and it tells you so. host defaults to this machine. A grant names a rule,
not a command: it can't authorize an argv that no rule describes, so
arma-elevate exec "rm -rf /" has nothing to enable.
Live grants are in ~/.config/armamentarium/elevate.json (0600; arma-grant is its only
writer, and the router only reads it). Ended grants move to
~/.local/state/armamentarium/grants.log with how they ended: revoked, revoke-all or
expired.
Fleet config: arma config
Capture selected files from ~/.config into a shared, git-backed store, compare hosts, and
restore a host from its last-known-good copy:
arma config capture # this host's tracked files -> store (commits only this host's dir)
arma config status # tracked vs captured, live-vs-store drift
arma config diff hostA hostB # compare two hosts' captures
arma config deploy # PLAN: what a restore would change, with diffs
arma config deploy --apply # restore, interactively
arma config adopt [--apply] # propose files already in the store for trackingThe store root is $ARMA_FLEET_ROOT, or ~/Datasets/Profectionis/fleet-config by default.
Override it for your layout.
Trust model. The store is shared, so assume an agent can write to it. Several
~/.config files run code (login autostart, systemd user units, MCP server commands,
armamentarium's own policy), so restoring blindly from the store would be remote code
execution with extra steps. Instead:
The tracked list is local and operator-owned:
~/.config/armamentarium/tracked.txton each host. The store copy is generated and informational. Capture refuses.., absolute paths, symlink escapes, and a deny list of secret-looking paths (credential dirs, browser profiles, key files, names containing token, secret, password and similar).deployis a dry run by default and prints a unified diff for every change.deploy --applyneeds a terminal: one[y/N]for the set (default No), plus the file name typed for every code-running file (labwc/,kanshi/,systemd/,autostart/,environment.d/, the Claude Desktop config, and anything with a shebang or exec bit).exec.jsonandrouter.jsonare never written by deploy. You get the diff and aninstallcommand for a reviewed snapshot outside the store.elevate.jsonis never synced in either direction.What gets written is exactly what you reviewed: the bytes are captured at plan time. A file that changed since the plan is skipped. New files get 0644, so an exec bit can't ride in from the store.
config/armamentarium-config-watch.{service,sh} is an optional user unit that runs
capture when tracked files change.
Session roaming: arma dock / undock
Move a Claude Desktop chat session between machines over shared storage. Docking syncs the session directory and sidecar into this machine's session tree, then rewrites stale mount-root paths (and the device UUID, if it differs). Scheduled tasks are out of scope.
cp config/dock.example.json ~/.config/armamentarium/dock.json # mount-root map, source dirs
arma list # dockable sessions
arma dock <session-dir> # plan only
arma dock <session-dir> --apply --restart # stop Desktop, dock, start Desktop
arma undock <local-session-dir> --remove-local
arma roaming status # who holds which sessionA checkout ledger on the shared store keeps one session live on one machine at a time.
dock --apply refuses if another machine holds the session (--force overrides). The
optional desktop.json lets --restart stop and start Claude Desktop (arma desktop status|start|stop|restart).
Claude Desktop's on-disk session layout changes between releases. If
listcomes up empty after an app update, check thatdock.json's paths still match before docking.
Other commands
arma fleet ls|status|enroll|heartbeat|set-master|sessions: a small machine registry (presence, master designation) on the shared store.arma packages apt sync-cache [--apply]: copies new.debs from this machine's apt cache into a flat offline repo and triggers its reindex. A dry run by default.arma router status: the router's view of its config, from the CLI.
Testing
cd ~/src/armamentarium
~/.venvs/armamentarium/bin/python -m unittest discover -s testsRun the tests as a non-root user. They use real subprocesses in temp directories (git
repos, unix sockets) and play attacker against the policy, grant, and deploy code: hostile
argv, symlink and .. escapes, planted git hooks and fsmonitor, a tampered config store,
and more. There are about 150 tests, all stdlib unittest; no pytest needed.
Layout
armamentarium/
armamentarium/
cli.py # `arma ...` entry point
exec_policy.py # exec.json loader + matcher (pure; decides, runs nothing)
exec_runner.py # runs an allowed argv: fixed PATH, minimal env, git hardening, logging
session_env.py # verified XDG_RUNTIME_DIR + session D-Bus discovery
config_sync.py # fleet config capture/diff/deploy/adopt/status + trust model
dock.py # session dock planning/applying
roaming.py # checkout ledger + undock
desktop.py # optional Claude Desktop process control
fleet.py # machine registry
packages.py # package-state sync (apt sync-cache so far)
mcp_router/
config.py # router.json + elevate.json loading (security boundary)
router.py # path resolution, allowlist, protected paths, grants
backends.py # Backend interface + local filesystem backend
server.py # the MCP tool surface
bin/
arma-grant # grant CLI (stdlib only; installed root-owned)
arma-elevate -> arma-grant
arma-revoke -> arma-grant
config/ # *.example.json + optional config-watch unit
tests/
pyproject.tomlStatus
v0.1.0. Used daily on a small Debian trixie fleet (labwc/Wayland desktops, NFS-shared storage, tailnet).
Done: the filesystem router with path grants; arma_exec with policy, grants, hardening
and logging; session roaming with the checkout ledger; fleet config with the untrusted-store
deploy model; verified session-bus discovery.
Not yet:
Remote exec: a per-host
cognateuser, a forced-command shim re-checking the policy on the target, ssh transport.Single-use grants:
arma-elevate run <file>with sha256 pinning.A sudoers generator built from
exec.json.A GUI that explains rules, grants and history in plain language.
Remote router backends.
Portable scheduled tasks.
The rest of
packages: Flatpak, Snap and AppImage.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted remote MCP for protected account access, permissions, activity history and supported undo.
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
Hosted MCP server for scoped credential retrieval by AI agents. Approve specific service keys, review credential-access audit logs, and revoke future retrieval access. Connect with OAuth or an agent token.
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables remote filesystem access and command/process control through MCP, with safe-by-default permission profiles that restrict file operations to configured roots and make command execution an explicit opt-in.MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to run files, processes, shell sessions, browser automation, and native macOS UI actions under explicit workspace permissions and auditable controls.Apache 2.0
- AlicenseAqualityCmaintenanceEnables MCP clients on macOS to perform bounded read-only filesystem operations and a narrow allowlist of process diagnostics over STDIO or authenticated loopback Streamable HTTP. It excludes file writes, arbitrary shell access, GUI/browser automation, and remote relay.10MIT
- AlicenseNot gradedqualityBmaintenanceEnables owner-controlled local file operations, read-only Git inspection, and exact preconfigured command profiles through MCP for secure remote computer workflows.MIT