Skip to content

Failed to connect to watchdog socket: access denied for socket file #37

Description

@ii-vil

Environment

  • OS: Windows 11 Pro (25H2, OS build 26200.8037)
  • Claude Desktop version: 1.1.7203.0 (installed via MSIX — either Microsoft Store or claude.ai installer, both result in MSIX packaging)
  • MATLAB MCP Core Server version: v0.6.0
  • MATLAB version: R2023a (also R2021a present on system)

Description

The MATLAB MCP Core Server fails to start every time it is spawned as a child process by Claude Desktop. The server exits immediately with the following error:

Failed to connect to watchdog socket
error: "access denied for socket file"
Failed to initialize MCP Core Server. Error: %[1]s.

This happens consistently regardless of the installation method used:

  • Via the .mcpb desktop extension (installed through Settings → Extensions)
  • Via manual claude_desktop_config.json configuration pointing directly to the binary
  • Via a cmd.exe batch file wrapper pointing to the binary
  • Even when Claude Desktop is run as Administrator

Key finding: the binary works perfectly when run directly

When matlab-mcp-core-server-win64.exe is launched directly from Command Prompt (outside of Claude Desktop), it starts successfully with no errors:

{"level":"INFO","msg":"Initiating application startup"}
{"level":"INFO","msg":"Application startup complete"}
{"level":"INFO","msg":"Added tools to MCP SDK server","count":5}
{"level":"INFO","msg":"Added resources to MCP SDK server","count":2}

This confirms the issue is not with the binary itself, but specifically with how Claude Desktop's MSIX sandbox environment spawns and interacts with child processes.

Root cause hypothesis

Claude Desktop on Windows is packaged as an MSIX application, which runs inside a lightweight sandbox with a virtualized filesystem and restricted inter-process communication (IPC). The MATLAB MCP Core Server uses a watchdog socket for inter-process communication between the server process and its watchdog. When the server is spawned as a child process of the MSIX-sandboxed Claude Desktop, Windows denies access to the socket file — likely because the sandbox restricts named pipe or socket creation/access in the temp directory (C:\Users\<user>\AppData\Local\Temp\matlab-mcp-core-server-*).

Full error sequence from log

[info] Server started and connected successfully
{"level":"INFO","msg":"Initiating application startup"}
{"level":"INFO","msg":"Configuration state", ...}
{"level":"INFO","msg":"Application directory state","log-dir":"C:\\Users\\...\\AppData\\Local\\Temp\\matlab-mcp-core-server-XXXXXXXXX"}
{"level":"ERROR","msg":"Failed to connect to watchdog socket","error":"access denied for socket file"}
{"level":"INFO","msg":"Initiating application shutdown"}
{"level":"INFO","msg":"Application shutdown complete"}
Failed to initialize MCP Core Server. Error: %[1]s.
[info] Server transport closed
[error] Server disconnected.

Steps to reproduce

  1. Install Claude Desktop on Windows (from either Microsoft Store or claude.ai — both install as MSIX)
  2. Install MATLAB MCP Core Server v0.6.0 via the .mcpb extension in Settings → Extensions
  3. Restart Claude Desktop
  4. Observe "Server disconnected" error in Settings → Developer

What was tried

  • Installing via .mcpb extension — fails with watchdog error
  • Manual claude_desktop_config.json config with direct binary path — fails with watchdog error
  • cmd.exe batch file wrapper — fails with watchdog error
  • Running Claude Desktop as Administrator — fails with watchdog error
  • Running the binary directly from Command Prompt — works perfectly

Expected behavior

The MATLAB MCP Core Server should start successfully when spawned by Claude Desktop, just as it does when run directly from a terminal.

Suggested fix

The watchdog inter-process communication mechanism should be made compatible with the MSIX sandbox environment. Possible approaches:

  • Use a communication method that works within MSIX sandbox restrictions (e.g., stdout/stdin pipe instead of a socket file)
  • Place the socket file in a location accessible to MSIX-sandboxed processes
  • Add a --no-watchdog or --disable-watchdog flag as a workaround option for users in restricted environments

Additional notes

The Failed to initialize MCP Core Server. Error: %[1]s. message also appears to be a bug — %[1]s looks like an unformatted Go format string placeholder, suggesting the error message formatting is broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions