microsoft / microsoft/GitHub-Copilot-for-Azure
[Bug]: Concurrent Azure MCP launches can fail on Windows due to shared npx cache locks
- Dominant language
- Python
- Stars
- 250
- Forks
- 204
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 67
Description
### GitHub Copilot for Azure Version
Azure Skills v1.2.29
### Regression From
Unknown.
### Platform
- Windows 11 10.0.26200
- GitHub Copilot CLI 1.0.81-2
- Node.js 24.19.0
- npm/npx 11.17.0
### Describe the Issue
Azure Skills configures Azure MCP using:
```json
{
"command": "npx",
"args": ["-y", "@azure/mcp@latest", "server", "start"]
}
```
When another Azure MCP process is running from the same Windows `_npx` cache, a new invocation may resolve a newer version and try to replace the executable currently in use.
I reproduced this with a cache containing Azure MCP 3.0.0-beta.35. Concurrent `@latest` invocations resolved 3.0.0-beta.36 and failed while retiring the old package:
```text
npm error code EBUSY
npm error syscall copyfile
npm error EBUSY: resource busy or locked, copyfile
...\@azure\mcp-win32-x64\dist\azmcp.exe
->
...\@azure\.mcp-win32-x64-uLWeNcUL\dist\azmcp.exe
```
The failure was reproduced in two ways:
1. Three concurrent GitHub Copilot CLI sessions produced one successful Azure MCP initialization and two `EBUSY` failures.
2. Outside any MCP host, three direct invocations of the following command all failed with the same `EBUSY`:
```powershell
npx -y @azure/mcp@latest --version
```
This shows that the direct failure occurs in the plugin-defined package launcher and does not require Copilot CLI session lifecycle, MCP initialization, sandboxing, or orphaned processes.
The exact failure was reproduced on Windows. Linux and macOS have not been tested.
### Steps to Reproduce
1. Install Azure Skills v1.2.29 on Windows.
2. Start Azure MCP and keep it running.
3. From another terminal, run:
```powershell
npx -y @azure/mcp@latest --version
```
4. If `@latest` is newer than the running cached version, npm attempts to replace the cached package and fails with `EBUSY`.
The same condition can occur when multiple MCP hosts use the Azure Skills configuration concurrently.
### Expected Experience
- Multiple MCP host instances can start Azure MCP concurrently on Windows.
- Starting a new instance does not modify an executable used by another instance.
- Existing Azure MCP processes do not need to be stopped.
- All instances use a deterministic Azure MCP version.
### Additional Context
Related issues:
- microsoft/GitHub-Copilot-for-Azure#3045 considers pinning the Azure MCP version.
- microsoft/azure-skills#124 covers the plugin's direct dependency on `npx`.
- microsoft/mcp#1629 covered locking during plugin updates.
Pinning the version would improve determinism, but concurrent first-time installation could still race if all instances share a mutable npx cache.
A durable fix would avoid resolving or updating Azure MCP during each host startup. For example, the plugin could resolve Azure MCP during installation or update and launch it from an immutable, versioned location.
Contributor guide
Assessment
This issue has not been assessed yet.