openclaw - 💡(How to fix) Fix [Bug]: OpenClaw MCP filesystem sidecar duplicate spawn / process leak [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

OpenClaw MCP filesystem sidecar duplicate spawn / process leak

Environment:

  • OpenClaw main process PID 796
  • Web UI port 18789, internal port 18791
  • MCP server: @modelcontextprotocol/server-filesystem
  • Config only defines one filesystem MCP server: /home/dbg/.openclaw/workspace /opt/odoo/custom_addons

Observed:

  • Multiple identical server-filesystem process groups are spawned under the same OpenClaw parent process.
  • Process groups: 4608 -> 4620 -> 4621 at 09:48 14252 -> 14272 -> 14273 at 10:09 15379 -> 15391 -> 15392 at 10:15 17279 -> 17291 -> 17292 at 10:20
  • All have identical command line and serve the same directories.
  • Configuration has no duplicate mcp.servers.fs entry.
  • Logs show restart-sentinel in liveness diagnostics.
  • eventLoopDelayP99Ms reached about 5066ms.
  • No clear child process exit/crash log is emitted.
  • Old filesystem MCP processes are not cleaned up before new ones are spawned.

Expected:

  • Only one filesystem MCP sidecar should exist per configured server.
  • Before spawning a replacement sidecar, OpenClaw should terminate or reuse any existing sidecar for the same config key.
  • Restart-sentinel should deduplicate by MCP server id/path/command line.

Impact:

  • CPU usage increases.
  • Tool calls become slow or inconsistent.
  • Long-running development tasks become unreliable.

Root Cause

OpenClaw MCP filesystem sidecar duplicate spawn / process leak

Environment:

  • OpenClaw main process PID 796
  • Web UI port 18789, internal port 18791
  • MCP server: @modelcontextprotocol/server-filesystem
  • Config only defines one filesystem MCP server: /home/dbg/.openclaw/workspace /opt/odoo/custom_addons

Observed:

  • Multiple identical server-filesystem process groups are spawned under the same OpenClaw parent process.
  • Process groups: 4608 -> 4620 -> 4621 at 09:48 14252 -> 14272 -> 14273 at 10:09 15379 -> 15391 -> 15392 at 10:15 17279 -> 17291 -> 17292 at 10:20
  • All have identical command line and serve the same directories.
  • Configuration has no duplicate mcp.servers.fs entry.
  • Logs show restart-sentinel in liveness diagnostics.
  • eventLoopDelayP99Ms reached about 5066ms.
  • No clear child process exit/crash log is emitted.
  • Old filesystem MCP processes are not cleaned up before new ones are spawned.

Expected:

  • Only one filesystem MCP sidecar should exist per configured server.
  • Before spawning a replacement sidecar, OpenClaw should terminate or reuse any existing sidecar for the same config key.
  • Restart-sentinel should deduplicate by MCP server id/path/command line.

Impact:

  • CPU usage increases.
  • Tool calls become slow or inconsistent.
  • Long-running development tasks become unreliable.

Fix Action

Fixed

Code Example

Relevant logs:
- /tmp/openclaw/openclaw-2026-05-28.log
- /tmp/openclaw_clean_restart_20260528_101842.log
- /home/dbg/.openclaw/logs/commands.log

Config check:
- ~/.openclaw/openclaw.json contains only one mcp.servers.fs entry.
- No duplicate filesystem MCP configuration was found.

Impact:
- CPU usage increases.
- Tool calls become slow or inconsistent.
- Long-running coding tasks become unreliable.
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

OpenClaw MCP filesystem sidecar duplicate spawn / process leak

Environment:

  • OpenClaw main process PID 796
  • Web UI port 18789, internal port 18791
  • MCP server: @modelcontextprotocol/server-filesystem
  • Config only defines one filesystem MCP server: /home/dbg/.openclaw/workspace /opt/odoo/custom_addons

Observed:

  • Multiple identical server-filesystem process groups are spawned under the same OpenClaw parent process.
  • Process groups: 4608 -> 4620 -> 4621 at 09:48 14252 -> 14272 -> 14273 at 10:09 15379 -> 15391 -> 15392 at 10:15 17279 -> 17291 -> 17292 at 10:20
  • All have identical command line and serve the same directories.
  • Configuration has no duplicate mcp.servers.fs entry.
  • Logs show restart-sentinel in liveness diagnostics.
  • eventLoopDelayP99Ms reached about 5066ms.
  • No clear child process exit/crash log is emitted.
  • Old filesystem MCP processes are not cleaned up before new ones are spawned.

Expected:

  • Only one filesystem MCP sidecar should exist per configured server.
  • Before spawning a replacement sidecar, OpenClaw should terminate or reuse any existing sidecar for the same config key.
  • Restart-sentinel should deduplicate by MCP server id/path/command line.

Impact:

  • CPU usage increases.
  • Tool calls become slow or inconsistent.
  • Long-running development tasks become unreliable.

Steps to reproduce

  1. Start OpenClaw with a config containing a single MCP filesystem server entry: @modelcontextprotocol/server-filesystem /home/dbg/.openclaw/workspace /opt/odoo/custom_addons

  2. Open the OpenClaw Web UI on port 18789 and use the chat/session normally.

  3. Observe OpenClaw process tree over time with: ps -eo pid,ppid,lstart,etime,pcpu,pmem,cmd | grep -Ei "openclaw|server-filesystem|modelcontextprotocol" | grep -v grep

  4. Confirm multiple identical server-filesystem process groups are spawned under the same OpenClaw parent process, even though the config only defines one filesystem MCP server.

Observed example:

  • 4608 -> 4620 -> 4621 at 09:48
  • 14252 -> 14272 -> 14273 at 10:09
  • 15379 -> 15391 -> 15392 at 10:15

All process groups used the same command: npm exec @modelcontextprotocol/server-filesystem /home/dbg/.openclaw/workspace /opt/odoo/custom_addons

Expected behavior

OpenClaw should start only one filesystem MCP sidecar for one configured filesystem server.

If the restart-sentinel or liveness check decides to restart the MCP sidecar, OpenClaw should first terminate or reuse the existing sidecar process for the same server configuration.

Multiple identical filesystem MCP process groups should not accumulate under the same OpenClaw parent process.

Actual behavior

OpenClaw repeatedly spawned multiple identical @modelcontextprotocol/server-filesystem process groups under the same parent process.

The config had only one mcp.servers.fs entry, but the process tree showed several duplicate filesystem MCP groups serving the same directories.

OpenClaw CPU usage stayed high, around 39–42%, and eventLoopDelayP99Ms reached about 5066ms in the logs. Logs also repeatedly showed restart-sentinel in liveness diagnostics, but did not clearly log MCP process cleanup or child process exit.

OpenClaw version

OpenClaw 2026.5.22

Operating system

Ubuntu 24.04.4 LTS, Linux 6.8.0-117-generic x86_64

Install method

Direct binary/CLI launch. OpenClaw is running as a direct user process, not systemd-managed. Main process observed as: openclaw

Model

Not model-specific. Issue occurs in OpenClaw gateway / MCP sidecar process management before or outside model response behavior.

Provider / routing chain

OpenClaw Web UI -> OpenClaw gateway -> MCP filesystem sidecar (@modelcontextprotocol/server-filesystem)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Relevant logs:
- /tmp/openclaw/openclaw-2026-05-28.log
- /tmp/openclaw_clean_restart_20260528_101842.log
- /home/dbg/.openclaw/logs/commands.log

Config check:
- ~/.openclaw/openclaw.json contains only one mcp.servers.fs entry.
- No duplicate filesystem MCP configuration was found.

Impact:
- CPU usage increases.
- Tool calls become slow or inconsistent.
- Long-running coding tasks become unreliable.

Impact and severity

No response

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

OpenClaw should start only one filesystem MCP sidecar for one configured filesystem server.

If the restart-sentinel or liveness check decides to restart the MCP sidecar, OpenClaw should first terminate or reuse the existing sidecar process for the same server configuration.

Multiple identical filesystem MCP process groups should not accumulate under the same OpenClaw parent process.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING