[BUG] claude-code MCP tool calls execute but results never return to claude.ai chat

Resolved 💬 4 comments Opened Mar 19, 2026 by agustinsaldias Closed Apr 16, 2026

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?

Tool calls sent via the claude-code MCP integration execute successfully in WSL but the results are never delivered back to the claude.ai chat interface. The MCP transport closes before the response is returned.

The MCP server connects and loads the full tools list correctly every time. The issue is exclusively at the execution/response delivery layer. The WSL environment and claude binary are stable with no crashes.

What Should Happen?

Tool results should be delivered back to the claude.ai chat interface after execution.

Error Messages/Logs

Message from client: tools/call Bash ls ~/projects
Message from server: {"result": ... "stdout": "astro\ngatsby\nhugo\n..."}
Server transport closed  <-- closes immediately after result is returned

Steps to Reproduce

To Reproduce

  1. Set up claude-code as a local MCP server in claude.ai using the config below
  2. Start a conversation -- confirm the server shows "running" and tools load correctly
  3. Ask Claude to run any Bash command (e.g. ls ~/projects)
  4. Observe that the tool call errors out with "Tool execution failed" in the chat, despite executing successfully in WSL

Config used

{
  "mcpServers": {
    "claude-code": {
      "command": "wsl.exe",
      "args": [
        "-d", "Ubuntu",
        "--exec",
        "/home/harzens/.local/bin/claude-mcp-wrapper"
      ]
    }
  }
}

Where claude-mcp-wrapper runs stdbuf -oL -eL /home/harzens/.local/bin/claude mcp serve.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.79

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

Environment

  • OS: Windows 10 with WSL2 (Ubuntu)
  • Claude Code version: 2.1.79 (latest, confirmed with claude update)
  • Interface: claude.ai web chat

Attempted workarounds

  • standard bash integration -- did not work
  • stdbuf -oL -eL wrapper to force unbuffered output -- did not fix it
  • bash -ic invocation -- did not fix it
  • --stdio flag -- not available in version 2.1.79
  • networkingMode=mirrored -- did not help

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗