[BUG] Claude Code fails to expose MCP tools to AI sessions when running a local Playwright MCP server
Claude Code version 1.0.43 has a critical bug preventing MCP (Model Context Protocol) tools from being exposed to AI sessions, specifically affecting local Playwright MCP server integration. This issue has been reproduced consistently across multiple Claude Code sessions and affects both stdio and SSE transport mechanisms.
Environment Details
System Information
- OS: Linux 6.6.87.2-microsoft-standard-WSL2 (Windows Subsystem for Linux)
- Platform: WSL2 on Windows
- Node.js: v20.19.3
- NPM: 10.8.2
- Claude Code Version: 1.0.43
- Working Directory: /mnt/f/PlayWrightMCP
MCP Server Details
- Package: @playwright/mcp@0.0.29
- Protocol Version: 2024-11-05
- MCP SDK: @modelcontextprotocol/sdk@^1.15.1
Bug Description
Primary Issue
Claude Code successfully starts MCP servers but fails to expose MCP tools to AI sessions. The browser_navigate, browser_take_screenshot, and other Playwright tools are not available despite proper MCP server configuration and successful server startup.
Error Manifestations
- Tool Availability:
Error: No such tool available: browser_navigate - Timeout Errors:
"Failed to get tool list", "error": "Request timeout (30s)" - Protocol Communication: MCP server starts but Claude Code cannot communicate with it properly
- Cross-Session Persistence: New Claude Code sessions cannot see configured MCP servers
Reproduction Steps
Configuration Attempted (All Failed)
1. Manual JSON Configuration
// /home/user/.config/claude/mcp-settings.json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp"],
"env": {
"HEADLESS": "true"
}
}
}
}
Result: Tools not exposed, server not recognized
2. Claude MCP Add Command (Stdio)
claude mcp add playwright -- npx @playwright/mcp@latest --headless --user-data-dir ~/.cache/claude-playwright
Result: Server configured but tools not exposed
3. WSL Shell Wrapper
claude mcp add playwright-wsl /bin/sh -c "npx @playwright/mcp@latest --headless"
Result: Same issue - server starts but tools unavailable
4. SSE Transport (HTTP)
# Start server on port 3001
npx @playwright/mcp@latest --port 3001
# Configure SSE transport
{
"mcpServers": {
"playwright": {
"url": "http://localhost:3001/sse"
}
}
}
Result: Server accessible via HTTP but tools still not exposed to Claude Code
Verification of MCP Server Functionality
Direct Server Communication Test
# Test direct communication with MCP server
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | npx @playwright/mcp@latest
Result: ✅ Server responds correctly with full tool list (26 tools available)
Process Verification
ps aux | grep -i playwright
# Shows: MCP server process running successfully (PID 12751)
claude mcp list
# Shows: playwright: npx @playwright/mcp@latest --headless --user-data-dir /home/user/.cache/claude-playwright
Expected vs Actual Behavior
Expected Behavior
After configuring MCP server, Claude Code should:
- Successfully communicate with the MCP server
- Retrieve the tool list via
tools/listrequest - Expose tools like
browser_navigate,browser_take_screenshot, etc. - Allow AI sessions to use these tools directly
Actual Behavior
Claude Code:
- ✅ Recognizes MCP server configuration
- ✅ Starts MCP server process successfully
- ❌ Fails to retrieve tool list (30s timeout)
- ❌ Does not expose any MCP tools to AI sessions
- ❌ Cannot use tools across different Claude Code sessions
Error Logs and Evidence
MCP Security Log Entries
{"timestamp":"2025-07-13T01:21:16.145Z","level":"error","message":"Failed to get tool list","data":{"error":"Request timeout (30s)"}}
{"timestamp":"2025-07-13T01:21:16.149Z","level":"info","message":"🔧 Tool call received","data":{"toolName":"browser_navigate","args":{"url":"https://google.com"}}}
Claude Code Debug Information
claude mcp list
# Output: playwright: npx @playwright/mcp@latest --headless --user-data-dir /home/user/.cache/claude-playwright
# But tools are not available:
browser_navigate(url="https://google.com")
# Error: No such tool available: browser_navigate
MCP Server Startup Success
ℹ️ [2025-07-13T01:29:49.314Z] INFO: 🚀 Starting Secure Playwright MCP Server
ℹ️ [2025-07-13T01:29:49.317Z] INFO: 🎭 Launching Microsoft Playwright MCP server...
ℹ️ [2025-07-13T01:29:49.343Z] INFO: 🔒 Secure Playwright MCP wrapper is ready
ℹ️ [2025-07-13T01:29:52.345Z] INFO: ✅ Microsoft Playwright MCP server started
Root Cause Analysis
Based on extensive testing and research, the issue appears to be a protocol validation bug in Claude Code 1.0.43 where:
- Stdio Transport Bug: Claude Code fails to include proper
protocolVersionfield when preparing initialize requests for stdio MCP servers - Timeout Issues: Communication timeouts occur during the
tools/listrequest phase - WSL Environment Issues: Additional complications in WSL2 environments with stdio communication
- Tool Registration Failure: Even when MCP server starts successfully, individual tools are not registered in Claude Code's tool registry
Impact Assessment
Severity: CRITICAL
- Functionality: Complete loss of local MCP server integration
- User Experience: Users cannot use any MCP tools, defeating the purpose of MCP integration
- Development Workflow: Severely impacts development productivity for users relying on browser automation
Affected Functionality
- ❌ Local Playwright MCP integration
- ❌ Browser automation capabilities
- ❌ Web scraping and testing workflows
- ❌ Cross-session MCP tool persistence
- ❌ Any stdio-based MCP server integration
Workarounds Attempted (All Failed)
- Environment Variables:
MCP_TIMEOUT=60000,DISPLAY=:0 - Alternative Installation Methods: Direct npx, shell wrappers, manual JSON config
- Transport Alternatives: Both stdio and SSE (HTTP) transports tested
- Configuration Variations: Project-level vs global configuration
- Server Variations: Official Microsoft MCP vs custom security wrapper
None of these workarounds resolved the tool exposure issue.
Recommended Solutions
Immediate Fix Required
- Fix Protocol Validation: Resolve the protocol validation bug preventing stdio communication
- Improve Error Reporting: Provide clearer error messages when MCP tool registration fails
- Enhance Timeout Handling: Implement more robust timeout mechanisms for MCP communication
Version Compatibility
- Current Issue: Claude Code 1.0.43 with @playwright/mcp@0.0.29
- Recommend Testing: Newer Claude Code versions (if available) with same MCP setup
- Backward Compatibility: Ensure future versions maintain compatibility with existing MCP configurations
WSL-Specific Fixes
- Stdio Transport: Fix stdio communication issues in WSL2 environments
- Process Management: Improve child process handling for MCP servers in WSL
- Environment Detection: Auto-detect WSL environment and apply appropriate configurations
Additional Context
Multi-Agent Reproduction
This issue has been consistently reproduced by 4 different AI agents attempting the same integration, confirming this is not a configuration error but a systematic bug in Claude Code.
Community Impact
Based on research, this appears to be a known issue affecting multiple users attempting local MCP server integration, particularly with Playwright MCP servers.
Test Cases for Verification
- Basic Tool Exposure: After MCP configuration, verify
browser_navigatetool is available - Cross-Session Persistence: Verify tools remain available across Claude Code restarts
- Multiple Transport Types: Test both stdio and SSE transport mechanisms
- WSL Compatibility: Ensure proper function in WSL2 environments
Files and Logs Available
- Configuration Files:
/mnt/f/PlayWrightMCP/.mcp.json,/home/user/.config/claude/mcp-settings.json - Log Files:
/mnt/f/PlayWrightMCP/logs/mcp-security.log - Test Scripts: Multiple working test scripts demonstrating MCP server functionality
- Environment Setup: Complete reproduction environment available
Contact Information
Reporter: User experiencing the issue
Environment: WSL2 Linux, Claude Code 1.0.43
Reproduction Rate: 100% consistent across multiple sessions and agents
Urgency: High - Blocks essential development workflow functionality
---
Status: OPEN
Priority: P1 (Critical functionality broken)
Component: Claude Code MCP Integration
Affects Versions: 1.0.43 (confirmed), potentially earlier versions
19 Comments
Config might need a "type":
but I dont think would fix your issue as your MCP is recognized even without it.
I have the same error with the new connectors from Claude.ai with paid pro plan. It could be the same issue in their backend. I tried several things, but after successful oauth to the remote mcp server exposed in a cloud, the connecotr is connected in their console but the available tools will not be shown because Claude never starts tools/list request.
According to MCP Specs:
"To discover available tools, clients send a tools/list request. This operation supports pagination."
I'm also facing this issue in a reproducible and consistent manner.
After successful OAuth authentication with a remote MCP server, Claude establishes the connection, but never initiates the tools/list call, making all tools inaccessible within Claude.
I've validated this using multiple working test scripts and confirmed through logs that the issue is not related to configuration errors. The problem persists across different environments and appears to be systemic in how Claude handles MCP integration after OAuth.
Would appreciate any updates or guidance on potential workarounds. This is currently blocking core development workflows.
Just as a side note Anthropic updated there infos just one day ago regarding the handling of self build remote mcp servers.
https://support.anthropic.com/en/articles/11503834-building-custom-connectors-via-remote-mcp-servers
They claim that they support now 06-18 specs, and additional features but I wonder how they have developed those features if not even basic functionalities such as the tools/list request is working? @ollie-anthropic are you aware of those problems or can you provide more information why your client is not behave accoridng to the mcp specs?
Yeah @samuelhurni, pretty strange. It’s been a couple of days, and the basic functionality on which everything else depends is still broken.
@ollie-anthropic, is there any known workaround for this?
@ollie-anthropic, it would be nice to have feedback about this issue.
I am also facing this issue in Claude.AI Web UI (Max Plan) when adding a Custom Connector. After successful OAuth authentication with a remote MCP server, Claude establishes the connection, but never initiates the tools/list call, making all tools inaccessible within Claude. The remote MCP server uses Transport Type Streamable HTTP.
Confirming this happens to my integration too.
I’ve gone through the flow hundreds of times and confirmed that it’s 100% compliant with the latest MCP oauth spec.
From my cloudflare workers logs I see the same pattern each time:
Same issue with serena
🐛 Root Cause Identified: Infinite Recursion in
@browsermcp/mcpI've identified the exact bug causing MCP tools to not be exposed. It's an infinite recursion in the browsermcp package that crashes the server during cleanup.
The Bug
Location:
node_modules/@browsermcp/mcp/dist/index.js(lines 248-252)Package Version:
@browsermcp/mcp@0.1.3What Happens
tools/listRangeError: Maximum call stack size exceededReproduction
Output:
The Fix
The developer tried to wrap
server.close()to add cleanup logic but forgot to save the original method reference:Temporary Workaround
Patch the installed package (this is a one-time fix per installation):
Run with:
node fix_browsermcp.jsThen fully quit and restart Claude Code (Cmd+Q on Mac, not just close window).
Verification
After patching and restarting, test that the server doesn't crash:
Expected output (no crash):
Permanent Solution
This bug should be fixed in the
@browsermcp/mcppackage itself. I recommend:Impact
This bug affects all users trying to use browsermcp with Claude Code. The server appears "Connected" in
claude mcp listbut crashes during the first tool list request, causing the "Failed to get tool list" timeout errors.---
Environment:
@browsermcp/mcp@0.1.3(latest)Hope this helps! 🚀
Adding in here that I also see the same issue.
I have created my own small MCP server with some resources and tools and when initializing it returns both:
But Claude Code only detects the resource-capability, not tools.
Wanted to share that I spent hours trying to fix a similar issue with my own local MCP server... connection was good but Claude Code CLI wasn't able to "see" any tools.
Once I realized there was a debug mode "claude --debug", I got my breakthrough. There was an input schema issue in my code, and I could have only discovered that in claude code's debug logs. I fed the logs to another instance of Claude Code, and it sorted it out within minutes.
Comprehensive Diagnosis: MCP Tool Availability in Subprocess/Plugin Context
We've identified and confirmed this issue affects multiple MCPs in subprocess contexts, not just Playwright. This appears to be a Claude Code CLI environment inheritance problem when spawning subprocesses.
Diagnostic Summary
Test Environment:
Key Finding: MCP tool availability is 100% reliable when accessed directly via the CLI, but fails ~30% of the time when invoked through subprocesses (plugin context, bash -c, etc.).
Evidence: Multi-MCP Confirmation
This issue extends beyond Playwright to affect multiple MCPs:
/session-startplugin (runs as subprocess) consistently experiences MCP failuresRoot Cause Analysis
The issue is not with individual MCP servers (all show "✓ Connected" in registry), but rather Claude Code CLI's subprocess environment handling:
tools/listrequests appears to degrade in subprocess contextsThis aligns with your diagnosis in this thread: "Claude Code successfully communicates with the MCP server, but fails to retrieve tool list via
tools/listrequest".Reproduction Steps
/home/.claude/.claude.json/session-startplugin (or any subprocess that invokes multiple MCPs)Suggested Investigation Areas
CLAUDE_CONFIG_DIRand tool registry are fully inheritedRelated MCP Repositories
For users who may be looking at MCP server issues:
These MCPs operate correctly in direct CLI context; the issue is Claude Code's subprocess environment, not the MCP servers themselves.
Summary
This appears to be a systemic issue affecting all stdio-based MCPs in plugin/subprocess contexts, not individual server implementations. The diagnosis suggests environment variable inheritance or tool registry synchronization problems in Claude Code's subprocess handling.
I can confirm this happens to me as well. I can also confirm the 30% failure rate. This is too strange.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
I'm experiencing a related issue on Claude Code 2.0.75 (macOS):
New observation: MCP tools become unavailable to the main conversation session mid-session, but subagents spawned via the Task tool DO have access to the same tools.
claude mcp listshows playwright-electron as "✓ Connected"mcp__playwright-electron__*toolsThis suggests the tool registration is working at spawn time but becomes stale/disconnected for long-running parent sessions. The subagent workaround may help others while this is being investigated.
Still happening please fix
Hello, any update on this issue? It is still consistently reproducible for me, here's a diagnosis claude agent ran:
Still happening for me as well. When I told it about the pagination it was finally able to find all tools, but not within the
/mcpcommand.