Azure SDK MCP Authentication Issues on macOS
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 130
Description
## Problem Summary
The Azure SDK MCP (Model Context Protocol) server fails to authenticate properly on macOS, specifically when trying to create release plans or perform other Azure DevOps operations. The error consistently shows "Unknown" as the platform, causing authentication failures.
## Environment
- **OS**: macOS 15.0.0 (Sequoia)
- **Architecture**: ARM64 (Apple Silicon)
- **Runtime**: .NET 8.0.0
- **MCP Server**: azsdk wrapper located at `/Users/cataggar/bin/azsdk`
## Error Details
### Primary Error
```
System.InvalidOperationException: Unknown platform 'Unknown'
at Azure.Identity.SharedUtilities.PlatformInformation.get_Platform()
at Azure.Identity.SharedUtilities.UserAgentValue..ctor(String applicationId)
at Azure.Identity.CredentialDiagnosticScope..ctor(String name, String message, TokenRequestContext context, CredentialPipeline pipeline)
at Azure.Identity.ManagedIdentityClient.AuthenticateAsync(Boolean async, TokenRequestContext context, CancellationToken cancellationToken)
at Azure.Identity.ManagedIdentityCredential.GetTokenImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken)
at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex, String additionalMessage)
at Azure.Identity.ManagedIdentityCredential.GetTokenImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken)
at Azure.Identity.DefaultAzureCredential.GetTokenFromSourcesAsync(TokenCredential[] sources, TokenRequestContext requestContext, Boolean async, CancellationToken cancellationToken)
```
### Specific Tool Failures
When calling `mcp_azure-sdk-mcp_azsdk_create_release_plan` with parameters:
The operation fails with the platform detection error above.
## Attempted Solutions
### 1. Azure CLI Authentication
Verified Azure CLI authentication is working:
```bash
az account show
az devops configure --defaults organization=https://dev.azure.com/azure-sdk
```
Both commands work successfully and show proper authentication.
### 2. Runtime Configuration Modifications
Created a custom `azsdk.runtimeconfig.json` file with explicit platform information:
```json
{
"runtimeOptions": {
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
}
],
"configProperties": {
"System.Runtime.InteropServices.RuntimeInformation.Platform": "OSX",
"System.Runtime.InteropServices.RuntimeInformation.OSDescription": "macOS 15.0.0",
"System.Runtime.InteropServices.RuntimeInformation.Architecture": "Arm64",
"System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription": ".NET 8.0.0",
"System.GC.Server": false,
"System.Globalization.Invariant": false,
"System.Net.Http.UseSocketsHttpHandler": true,
"System.Threading.ThreadPool.MinThreads": 4,
"System.Threading.ThreadPool.MaxThreads": 1000,
"Azure.Identity.PlatformInformation.OSDescription": "macOS 15.0.0",
"Azure.Identity.PlatformInformation.Platform": "macOS",
"Azure.Identity.UserAgent": "azsdk-net-Azure.Identity/1.0.0 (.NET 8.0.0; macOS 15.0.0)"
}
}
}
```
**Result**: The runtime configuration changes did not resolve the issue. The platform detection still fails with "Unknown platform 'Unknown'".
### 3. Direct Azure DevOps API Testing
Tested direct Azure DevOps REST API calls using curl with the same authentication token:
```bash
# Successfully obtained token
az account get-access-token --resource https://management.azure.com/ --query accessToken -o tsv
# API call returned 404, suggesting endpoint issues rather than auth issues
curl -X POST "https://dev.azure.com/azure-sdk/_apis/wit/workitems/\$Work%20Item?api-version=7.1" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json-patch+json" \
-d '[...]'
```
### 4. PowerShell Verification
Verified PowerShell is installed and accessible:
```bash
pwsh --version
# PowerShell 7.4.6
```
## Root Cause Analysis
The issue appears to be in the Azure.Identity library's platform detection mechanism when running within the MCP server context. The `PlatformInformation.get_Platform()` method is returning "Unknown" instead of properly detecting macOS.
This suggests either:
1. The Azure.Identity library version used in the MCP server has a bug with macOS ARM64 detection
2. The MCP server execution context interferes with platform detection
3. There's a missing dependency or configuration for proper platform detection on macOS
## Impact
- Unable to create release plans from macOS
- Other Azure DevOps operations may also be affected
- Blocks TypeSpec-to-SDK workflow automation on macOS development machines
## Recommended Investigation
1. Check the version of Azure.Identity used in the MCP server
2. Test platform detection in isolation outside of MCP context
3. Verify if this affects other macOS users or is specific to certain configurations
4. Consider adding explicit platform detection fallbacks for macOS
5. Review if there are missing native dependencies for platform detection on macOS ARM64
## Workaround
Currently, no effective workaround has been found. Users on macOS cannot use the Azure SDK MCP for release plan creation and related Azure DevOps operations.
## Additional Context
- The issue occurs consistently across multiple attempts
- Azure CLI authentication works properly, indicating the authentication credentials are valid
- The issue appears specific to the platform detection within the Azure.Identity library context
- Runtime configuration overrides do not affect the platform detection logic
---
**Created**: October 15, 2025
**Platform**: macOS 15.0.0 ARM64
**Reporter**: User experiencing TypeSpec-to-SDK workflow issues
Contributor guide
Assessment
This issue has not been assessed yet.