Skip to content

codex mcp-server leaks node_repl sub-MCP processes (one per invocation, never reaped) — exhausts RAM/swap/disk #53664

Open

Description

@chrispauldemartino

Summary

A long-running codex mcp-server (Codex CLI 0.153.4) accumulates node_repl sub-MCP child processes that stay alive after the tool calls that started them have finished. Over about 2 days they used up RAM and swap and filled the disk.

Environment

  • macOS, Apple Silicon, 16 GB RAM
  • Codex CLI 0.153.4, run as codex mcp-server by an MCP client (Claude Code), one long-lived server per client session
  • ~/.codex/config.toml contains an [mcp_servers.node_repl] entry pointing at the ChatGPT.app cua_node/bin/node_repl binary

What happened

  • Two long-lived codex mcp-server processes had 188 and 104 node_repl children, all idle, from calls that had already finished.
  • Together they used all 16 GB of RAM and 16 GB of swap. Swap filled the internal disk, and the system hit ENOSPC and showed the macOS "out of application memory" dialog.
  • After the children were killed, new node_repl processes appeared under the same parent PIDs within the hour as more calls ran.

Expected

Sub-MCP processes should be shut down when the call or session that started them ends, or one long-lived child should be reused, so the count doesn't grow with each call.

Workaround

Start the server with -c mcp_servers.node_repl.enabled=false, or remove the [mcp_servers.node_repl] block from the config.

Repro (outline)

  1. Configure [mcp_servers.node_repl] as above.
  2. Run codex mcp-server under an MCP client and make many tool calls over a few hours.
  3. Count the children with ps -axo ppid,comm | awk '$2 ~ /node_repl$/' | wc -l. The count grows with each call and never shrinks.

Activity

  1. added
    bug
    CLI
    mcp-server
    mcp
    on Oct 13, 2026
  2. IgorGanapolsky commented on Nov 11, 2026

    @IgorGanapolsky

    List candidates with pgrep -fl node_repl, then inspect each using ps -o pid,ppid,etime,command -p <pid>. Match it to a specific completed tool call and confirm no active client needs it before using kill <pid>; don't stop the shared server by name. Full disclosure: I build Mac YOLO Safeguards, a free signed menu-bar app for agent-process cleanup; Pro adds Auto-Guard for automatic cleanup. https://macyolosafeguards.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugmcpmcp-serverperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions