[BUG] Azure MCP fails to start in Copilot CLI’s macOS sandbox because the default .NET bundle extraction location is inaccessible

オープン
#3,976 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@RickWinter がすでに取り組んでいます。

2026年11月5日 から。

評価

この issue はまだ評価されていません。

説明

customer-reported needs-team-attention question server-Azure.Mcp tools-Core

[BUG] Azure MCP fails to start in Copilot CLI's macOS sandbox because the default .NET bundle extraction location is inaccessible

Target repository: https://github.com/microsoft/mcp

Describe the bug

The Azure plugin starts Azure MCP Server through npx:

npx -y @azure/mcp@latest server start

On macOS, with Copilot CLI's local sandbox enabled for MCP servers, startup fails while the .NET host selects a directory for extracting embedded files. DOTNET_BUNDLE_EXTRACT_BASE_DIR is not set, and the default home-based location is inaccessible for read/write inside the sandbox.

Setting DOTNET_BUNDLE_EXTRACT_BASE_DIR to a private directory under the current user's macOS temporary directory, for one Copilot invocation only, resolves the failure. No additional filesystem grants, plugin changes, or sandbox disabling were needed. The plugin-provided Azure MCP server then exposed 69 tools.

I am reporting this here because the npm launcher or distribution may be able to accommodate restricted execution environments before starting the .NET executable. It is not yet established whether the appropriate fix belongs in Azure MCP's launcher/distribution, the Azure plugin, or Copilot's sandbox integration.

Expected behavior

Azure MCP should be able to start in a sandbox that provides a writable, user-private temporary directory without requiring write access to the user's home directory.

If explicit extraction-directory configuration is required, please provide or document a supported server-scoped solution, rather than requiring users to set a global environment variable for all .NET applications.

Actual behavior

Copilot reports that the plugin-provided Azure MCP server failed to initialize inside the sandbox. The server's stderr contains:

Default extraction directory [/Users/<user>] either doesn't exist or is not accessible for read/write.
Failure processing application bundle.
Failed to determine location for extracting embedded files.
DOTNET_BUNDLE_EXTRACT_BASE_DIR is not set, and a read-write cache directory couldn't be created.

The home directory exists. The failure occurs in the sandboxed launch.

Reproduction Steps

  1. On macOS, use the Azure plugin, whose MCP definition invokes npx -y @azure/mcp@latest server start without an explicit bundle extraction directory.
  2. Enable Copilot CLI's local sandbox and MCP sandboxing (sandbox.sandboxMcpServers: true). Do not grant broad write access to the home directory.
  3. Start copilot normally with DOTNET_BUNDLE_EXTRACT_BASE_DIR unset.
  4. Run /mcp show azure. Observe initialization failure and the .NET extraction error above.
  5. Exit Copilot. From the same terminal, start it with the following process-scoped workaround:
(
    set -eu
    case "${TMPDIR:-}" in
        /*) ;;
        *) printf '%s\n' 'An absolute macOS TMPDIR is required.' >&2; exit 1 ;;
    esac

    extraction_dir=$(mktemp -d "${TMPDIR%/}/azure-mcp-bundle.XXXXXX")
    DOTNET_BUNDLE_EXTRACT_BASE_DIR="$extraction_dir" copilot
)
  1. Run /mcp show azure again. With this extraction-directory override, the server initializes and exposes 69 tools.

The workaround leaves its temporary directory in place; remove only that directory after Copilot exits if cleanup is needed. It does not modify persistent environment settings, plugin files, or sandbox policy.

Environment

  • OS: macOS, Apple Silicon.
  • Client: GitHub Copilot CLI; version 1.0.100-1 was observed during the investigation. The version associated with the earliest failure log was not separately recorded.
  • Server source: plugin-contributed Azure MCP from microsoft/azure-skills.
  • Azure plugin version observed on macOS: 1.2.92.
  • Launch command: npx -y @azure/mcp@latest server start.
  • Exact resolved Azure MCP version for the macOS failure: not captured. The @latest command alone should not be treated as proof of a specific resolved version.
  • No Azure tool calls, authentication changes, or cloud operations were needed to reproduce or verify startup.

Additional context

.NET's single-file deployment documentation describes the default extraction base as $HOME/.net on Unix and %TEMP%/.net on Windows, unless DOTNET_BUNDLE_EXTRACT_BASE_DIR is provided.

For comparison, a successful Windows sandboxed launch was observed through .NET host tracing:

Detected Single-File app bundle
Files embedded within the bundle will be extracted to [<user-temp>\.net\azmcp\<bundle-id>] directory.
Reusing existing extraction of application bundle.

The launching PowerShell had DOTNET_BUNDLE_EXTRACT_BASE_DIR unset, and its TEMP and TMP matched the parent temporary directory shown in the trace. This confirms the selected Windows location and reuse of an existing extraction, not a fresh extraction/write test or direct inspection of the server process's environment.

PR https://github.com/microsoft/mcp/pull/2252 addressed the same .NET error class in a Docker image with a missing home directory. This report concerns a different condition: an existing home directory that is not writable from the macOS sandbox.

Would it be appropriate for the npm launcher to establish a safe, user-private extraction location before spawning the .NET executable, while preserving an explicitly configured DOTNET_BUNDLE_EXTRACT_BASE_DIR? Alternatively, should this be handled in the Azure plugin or coordinated with Copilot CLI?

主要言語
C#
スター
3.9k
フォーク
689
平均マージ
2日 11時間
マージ済み PR(30日)
143

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/mcp のほかの issue

microsoft/mcp の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。