npx-based MCP plugins (Playwright, Context7) fail to connect with concurrent sessions
Resolved 💬 4 comments Opened Mar 16, 2026 by KCW89 Closed Apr 15, 2026
Description
MCP plugins that use npx @pkg@latest (stdio transport) consistently fail to connect when multiple Claude Code sessions are open concurrently. HTTP-based plugins (Supabase, Sentry) connect fine.
Affected plugins:
playwright@claude-plugins-official— usesnpx @playwright/mcp@latestcontext7@claude-plugins-official— usesnpx -y @upstash/context7-mcp
Root Cause Analysis
The @latest tag in npx forces an npm registry lookup on every MCP server startup. With multiple concurrent sessions:
- Each session spawns its own
npxprocesses for each plugin - Registry lookups take 2-5s each under normal conditions
- With N concurrent sessions × M plugins, the npm registry gets N×M simultaneous requests
- The 10s MCP connection timeout is exceeded before
npxfinishes the registry check + process startup - Stale orphan processes from crashed/closed sessions accumulate, compounding the problem
Steps to Reproduce
- Open 3+ Claude Code sessions in the same project
- All sessions have
playwrightandcontext7plugins enabled - Run
/mcpin any session - Observe: stdio-based plugins show
✗ Failed to connectwhile HTTP-based plugins show✓ Connected
Evidence
claude mcp list output (with 8 concurrent sessions):
plugin:supabase:supabase: https://mcp.supabase.com/mcp (HTTP) - ✓ Connected
plugin:sentry:sentry: https://mcp.sentry.dev/mcp (HTTP) - ✓ Connected
plugin:context7:context7: npx -y @upstash/context7-mcp - ✗ Failed to connect
plugin:playwright:playwright: npx @playwright/mcp@latest - ✗ Failed to connect
Orphan process accumulation (stale sessions):
$ ps aux | grep -E "playwright-mcp|context7-mcp" | grep -v grep | wc -l
12 # should be ≤2 per active session per plugin
Workaround
Pin packages locally as devDependencies and use .mcp.json with direct node execution:
pnpm add -D @playwright/mcp @upstash/context7-mcp
{
"mcpServers": {
"playwright": {
"command": "node",
"args": ["node_modules/@playwright/mcp/cli.js"]
},
"context7": {
"command": "node",
"args": ["node_modules/@upstash/context7-mcp/dist/index.js"]
}
}
}
This eliminates registry lookups entirely — startup goes from ~5s to ~100ms.
Suggested Fix
Consider one or more of:
- Cache
npxresolution: Skip registry check if the package was fetched within the last N minutes - Use pinned versions: Plugin configs could use exact versions instead of
@latest(update viaclaude plugins update) - Orphan cleanup: Kill stale MCP stdio processes from previous sessions on startup (check PPID=1 orphans)
- Increase timeout: The 10s connection timeout is too tight for
npx @latestunder concurrent load — consider a graduated timeout or retry
Environment
- Claude Code version: latest (Mar 2026)
- OS: macOS Darwin 25.3.0
- Node: v22.x
- pnpm: 10.17.1
- Typical concurrent sessions: 3-8
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗