-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Describe the bug
MCP server child processes do not inherit machine-level NuGet credential provider env vars
Description
MCP servers launched by Copilot CLI via dotnet run fail to authenticate against private NuGet feeds, even though the same command works from the terminal on the same machine.
The NuGet credential provider is configured via machine-level environment variables (HKLM registry):
NUGET_PLUGIN_PATHSNUGET_NETCORE_PLUGIN_PATHS
These should be inherited by all child processes. The terminal inherits them and authenticates fine. Copilot CLI's MCP server child processes do not.
Repro
- Have a .NET MCP server project that depends on a private Azure DevOps Artifacts feed (for packages or MSBuild SDK resolution via
global.json) - Machine has Azure Artifacts credential provider installed with machine-level env vars
dotnet runworks from the terminal- The same MCP server fails to start in Copilot CLI with NuGet auth errors
Expected
Child processes inherit the full parent environment, including machine-level env vars — same as VS Code does when launching MCP servers.
Actual
NuGet credential provider is unavailable to the child process, causing unauthenticated requests that fail.
Note: dotnet run sends build errors to stdout (the MCP JSON-RPC transport), so these failures are silently swallowed. The server appears to fail with no diagnostics.
Environment
- Windows 11, Copilot CLI 0.0.421-1, dotnet SDK 8.0/9.0
- NuGet credential provider: Azure Artifacts CredentialProvider.Microsoft (MSAL)
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response