-
Notifications
You must be signed in to change notification settings - Fork 347
Description
Related to #710 - This is a more general case of the InteractiveBrowserCredential issue, affecting Claude Desktop and other headless
Linux environments, not just Docker.
Environment
- OS: Linux (Manjaro)
- Azure MCP Version: 0.8.6 (tested), 0.6.x-0.8.x affected
- Working Version: 0.5.8
- Client: Claude Desktop
- Azure CLI Version: Working and authenticated (az login successful)
- Environment: Headless (no X11 display server)
Description
Starting from version 0.6.x, Azure MCP server fails to use Azure CLI credentials and falls back to Interactive Browser authentication,
which fails in headless Linux environments with the error "No X display available."
Version 0.5.8 correctly uses Azure CLI credentials without attempting browser authentication.
Steps to Reproduce
- Install Azure MCP 0.8.6:
npm install -g @azure/mcp@0.8.6 - Ensure Azure CLI is authenticated:
az login
az account show # Verify authentication works - Configure Claude Desktop (or any MCP client) in ~/.config/Claude/claude_desktop_config.json:
{
"mcpServers": {
"azure": {
"command": "/path/to/node",
"args": [
"/path/to/@azure/mcp/index.js",
"server",
"start",
"--transport",
"stdio"
],
"env": {
"HOME": "/home/username",
"PATH": "/usr/local/bin:/usr/bin:/bin:/home/username/bin",
"AZURE_SUBSCRIPTION_ID": "your-subscription-id",
"AZURE_TENANT_ID": "your-tenant-id",
"AZURE_AUTHORITY_HOST": "https://login.microsoftonline.com"
}
}
}
} - Start Claude Desktop and try to use any Azure MCP tool (e.g., subscription_list)
Expected Behavior
Azure MCP server should use the Azure CLI credential from the authentication chain and successfully authenticate without user
interaction.
Actual Behavior
- Server attempts interactive browser authentication
- Opens a browser authentication window (or attempts to)
- In headless environments, outputs "No X display available. Running in headless mode." to stdout
- This corrupts the JSON-RPC protocol, causing parsing errors:
SyntaxError: Unexpected token 'N', "No X displ"... is not valid JSON - Request times out after 4 minutes with error: MCP error -32001: Request timed out
Logs
From ~/.config/Claude/logs/mcp-server-azure.log:
2025-10-11T08:20:22.559Z [azure] [info] Message from client:
{"method":"tools/call","params":{"name":"subscription_list","arguments":{"intent":"list all subscriptions"}},"jsonrpc":"2.0","id":4}
2025-10-11T08:20:22.603Z [azure] [error] Unexpected token 'N', "No X displ"... is not valid JSON
at JSON.parse ()
Root Cause Analysis
The Azure Identity library's credential chain appears to be failing at the Azure CLI Credential step and falling back to Interactive
Browser Credential:
- Environment Credential
- Visual Studio Credential
- Azure CLI Credential ← Failing here in 0.6.x-0.8.x
- Azure PowerShell Credential
- Interactive Browser Credential ← Falls back to this
Workaround
Downgrade to version 0.5.8:
npm uninstall -g @azure/mcp
npm install -g @azure/mcp@0.5.8
Version 0.5.8 correctly uses Azure CLI credentials without browser fallback.
Additional Context
- Python test using AzureCliCredential from @azure/identity works correctly (gets token successfully)
- The az CLI command is in PATH and accessible
- Azure CLI authentication is valid and not expired
- This is a regression - the behavior changed between 0.5.8 and 0.6.x
Impact
- Breaks Azure MCP functionality in headless Linux environments (CI/CD, servers, WSL)
- Forces users to downgrade to 0.5.8
- Affects any environment without X11/Wayland display server
Related Issues
- [BUG] Docker run fails. Throws InteractiveBrowserCredential in docker #710 - Similar issue in Docker environments with InteractiveBrowserCredential
- Puppeteer MCP fails to launch Chromium in Ubuntu (WSL) due to sandbox/X display issues modelcontextprotocol/servers#819 - Similar pattern in other MCP servers
Related Information
- Azure MCP Server: https://github.com/microsoft/mcp/tree/main/servers/Azure.Mcp.Server
- Azure MCP Authentication Docs: https://learn.microsoft.com/en-us/azure/developer/azure-mcp-server/get-started
Metadata
Metadata
Assignees
Labels
Type
Projects
Status