Claude Desktop MCP lifecycle is broken

Or the real title: Claude Desktop is sloppy vibe trash… ok, back to nice writing now.
I spent half of today debugging what looked like a routine OAuth bug. I configured a single local stdio MCP server in Claude Desktop. When I launched the app, it immediately opened two authentication tabs for the exact same service at the exact same time.
OAuth is finicky enough that two tabs doesn’t immediately yell “desktop lifecycle bug.” I started where any developer would: checking the external service, the callback URL, the local token cache, and mcp-remote.
Every single one of those components was doing what it was asked to do. The problem was simple: Claude Desktop asked them to do it twice.
Finding the duplicate process tree
The first clue appeared in Claude’s internal logs. Right at startup, the standard MCP lifecycle reported this:
MCP Server connection requested for: my-mcp-server
Launching MCP Server: my-mcp-server
In the exact same second, another subsystem logged this:
[LocalMcpServerManager] Connecting to my-mcp-server
That could have been duplicate logging from two internal modules. Annoying, but harmless. But when I checked the macOS process tree, I found two completely separate parent-child branches running under Claude:
Claude
├── wrapper -> npm -> mcp-remote
└── wrapper -> npm -> mcp-remote
Each branch had its own PID, its own wrapper, and its own Node process running mcp-remote. This wasn’t a logging artifact. Claude was spinning up two independent instances of the same configured server.
From their own perspective, both instances behaved correctly. Both started up, checked ~/.mcp-auth, found no cached token, and initiated an OAuth flow. The external service saw two distinct clients asking for authorization, so it opened two tabs. The browser tabs were just the symptom. The real bug was Claude Desktop launching the same server twice.
The authentication mask
The authentication flow made the sequence easy to prove:
-
Fresh credentials: 2 processes, 2 OAuth flows, 2 tabs.
-
Cached credentials: 2 processes, 0 tabs.
Once you authenticate in the first tab and save the credentials, restarting Claude still launches two mcp-remote processes. They simply grab the cached token without opening a browser tab.
Fresh credentials: 2 processes, 2 OAuth flows, 2 tabs
Cached credentials: 2 processes, 0 tabs
This is why bugs like this survive in production. Once a developer authenticates during testing, the annoying UI symptom disappears. Under the hood, the application is still wasting resources and running duplicate client processes for a single configuration.
Isolating the host
To verify that mcp-remote or the external service wasn’t at fault, I tested other local MCP servers: Turbo Relay and Open Loops. Both of them launched twice.
That ruled out the proxy and confirmed the host bug. A package cannot magically fork its own parent chain beneath Claude with different wrapper PIDs. Claude Desktop itself is triggering both launch paths.
The architecture split in the logs makes this even clearer. Claude Desktop appears to run a legacy MCP server lifecycle alongside a newer LocalMcpServerManager, with tools later announced through a localMcpBridge. Two internal managers both think they own the same local stdio configuration.
To make matters worse, there is a clear observability gap. The dedicated per-server log only accounts for one of the two process IDs. The second process runs completely in the dark, invisible to the server-specific log, while remaining fully alive in the operating system.
The workarounds
If you hit this issue, you have two options.
If Claude has already opened two tabs, complete the flow in the first tab and close or ignore the second. One authorization is enough.
Alternatively, you can pre-authenticate from your terminal before opening Claude Desktop:
npx -y mcp-remote <REMOTE_MCP_URL>
Run the exact command and arguments from your Claude configuration, complete the OAuth flow in your browser, and stop the terminal process. When Claude Desktop starts, both duplicate processes will read the cached credentials from ~/.mcp-auth, preventing the extra browser tabs.
This workaround fixes the user experience, but it doesn’t fix the underlying bug. Claude is still running two server instances. If your local MCP server does heavy startup work, expects to be a singleton, or triggers side effects on connection, this stops being a minor UI glitch.
The open-source tax
The most frustrating part of this investigation was looking at how the open-source ecosystem is forced to compensate for host bugs.
There is an open pull request on geelen/mcp-remote (PR #320) titled “Survive hosts that start and stop instances during the OAuth flow.” The description explicitly names Claude Desktop and reports this exact duplicate process behavior.
The PR contains extensive defensive engineering. The author added logic to:
-
Detect when the process owning the auth lock dies.
-
Prevent one instance from deleting another instance’s lock file.
-
Wait for instance coordination before opening a browser tab.
-
Bind PKCE verifiers to the OAuth state instead of the process PID.
-
Share tokens between surviving sibling processes.
It includes nine new unit tests just to survive Claude Desktop’s broken lifecycle.
While this is impressive open-source engineering, the responsibility is completely upside down. An open-source adapter package shouldn’t have to build distributed systems coordination logic just to survive a desktop app that cannot manage child processes cleanly. We are taxing open-source maintainers because a major desktop product fails to enforce basic lifecycle rules.
Pure vibes…
This is where the term “vibe-coded” starts to fit. Features accumulated faster than core architecture can handle.
A basic regression test could spin up Claude Desktop, count the process launches for a single server configuration, and fail if the answer is anything other than one. It wouldn’t look flashy in a product demo, but it protects the stability of the entire integration layer.
Claude Desktop is the primary entry point for a serious AI product, and MCP is a serious integration standard. Once a desktop application starts executing local binaries, managing OAuth credentials, and bridging tools, process lifecycle management is no longer an obscure detail. It is a core requirement.
I use Claude every day and love the models, but great AI models cannot excuse fragile desktop engineering. Brilliant AI features still depend on the unglamorous fundamentals of software engineering: clean process ownership, a single source of truth, proper logging, and tests that can count to one.
I filed the bug report. I don’t think I’ll hear back… let’s see.
On this page
Related articles

Ten AI security problems hiding in plain text
This article argues that AI security risks extend far beyond model jailbreaks and prompt engineering, into every piece of text an AI can read. Natural language now behaves like soft code, where logs, documentation, commit messages, wikis, support tickets, web pages, PDFs, and search results can all carry hidden instructions for agents. The author walks through ten concrete scenarios where ordinary text fields become attack surfaces, often with delayed or indirect activation through internal tools and multi agent pipelines. The core message is that information and instruction have blurred, and any text accessible to AI must be treated as part of the security model. Teams need to rethink access, editing rights, retrieval, and agent capabilities accordingly.
- Composable architecture
- AI engineering
- Cloud & infra

We are thinking too small
AI coding agents are not a threat to developer jobs, they are a fundamental shift in the economics of software creation. Just as the cloud removed the risk and capital cost of infrastructure, AI is removing the cost of writing and refactoring code. This kills the old moats that protected horizontal enterprise platforms and makes rebuilding wide, deeply integrated stacks viable. Instead of spending years stitching together narrow SaaS tools and APIs, teams can let agents generate bespoke services quickly and cheaply. The real risk is using AI only to speed up legacy glue work. Developers who win will treat the cost of reinventing the wheel as effectively zero and pursue much larger, previously impossible product ideas.
- Composable architecture
- AI engineering
- Cloud & infra

The Mini Shai-Hulud supply chain backlash will create worse software
Supply-chain attacks like Mini Shai-Hulud will make teams distrust third-party packages. AI makes it easy to react by generating internal replacements for dependencies, SDK helpers, workflow tools, and glue code. That feels safer, but a lot of that code will be vibe coded without threat models, tests, update paths, or security review.
- Composable architecture
- AI engineering
- Cloud & infra