How/What code/text I should add to claude_desktop_config.json to confgure node-code-sandbox in windows machine

View original issue on GitHub  ·  Variant 2

Configuring node-code-sandbox on Windows with claude_desktop_config.json

The user is trying to configure the node-code-sandbox-mcp with Claude on a Windows machine. They've successfully activated the Node.js Sandbox MCP in Docker Desktop, but are unsure how to correctly configure the claude_desktop_config.json file to enable communication between Claude and the sandbox. They've found a configuration snippet that appears to be designed for Linux, specifically referencing paths like /var/run/docker.sock and a user directory under /Users/YOUR_USERNAME, which are not directly applicable to Windows.

The core problem lies in the different path structures and Docker socket handling between Linux and Windows. The provided Linux configuration mounts the Docker socket directly into the container, allowing the container to control the Docker daemon on the host. It also mounts a specific user directory for output. These approaches need adaptation for Windows.

Solution: Adapting the Configuration for Windows

Here's how to modify the claude_desktop_config.json file for a Windows environment:

First, the docker socket mounting is not usually required on Windows when using Docker Desktop. Docker Desktop handles the communication between the host and the containers. Second, the file path translation is needed.

Here's a possible configuration. Note that you'll need to replace C:/Users/YOUR_USERNAME/Desktop/sandbox-output with the actual path you want to use on your Windows machine.

{
  "node-code-sandbox": {
    "command": "docker",
    "args": [
      "run",
      "-i",
      "--rm",
      "-v",
      "C:/Users/YOUR_USERNAME/Desktop/sandbox-output:/root",
      "mcp/node-code-sandbox"
    ]
  }
}

Explanation:

Important Considerations:

By adapting the configuration to use Windows-style paths and ensuring Docker Desktop is properly configured, you should be able to successfully integrate the node-code-sandbox-mcp with Claude on your Windows machine.