[BUG] Claude Desktop: Local Agent Mode (LocalMcpServerManager) leaks a duplicate set of local MCP servers — pool is app-lifetime-scoped, not session-scoped
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
This is a Claude Desktop app bug. It is filed in the claude-code repo because Anthropic support directs Claude Desktop bug reports here, and this repo's Bug Report template is the only available form — so some Claude-Code-specific fields below contain the closest Claude Desktop equivalent.
App version: Claude Desktop 1.8555.0 (macOS, Apple Silicon).
Summary
Starting a Local Agent Mode session causes LocalMcpServerManager to spawn a complete second copy of every local MCP server — both the claude_desktop_config.json stdio servers and the installed MCP extensions. This duplicate pool is never torn down when the Local Agent Mode session ends or goes idle. It persists for the entire lifetime of the Claude Desktop process and is released only on a full app quit.
Net effect: after a user runs even a single Local Agent Mode / Cowork session, they unknowingly run two complete MCP server stacks for the rest of the app session.
For lightweight servers this is merely wasteful. But for any MCP server that installs system-level observers (e.g. a macOS desktop-automation extension that traverses the Accessibility tree), running two concurrent instances causes sustained high CPU — about 31% per instance, accumulating 66–68 minutes of CPU time over roughly 6 hours. This starves the MCP message pump and produces ~4-minute timeouts on MCP tool calls across ALL servers, including the chat's own MCP connectors which have nothing to do with Local Agent Mode.
Evidence — from ~/Library/Logs/Claude/main.log
11:10:20 Launching MCP Server: alpaca / gmail / outlook-mcp / ms365 / Macos / Control Chrome
-> the chat MCP manager spawns Set A (logged in mcp.log)
11:17:40 LocalAgentModeSessions.start <- user opens a Local Agent Mode session
11:17:42 [LocalMcpServerManager] Connecting to Control Chrome / Macos / alpaca (62 tools)
/ gmail (30 tools) / outlook-mcp (3 tools) / ms365 (302 tools)
-> Set B spawned: a full duplicate pool of 6 MCP servers
... Local Agent Mode sessions used 11:17-13:06, then idle ...
... [LocalMcpServerManager] logs nothing for the next ~6.5 hours ...
17:40:37 [LocalMcpServerManager] Closing all (6 servers) <- Set B torn down ONLY on app quit
A detail that makes this hard to self-diagnose: the duplicate pool is logged under [LocalMcpServerManager] in main.log, NOT in mcp.log. From the normal MCP log the second stack is invisible — mcp.log shows exactly one healthy set, started once and never reloaded.
What Should Happen?
Any one of the following would resolve it:
- Session-scoped teardown —
LocalMcpServerManagertears down its MCP server pool when all Local Agent Mode sessions have ended or gone idle (a short grace period is fine), instead of holding the pool until app quit.
- Share, do not duplicate — Local Agent Mode reuses the chat's already-running local MCP server instances instead of spawning a parallel pool.
- Shadow duplicates — at minimum, apply the same de-duplication that Local Agent Mode already performs for plugin-provided remote MCP servers. main.log already shows this for remote servers (log line: Plugin ... has remote MCP servers (...). Shadowing with no-ops to prevent duplication). The same logic is simply not applied to local stdio servers or extensions.
Error Messages/Logs
MCP tool calls intermittently hang for ~4 minutes and fail with:
No result received from the Claude Desktop app
ps snapshot during the issue — two full MCP server sets, two macos-mcp processes spinning:
PID 91236 macos-mcp 31.6% CPU 67:58 cputime
PID 91601 macos-mcp 31.6% CPU 66:06 cputime
(every other MCP server idle at 0.0% CPU)
Steps to Reproduce
- Configure at least one local stdio MCP server in claude_desktop_config.json and/or install an MCP extension.
- Launch Claude Desktop. Note the MCP server processes: ps -axo pid,%cpu,command | grep -i mcp
- Open a Local Agent Mode / Cowork session.
- Observe that a second complete set of MCP server processes appears.
- End the Local Agent Mode session.
- Observe the second set is still running.
- The second set is killed only when Claude Desktop fully quits.
Workaround: fully quit (Cmd+Q) and reopen Claude Desktop between Local Agent Mode work and MCP-heavy chat work. Closing only the Local Agent Mode session window is not sufficient — the duplicate pool survives it.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Desktop app v1.8555.0 (this is a Claude Desktop bug, not Claude Code — see issue body)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Repro environment: Claude Desktop 1.8555.0, macOS (Apple Silicon). Local MCP servers configured: alpaca, gmail, outlook-mcp, ms365 (stdio) plus Control Chrome and a macOS automation extension. Local Agent Mode session model: claude-opus-4-7.
Filed via the claude-code repo because there is no dedicated Claude Desktop issue tracker; the Claude-Code-specific fields above (Claude Code Version, regression, platform, terminal) contain the nearest Claude Desktop equivalents.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗