find_zombies
Detect abandoned dev servers using uptime, CPU, and memory thresholds, automatically excluding IDE, LSP, agent, and database processes. Returns candidates with reasons for manual review.
Instructions
Find dev servers that look abandoned: uptime>6h AND cpu<1% AND mem>100MB. Excludes IDE/LSP/agent/DB noise (vscode-server, language-servers, MCPs, postgres, sidekiq, etc) by default. Returns candidates with reasons. Does not auto-kill. Set include_excluded=true to also list noise that meets the heuristic.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_excluded | No | Include IDE/LSP/agent/DB processes that match the zombie heuristic. Default false. |
Implementation Reference
- src/dev-servers.ts:68-86 (handler)The main handler function for find_zombies. Calls listDevServers(), filters by zombie heuristic (uptime > 6h, cpu < 1%, mem > 100MB), optionally excludes IDE/LSP/agent processes, and returns ZombieCandidate with reasons.
export async function findZombies(opts: { include_excluded?: boolean } = {}): Promise<ZombieCandidate[]> { const all = await listDevServers(); const out: ZombieCandidate[] = []; for (const s of all) { const excluded = isExcludedFromZombie(s.cmdline); if (excluded && !opts.include_excluded) continue; const oldEnough = s.uptime_seconds > 6 * 3600; const idle = s.cpu_pct < 1; const heavy = s.memory_mb > 100; if (oldEnough && idle && heavy) { const tag = excluded ? " [excluded:IDE/LSP/agent]" : ""; out.push({ ...s, reason: `uptime ${(s.uptime_seconds / 3600).toFixed(1)}h, cpu ${s.cpu_pct}%, mem ${s.memory_mb}MB${tag}`, }); } } return out; } - src/types.ts:15-17 (schema)ZombieCandidate interface extending DevServer with a 'reason' string field explaining why it's a zombie candidate.
export interface ZombieCandidate extends DevServer { reason: string; } - src/index.ts:47-60 (registration)Tool registration/definition for 'find_zombies' including its name, description, and inputSchema (optional 'include_excluded' boolean).
name: "find_zombies", description: "Find dev servers that look abandoned: uptime>6h AND cpu<1% AND mem>100MB. Excludes IDE/LSP/agent/DB noise (vscode-server, language-servers, MCPs, postgres, sidekiq, etc) by default. Returns candidates with reasons. Does not auto-kill. Set include_excluded=true to also list noise that meets the heuristic.", inputSchema: { type: "object", properties: { include_excluded: { type: "boolean", description: "Include IDE/LSP/agent/DB processes that match the zombie heuristic. Default false.", default: false, }, }, additionalProperties: false, }, }, - src/index.ts:100-104 (handler)The MCP CallToolRequestSchema handler case that extracts include_excluded arg, calls findZombies(), and returns the results.
case "find_zombies": { const include_excluded = Boolean((args as any)?.include_excluded); const data = await findZombies({ include_excluded }); return ok({ count: data.length, candidates: data }); } - src/dev-servers.ts:49-66 (helper)ZOMBIE_EXCLUDE_PATTERNS regex list and isExcludedFromZombie helper function that filters out IDE/LSP/agent/DB processes from zombie detection.
// Cmdline patterns that look dev-server-shaped but are noise (IDEs, LSPs, agents, // daemons, in-process MCPs). Never zombie-flag these. const ZOMBIE_EXCLUDE_PATTERNS: RegExp[] = [ /vscode-server|\.vscode-server/, /vscode\.js-debug/, /[-_]language[-_]server\b/, /\b(pyright|pylsp|gopls|rust-analyzer|clangd|metals|jdtls|solargraph|sorbet|tailwindcss-language-server)\b/, /\bmcp-server[-_]/, /\b(copilot|continue-dev|cursor-agent|claude-code)\b/i, /\b(sidekiq|celery|resque|delayed_job|hangfire)\b/, /\b(redis-server|postgres|mysqld|mongod|memcached|elasticsearch)\b/, /\bnvim\b|\bvim\b|\bemacs\b/, /\bjupyter\b|\bipykernel_launcher\b/, ]; function isExcludedFromZombie(cmdline: string): boolean { return ZOMBIE_EXCLUDE_PATTERNS.some((re) => re.test(cmdline)); }