janitor-mcp
Provides tools for Linux system health monitoring and cleanup, including reporting RAM/swap/tmpfs pressure, detecting and sweeping orphaned development workers, and removing age-gated stale sockets and scratch caches.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@janitor-mcp check RAM and /tmp pressure, then dry-run sweep orphaned workers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
janitor-mcp
Linux system health, orphan-process sweeper and transient cache cleaner for agentic workspaces, exposed as a local MCP server (stdio, no network).
Reports RAM/swap//tmp tmpfs pressure, detects orphaned development workers
(headless browsers, dead agent runners, detached compilers), sweeps them behind
an immutable protected denylist (SIGTERM → 3s → SIGKILL, dry_run by default)
and removes age-gated stale sockets and scratch caches.
Run
python3 -m venv .venv && .venv/bin/pip install -e .
.venv/bin/python3 -m janitor.server # stdio MCP (same as the `janitor` script)Related MCP server: sweep-mcp
Test
.venv/bin/pip install -e . pytest
.venv/bin/python3 -m pytest tests/ -q
bash scripts/check-file-size.shInstalled console shim
~/.local/bin/janitor points at the isolated runtime
~/.local/share/janitor-mcp/runtime, independent of this checkout. It is
registered as janitor in ~/.orquestra/mcps.json; orquestra --mcp-deploy
compiles it into every harness config.
Storage rule
Never create files in /tmp/ (it is RAM-backed tmpfs here); all scratch must
live under /var/tmp/testing/.
License
MIT — see LICENSE.
Available Tools
5 toolsjanitor_clean_cachesA
Clean transient caches. targets: sockets (dead ~/.orquestra/*.sock), staging (.codex marketplace staging), testing_scratch (/var/tmp/testing). older_than_hours=6 gates every removal; dry_run=true (default) only reports.
Inputs: dry_run, targets, older_than_hours. Returns: object
janitor_oom_inspectA
Inspect oom_score and oom_score_adj for active agent runners to show kernel sacrifice priority under memory pressure, with recommendations.
Inputs: no named parameters. Returns: object
janitor_scan_orphansA
Scan this user's processes for suspected orphaned development workers (PPID=1, dead parent, zombie): headless browsers, agent runners, detached compilers and python sub-workers.
Inputs: no named parameters. Returns: result
janitor_sweep_processesA
Terminate processes safely. Provide explicit pids and/or target_type='orphans'|'browsers'|'compilers'. dry_run=true (default) only reports; force=true allows SIGKILL after a 3s SIGTERM grace. systemd, compositors, sshd, shells and OrquestraAI are always refused.
Inputs: pids, force, dry_run, target_type. Returns: object
janitor_system_healthA
RAM/swap/tmpfs health: used/free RAM and swap, /tmp tmpfs utilization, CPU load and the top-5 processes by resident memory. alert=true past 85% RAM or 80% /tmp.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a fairly distinct role: health monitoring, orphan scanning, process termination, cache cleaning, and OOM inspection. The only mild overlap is between janitor_scan_orphans (read) and janitor_sweep_processes with target_type='orphans' (write), but the descriptions make the scan-vs-act split clear.
All five tools use a uniform janitor_ prefix followed by a snake_case verb_noun pattern (system_health, scan_orphans, sweep_processes, clean_caches, oom_inspect). The convention is consistent throughout with no style deviations.
Five tools is well-scoped for a system janitor: monitor, scan, terminate, clean, and inspect. Each tool earns its place with no redundant or filler operations.
The surface covers the core janitor lifecycle: observe health, find orphans, kill processes, clean caches, and assess OOM priority. Minor gaps exist, such as no general disk-usage reporting beyond tmpfs/swap or a way to list configured cache targets, but core workflows are covered.
Related MCP Connectors
macOS process-tree reaper, simulator runaway guard, and $10/mo token cap for AI coding agents.
Secure Linux sandboxes for AI agents, as MCP tools.
Read-only Linux server and Docker monitoring for AI assistants: CPU, memory, disk, network.
Read-only server insight: why a Linux server or K8s cluster is slow, failing or changed.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to monitor and manage Linux infrastructure including services, logs, processes, disk, memory, ports, cron, nginx, Docker, and system health checks via the Model Context Protocol.10MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLM agents to safely reclaim disk space by deleting build artifact directories like node_modules, .venv, and target, with strong guardrails to prevent accidental or malicious deletion.MIT
- FlicenseBqualityDmaintenanceEnables safe scanning and cleaning of macOS developer caches and temporary files, with dry-run support and strict refusal to delete non-whitelisted locations.3-
- AlicenseNot gradedqualityCmaintenanceEnables agents to capture task-scoped residue evidence during test and build workflows, exposing files, directories, processes, and ports for user-authorized cleanup and post-cleanup verification without deleting or modifying anything itself.Apache 2.0