Hi Krill,
I'm seeing memory accumulate in my container over time. After diagnostics, I found that npm exec MCP server processes (context7, sqlite, filesystem) are not being killed after their parent agent session completes. Each process holds ~96–100MB RSS, and they stack up across cron-triggered runs — I'm counting ~150 processes in ps aux, eating ~2–3GB of my 6GB container RAM limit.
My MCP config in openclaw.json:
json"mcp": {
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/node/.openclaw/workspace"]
},
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
},
"sqlite": {
"command": "npx",
"args": ["-y", "mcp-server-sqlite-npx", "/home/node/.openclaw/workspace/projects/health-fitness/data/health.db"]
}
}
}
Running v2026.4.15, hub-and-spoke agents with maxSpawnDepth:2, cron-triggered sessions via sessions_spawn.
Questions:
Should MCP servers exit when their spawned session ends, or are they intentionally kept alive for reuse?
If they should be reaped, is this a known bug or a config I'm missing?
Is there a safe way to clean up stale MCP child processes without a full container restart?