MCP Orphan Monitor — AI skill for Claude Code
Detect and kill orphaned MCP server processes that survive after AI coding tool sessions crash or close uncleanly.
How to install MCP Orphan Monitor
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open 41fred/mcp-orphan-monitor and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What MCP Orphan Monitor does
Detect and kill orphaned MCP server processes that survive after AI coding tool sessions crash or close uncleanly. macOS LaunchAgent + optional menu bar app.
Alternatives in AI
- Agency Agents — A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy inject 148k ★
- Sentrux — Real-time architectural sensor that helps AI agents close the feedback loop, enabling recursive self-improveme 2.9k ★
- Session Kit — Close the terminal windows, not the AI coding sessions 649 ★
README
mcp-orphan-monitor
Detect and kill orphaned MCP servers and dev servers that survive after AI coding tool sessions crash or close uncleanly.
If you use Claude Code, Cursor, or any MCP-based AI tool, you probably have zombie node processes running right now:
ps aux | grep mcp-server | grep -v grep
The problem
MCP (Model Context Protocol) servers run as child node processes — one per configured server, per session. When a session ends cleanly, they get killed. When it doesn't (crash, force-quit, closed terminal), they survive as orphans stuck in event loops with no parent.
Each orphan pegs a CPU core at ~50% doing nothing useful. We found 11 orphaned `mcp-server-cloudflare` processes running simultaneously — 550% combined CPU, the oldest burning cycles for 48+ hours.
This is a [known Claude Code issue](https://github.com/anthropics/claude-code/issues/1935) — open since June 2025, still unresolved. Users have reported it with Cloudflare, Todoist, Heroku, Azure DevOps, and ESP-IDF MCP servers. One user found 40+ orphaned processes.
How it works
A small bash script that runs every 10 minutes via macOS LaunchAgent. It scans two classes of process and applies deliberately different rules to each.
**MCP class** — `mcp-server-*`, `mcp-remote`, `workspace-mcp`. Killed on **any** of three signatures:
- Direct orphan — the parent is PID 1 (reparented to launchd/init). The classic crash case: the session process vanished.
- Wedged / spinning — the server is pinning CPU above
MCP_CPU_THRESHOLD(default 60%) and has been alive longer thanMCP_MIN_WEDGE_AGE(default 300s). A healthy MCP server sits near 0% when idle, so sustained high CPU means it's stuck in a spin loop — the signature that cooks a laptop 24/7. The age floor keeps a server's noisy startup burst from tripping the rule. - Second-level orphan — the parent is an AI-tool session (
claude/cursor/…) that is itself orphaned (that parent's PPID is 1)
Related Skills
Vibe Gauge
🧠 Native macOS menu-bar dashboard for AI coding: Claude / Codex / Gemini / Grok quotas with sleep-aware usage
VibeGauge
🧠 Native macOS menu-bar dashboard for AI coding: Claude / Codex / Gemini / Grok quotas with sleep-aware usage
Agent Janitor
menu bar janitor for AI-agent dev macs: tracks process lineage before launchd reparenting destroys it, flags o
MacPulseAI
⚡️ AI-powered macOS process manager & CPU monitor — understand runaway processes with LLM (OpenAI & Anthropic)
AI Fleet Status
VS Code status bar monitor for background AI CLI agent processes (Codex, Claude Code, Gemini CLI, and more) —
Ke Activity Monitor
A Mac activity monitor for people who run AI agents: CPU, memory, energy, real per-process disk I/O and networ
Related Agents
Apple UI Designer
Visual and theme redesigns in current Apple design language (macOS 27 / iOS 26+ Liquid Glass, vibrancy, system
macOS UI Dev
Implements SwiftUI/AppKit changes in the Hoply app target — the menu bar panel, the v2 Dashboard window, comma
macOS UI Designer
Use this agent when you need to plan, design, or evaluate macOS application user interfaces from a UI/UX persp