Mac YOLO Safeguards

Find and kill orphaned MCP servers on a Mac

An MCP server is a helper process that Claude Code, Cursor or Codex starts for each session. When the session ends cleanly, the server exits too. When the session crashes, the terminal is closed, or the app is force-quit, the server can keep running with nothing using it. These are orphans. They hold memory, and some spin the CPU.

What PPID 1 means

Every process has a parent process ID (PPID). When a parent exits, macOS hands its children to launchd, which is always process 1. So an MCP server whose PPID is 1 lost the session that started it.

List them

This prints MCP processes whose parent is PID 1, with memory in MB and how long they have been running. It only lists; it kills nothing:

ps -axo pid,ppid,rss,etime,command | awk '$2==1 && tolower($0) ~ /mcp/ && !/awk/ {printf "%s %d MB %s %s\n", $1, $3/1024, $4, $5}'

The columns are PID, memory, running time (days-hours:minutes:seconds), and the program that runs it (often node or npx). To see which server it is, run ps -o command= -p PID on one PID: the full command line names it.

To see the whole picture, including servers that still have a parent:

ps -axo pid,ppid,etime,command | awk 'tolower($0) ~ /mcp/ && !/awk/'

Stop them

Stop one at a time, or a short list you have read:

kill 12345 12346

This sends SIGTERM, which asks the process to shut down cleanly. Wait ten seconds and list again. Only if one is still there:

kill -9 12345

If you know a particular server is the problem, you can stop its orphans by name. Look first, then kill, and only those with PPID 1:

ps -axo pid,ppid,command | awk '$2==1 && /mcp-server-cloudflare/ && !/awk/ {print $1}'
kill $(ps -axo pid,ppid,command | awk '$2==1 && /mcp-server-cloudflare/ && !/awk/ {print $1}')

Replace mcp-server-cloudflare with the name you saw. If the list is empty, the second command prints a usage message and does nothing.

The risks

Orphans come back whenever sessions end badly, so this is a recurring chore, not a one-time fix.

Let the Mac do it

The free Mac YOLO Safeguards menu bar app finds MCP servers and helpers that outlived their session and stops them when you click. It ends processes, so read what it can end before you click.

Pro Guard, $29 once, checks once a minute while the app is open, and acts without a click when memory runs short. Full refund within 30 days.

There are also free open-source command line tools that do this. Here is an honest comparison.

Download for Mac (free)