launching MSB through VSCODE + MCP server

Author: SR-GCreated Aug 24, 2026Updated Sep 12, 2026
LabelsInvestigateWindowsMCP

As discussed in #1426 :

  • i also encountered that bug (0.6.12 not working, not even from CLI, 0.6.9 fully working in CLI)
  • at the same time, i've not been able to use from VSCODE the MSB MCP server, even (see the JSON configuration below) when reconfiguring everything with 0.6.9 version
    • downgrade of the MSB_PATH
    • downgrade of the NPX MCP version
  • for now i'll pause these investigations and await for 0.6.14
  • creating this issue for reference / in case it would help, as requested in #1426

AI summary of the investigations below.


Microsandbox + MCP on Windows: Investigation Summary

Context

The objective was to configure GitHub Copilot Agent Mode in VS Code to execute commands inside Microsandbox (MSB) microVMs instead of running commands directly on the Windows host.

Environment

  • Windows 11
  • VS Code with Copilot Agent Mode (Ask / Plan / Agent)
  • Microsandbox CLI (msb) v0.6.9
  • Microsandbox MCP Server v0.6.9
  • Node.js v26.7.0
  • MCP configured through VS Code

MCP Configuration

json
{
  "servers": {
    "MSB": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "MSB_PATH": "C:\\Users\\<REDACTED>\\scoop\\apps\\microsandbox\\0.6.9\\msb.exe"
      }
    }
  }
}

Initial Observation

VS Code successfully connects to the MCP server:

Starting server MSB
Connection state: Running
Discovered 69 tools

This confirms:

  • ✅ MCP server starts successfully
  • ✅ VS Code communicates correctly with MCP
  • ✅ Copilot Agent discovers Microsandbox tools

Runtime Validation

The MCP runtime check returned:

json
{
  "ok": true,
  "data": {
    "installed": true,
    "serverVersion": "0.6.9",
    "nodeVersion": "v26.7.0",
    "platform": "win32",
    "arch": "x64",
    "msbPath": "C:\\Users\\<REDACTED>\\scoop\\apps\\microsandbox\\0.6.9\\msb.exe",
    "libkrunfwPath": null,
    "hostPathPolicy": "allowlist",
    "hostPaths": [
      "C:\\Users\\<REDACTED>"
    ],
    "dangerousEnabled": false
  }
}

This confirms:

  • ✅ MCP detects the expected msb.exe
  • ✅ Runtime installation is considered healthy
  • ✅ MCP and runtime versions match (0.6.9)

However:

  • ⚠️ libkrunfwPath remains null

MSB Runtime Works Correctly

Direct CLI execution succeeds repeatedly:

cmd
msb run ubuntu -- uname -a

Output:

Linux msb-xxxxxxxx 6.12.99 ...

This validates:

  • ✅ Windows Hypervisor Platform
  • ✅ MSB runtime
  • ✅ Ubuntu image
  • ✅ Agent runtime inside the VM
  • ✅ Command execution

MCP Failure Symptoms

Ephemeral Sandbox Execution

Copilot uses:

mcp_microsandbox_sandbox_run

with parameters:

json
{
  "image": "ubuntu:24.04",
  "command": "uname -a"
}

Failure:

The first sandbox boot failed before command execution.

Sandbox Creation

Copilot then attempted:

mcp_microsandbox_sandbox_create

Failure:

sandbox process exited (exit code: 0)
before agent relay became available

Sandbox Execution

Copilot subsequently attempted:

mcp_microsandbox_sandbox_exec

Failure:

runtime error:
sandbox startup timeout:
no JSON received within 30 seconds

Contradictory Behaviour

Despite MCP reporting failures, the supposedly failed sandboxes still exist.

Example:

cmd
msb list

returned:

mcp-run-xxxxxxxxxxxx    ubuntu:24.04    running

Inspection:

cmd
msb inspect mcp-run-xxxxxxxxxxxx

returned:

Status: running
Image: ubuntu:24.04
CPUs: 1
Memory: 512 MiB

And direct command execution succeeds:

cmd
msb exec mcp-run-xxxxxxxxxxxx -- uname -a

Output:

Linux mcp-run-xxxxxxxxxxxx ...

Key Finding

The Microsandbox MCP layer reports:

Sandbox failed to start

while the underlying runtime proves:

Sandbox exists
Sandbox is running
Sandbox accepts commands
Sandbox returns output

The actual microVM is healthy.

The failure appears to occur in the MCP bootstrap / relay detection process rather than in the VM itself.


Available MCP Tools

Copilot exposes dedicated Microsandbox tools, including:

mcp_microsandbox_sandbox_run
mcp_microsandbox_sandbox_create
mcp_microsandbox_sandbox_exec
mcp_microsandbox_sandbox_shell
mcp_microsandbox_runtime_check
mcp_microsandbox_runtime_install

Neither:

sandbox_run

nor:

sandbox_create + sandbox_exec

succeeded from Copilot, despite the resulting sandboxes being operational from the CLI.


Most Significant Error

The most informative error observed was:

sandbox process exited (exit code: 0)
before agent relay became available

followed by:

sandbox startup timeout:
no JSON received within 30 seconds

This strongly suggests a failure in:

Microsandbox MCP
        ↕
Agent relay
        ↕
JSON RPC/bootstrap protocol

rather than a failure of:

Hyper-V
MSB runtime
Ubuntu image
VM startup
Command execution

Validation of Runtime Components

Runtime files are present and correctly installed:

C:\Users\<REDACTED>\scoop\apps\microsandbox\0.6.9\msb.exe
C:\Users\<REDACTED>\scoop\apps\microsandbox\0.6.9\libkrunfw.dll

Directory contents:

libkrunfw.dll
msb.exe
install.json
manifest.json

The CLI successfully uses these components.


Conclusions

Confirmed Working

  • ✅ VS Code MCP integration
  • ✅ GitHub Copilot Agent Mode
  • ✅ Microsandbox CLI
  • ✅ MSB runtime v0.6.9
  • ✅ Ubuntu images
  • ✅ MicroVM creation
  • ✅ Command execution from CLI
  • ✅ Existing sandbox lifecycle
  • ✅ Execution inside MCP-created sandboxes via CLI
  • ✅ Explicit MCP runtime detection (msbPath resolved correctly)

Confirmed Failing

  • ❌ MCP bootstrap readiness detection
  • ❌ Agent relay availability detection
  • ❌ MCP command execution path
  • ❌ MCP sandbox startup validation
  • ❌ MCP JSON bootstrap initialization

Final Assessment

All evidence points to a bug in the Microsandbox MCP / SDK Windows integration layer, specifically around:

agent relay startup
bootstrap readiness detection
JSON protocol initialization

The microVMs themselves are functioning correctly.

The issue is reproducible because:

  1. MCP reports sandbox startup failures.
  2. The same sandbox remains running.
  3. Direct msb exec against that sandbox succeeds.

This indicates a discrepancy between the MCP bootstrap validation mechanism and the actual operational state of the sandbox.


Current Status

Investigation paused pending resolution of upstream issue #1426.

The recommended path forward is to wait for an upstream fix and then retest with aligned versions of:

msb
microsandbox-mcp
Microsandbox SDK

since the underlying runtime has already been validated successfully.

Source: superradcompany/microsandbox