Visual studio code github copilot not connecting to Azure MCP server

Shweta Iyer 0 Reputation points Microsoft Employee
2025-07-29T08:03:23.8+00:00

I followed the below documentation to connect Azure MCP server in VS Code, to use it in Github Copilot chat agent mode.

https://learn.microsoft.com/en-us/azure/developer/azure-mcp-server/get-started?pivots=mcp-github-copilot&tabs=manual%2Cazure-cli&source=docs

However, the steps given below does not work:

Adding the mentioned code in mcp.json does not connect to Azure MCP, instead gives below error:

2025-07-29 10:50:10.534 [warning] [server stderr] command not found: server 2025-07-29 10:50:11.856 [info] Connection state: Error Process exited with code 1 2025-07-29 10:50:11.856 [error] Server exited before responding to initialize request.

Developer technologies | Visual Studio | Setup
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Susmitha T (INFOSYS LIMITED) 160 Reputation points Microsoft External Staff
    2025-07-30T08:56:04.53+00:00

    Thank you for reaching out. Please find the answer below.

     

    1.Verify the Installation: Ensure that you have installed the MCP server correctly. You can do this by running the command in your terminal: npx @azure/mcp@latest server start If this command runs successfully, ensure that the server is listening for connections.

    2.Check your mcp .json Configuration: Make sure your mcp.json file in the .vscode directory is properly formatted.

    Note: In the error, which you shared "Command not found server" means the server subcommand was missingor misplaced, make sure .vscode/mcp.json server config looks like:

    "mcp": {   
    "servers": {    
      "Azure MCP server": {   
      "command": "npx",   
      "args": ["-y","@azure/mcp@latest", "server", "start"]  
        }   
    }  
     }

    3.Node.js Version: Ensure you're using Node.js v20 or higher. Older versions may not support the MCP server properly.

    4.Please ensure: 1. You're using Node.js v20 or higher.                            
      2.Your mcp.json file uses "npx" as the command, not "server".                              
    3.You've authenticated with Azure using az login.

    If the issue persists, try running the MCP server manually using: npx -y @azure-devops/mcp <your-org-name>

    5.Permissions: Ensure that you have the correct permissions to access Azure resources. You might need to verify if your Azure account has necessary RBAC roles assigned.

    6.WebSocket Configuration: If your network restricts WebSocket connections, ensure that they are enabled, as some functionalities may not work without them.

    If issue still persist after following all the steps, we’ll be happy to assist further if needed." Kindly mark the answer as accepted if the issue resolved".


  2. Shweta Iyer 0 Reputation points Microsoft Employee
    2025-08-05T07:39:04.1766667+00:00

    On debugging further, got the below reason for the error:

    1. @azure/mcp tries to install a platform-specific binary (@azure/mcp-win32-x64 for Windows).
    2. On your system:
      • The required binary wasn’t downloaded.
      • The install script failed to clean up the wrong platform (mcp-linux-x64).
      • This caused the CLI (server start) to be unavailable.
    3. When GitHub Copilot Chat or MCP Inspector tries to run:
         npx -y @azure/mcp@latest server start
      
      ...it fails with command not found: server.

    To fix it, I manually installed the npm pacakge and then executed the above command.

    npm install @azure/mcp-win32-x64

    Also, in mcp.json, added the missing transport argument which is required for MCP servers to communicate properly.

    {
        "servers": {
            "Azure MCP Server": {
                "command": "npx",
                "args": ["@azure/mcp", "server", "start", "--transport", "stdio", "--read-only"]
            }
        }
    }
    
    0 comments No comments

  3. Susmitha T (INFOSYS LIMITED) 160 Reputation points Microsoft External Staff
    2025-08-05T10:14:33.8866667+00:00

    Thank you for reaching out. Please find the answer below.

     

    Issue to be addressed: The error command not found: server stems from a failed installation of the platform-specific binary @azure/mcp-win32-x64 on Windows. The MCP CLI couldn't locate the correct binary, defaulted to the wrong one (mcp-linux-x64), and thus failed to start.

     

    Kindly follow the below steps:

    1. Manually Install the Correct Binary:  Run the below command to install the Windows-specific MCP binary.

     Run this in the terminal: npm install @azure/mcp-win32-x64 --save-dev

     This ensures the CLI has access to the correct executable for your platform.

     

    2.Update mcp.json Configuration: Make sure your .vscode/mcp.json includes the required transport argument.

    {  
    "servers": {  
       "Azure MCP Server": {
          "command": "npx",    
       "args": ["@azure/mcp", "server", "start", "--transport", "stdio", "--read-only"]    
    }
      }
    }
    The --transport stdio flag is essential for communication between VS Code and the MCP server.

     

    3. Verify Node.js Version: Ensure you're using Node.js v20 or higher, you can check with the code:  node -v

    4. Authenticate with Azure: Run: az login

    Make sure you're signed in with the correct Azure account that has access to the necessary resources.

     

    5. Permissions Check: Ensure your Azure account has the required RBAC roles to interact with Azure DevOps or other services via MCP.

     

    6. Network Configuration: If you're behind a firewall or proxy, verify that WebSocket connections are allowed. MCP relies on them for certain interactions.

    If issue still persist after following all the steps, we’ll be happy to assist further if needed." Kindly mark the answer as accepted if the issue resolved".

     


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.