Fixing « spawn npx ENOENT » Error When Setting Up Azure DevOps MCP Server in VS Code

The Problem

When trying to set up the Azure DevOps Model Context Protocol (MCP) server in VS Code, you might encounter this frustrating error:

Connection state: Error spawn npx ENOENT

This error indicates that VS Code cannot find or execute the npx command, which is needed to run the @azure-devops/mcp package.

Understanding the Root Cause

The ENOENT error (Error NO ENTry) means the system cannot locate the specified file or command. This typically happens because:

  1. Node.js/npm is not installed on your system
  2. npx is not in VS Code’s PATH environment
  3. Different Node.js versions are being used (system vs. nvm)
  4. Permission issues with the npm global packages

Solution Methods

Method 1: Verify Node.js Installation

First, check if Node.js and npm are properly installed:

node --version
npm --version
which npx

If these commands fail, install Node.js:

# Ubuntu/Debian
sudo apt update
sudo apt install nodejs npm

# Or using snap
sudo snap install node --classic

Method 2: Use Full Path to npx

If npx exists but VS Code can’t find it, use the absolute path in your mcp.json:

# Find npx location
which npx

Then update your configuration:

{
  "servers": {
    "ado": {
      "type": "stdio",
      "command": "/usr/bin/npx",
      "args": ["-y", "@azure-devops/mcp", "${input:ado_org}"]
    }
  }
}

Method 3: Handle nvm Installations

If you’re using nvm (Node Version Manager), the path might be different:

# Check nvm path
echo $NVM_DIR
which npx

Use the nvm-specific path:

{
  "servers": {
    "ado": {
      "type": "stdio",
      "command": "/home/username/.nvm/versions/node/v22.16.0/bin/npx",
      "args": ["-y", "@azure-devops/mcp", "${input:ado_org}"]
    }
  }
}

Method 4: Direct Node.js Execution

For maximum reliability, skip npx entirely and call Node.js directly:

# Install the package globally
npm install -g @azure-devops/mcp

# Find the package location
npm list -g @azure-devops/mcp

Then configure direct execution:

{
  "servers": {
    "ado": {
      "type": "stdio",
      "command": "/path/to/node",
      "args": [
        "/path/to/node_modules/@azure-devops/mcp/dist/index.js",
        "${input:ado_org}"
      ]
    }
  }
}

Method 5 (FINAL WORKING SOLUTION): Simplify with Direct Organization Name

If the input prompting isn’t working, hardcode your organization name:

{
  "servers": {
    "ado": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@azure-devops/mcp", "your-org-name"]
    }
  }
}

Complete Working Configuration

Here’s a final working configuration that should handle most scenarios:

{
  "servers": {
    "ado": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@azure-devops/mcp", "your-organization"]
    }
  }
}

Troubleshooting Tips

  1. Restart VS Code after making configuration changes
  2. Check VS Code’s terminal environment – it might differ from your system terminal
  3. Install packages globally using sudo npm install -g @azure-devops/mcp
  4. Verify package installation with npm list -g @azure-devops/mcp
  5. Check permissions on npm global directories

Success Indicators

When everything works correctly, you should see:

Starting server ado
Connection state: Starting

And if the server starts but needs parameters, you’ll see:

Usage: mcp-server-azuredevops <organization_name>

This indicates the server is running but needs your Azure DevOps organization name.

Conclusion

The spawn npx ENOENT error is typically a PATH or installation issue. Start with the simplest solutions (checking Node.js installation) and progressively move to more specific fixes. The direct organization name approach is often the most reliable for production setups, while the input-based configuration offers more flexibility for multiple organizations.

Remember to replace "your-organization" with your actual Azure DevOps organization name (the part that appears in your Azure DevOps URL: https://dev.azure.com/your-organization/).

Remove the InfoPath form customization from a SharePoint list.

Removing the InfoPath customization from a list after having used ‘Customize with InfoPath’ is not always easy, especially during a migration to SharePoint Subscription Edition. Indeed, this latest version no longer includes certain options/menus that allow you to revert to the default list forms for a content type.

To identify a list customized with InfoPath, you can use the following script (https://gist.github.com/jchable/6234bd200eae4109ac77717934d14ea0):

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
 
$WebAppURL="<webapp URL>"
$ReportOutput="<path to output CSV file>"
$ResultColl = @()
 
$WebsColl = Get-SPWebApplication $WebAppURL | Get-SPSite -Limit All | Get-SPWeb -Limit All
 
Foreach($Web in $WebsColl)
{
 Foreach ($List in $web.Lists | Where { 
$_.ContentTypes[0].ResourceFolder.Properties["_ipfs_infopathenabled"]})
    {
            Write-Host "InfoPath Form : $($Web.URL), $($List.Title)"
            $Result = new-object PSObject
            $Result | add-member -membertype NoteProperty -name "Site URL" -Value $web.Url
            $Result | add-member -membertype NoteProperty -name "List Name" -Value $List.Title
            $Result | add-member -membertype NoteProperty -name "List URL" -Value "$($Web.Url)/$($List.RootFolder.Url)"
            $Result | add-member -membertype NoteProperty -name "Template" -Value $list.ContentTypes[0].ResourceFolder.Properties["_ipfs_solutionName"]
            $ResultColl += $Result
    }
}

$ResultColl | Export-csv $ReportOutput -notypeinformation

Or check in SharePoint Designer to see if certain files are present:

Form customization is enabled via the _ipfs_infopathenabled property of the content type and the form URLs.

Here is a script that remove InfoPath customization from the content types of lists in a site (https://gist.github.com/jchable/26b5161dedc4bb42ab2b8bc7563e7ed0):

$web = get-spweb "<web site URL>"
  
function removeCustomInfopathListForms([String]$folderName, [Microsoft.SharePoint.SPContentType]$ct)
{
  write-host Removing custom Infopath list form on $folderName

  # Remove InfoPath customisation
  $ct.ResourceFolder.Properties["_ipfs_infopathenabled"] = "False"
  # Reset default form URL
  $ct.NewFormUrl = ""
	$ct.EditFormUrl = ""
	$ct.DisplayFormUrl = ""
  $ct.ResourceFolder.Update()     
     
	write-host "Liste:" $list.Title "  CT:" $strContentType
     
  $folder = $web.getFolder($folderName)
  write-host Delete files from folder: $folder.Name
     
  # "Delete the InfoPath Form from the server"
  for ($i = $folder.Files.count -1; $i -gt -1; $i--)
  {
       write-host deleting $folder.Files[$i].Name
       $folder.Files[$i].delete()
  }
     
  $web.dispose()
}
  
# Check content type in all lists for InfoPath forms
foreach($list in $web.Lists) { 
    foreach ($ct in $list.ContentTypes){
        if ($ct.ResourceFolder.Properties["_ipfs_infopathenabled"] -eq "True"){
            $strfolderName =$web.url + "/" + $ct.ResourceFolder.URL
            write-host "The following url is using a custom infopath list form:"  $strFolderName                               
            removeCustomInfopathListForms -folderName $strfolderName -ct $ct
        }
    }
}
$web.Dispose()

write-host "Script ended"

[MS Breakfast] Slides de ma session sur le RAG avec Azure AI Studio

Dans le cadre de cette première édition des « Microsoft breakfast » (« Petit-déjeuner Microsoft ») en décembre 2023, qui a été un véritable succès (merci à tous nos partenaires et aux speakers d’exception que sont Sylver SCHORGEN et Mehdi MAHRONG) je vous avais promis mes slides … mais disons que le temps à passer, qu’il a plu ces derniers jours et que j’ai repris les entrainements de trail … bref, j’avais juste complètement zappé et mon copilot ne l’a pas fait pour moi pendant ce temps😅

Alors les voici les slides de la session « MSBreakfast – Azure OpenAI et Microsoft 365 Copilot » :