How to query Azure DevOps Work items in VS Code

- Updated:

The good news here is that Microsoft is actively working on an MCP (Model-Context-Protocol) server that allows you to communicate directly with your Azure DevOps instance, for example, to retrieve a list of work items. It will bring the power of Azure DevOps directly to your VS Code or Visual Studio.

The challenges with Azure DevOps Authentication

The good news here is that Microsoft is actively working on an MCP (Model-Context-Protocol) server that allows you to communicate directly with your Azure DevOps instance, for example, to retrieve a list of work items. It will bring the power of Azure DevOps directly to your VS Code or Visual Studio.

The challenges with Azure DevOps Authentication

During testing, I encountered the dreaded “Identity not materialized” error, which stems from the MCP server’s heavy reliance on Azure CLI authentication. This creates significant barriers for developers working in corporate environments where:

  • Azure CLI installation is restricted due to security policies
  • Multi-factor authentication blocks automated credential flows
  • The credential chain doesn’t properly recognize Personal Access Tokens
  • Protected environments limit browser-based authentication options

The authentication failure manifests as ChainedTokenCredential authentication failed, leaving developers unable to leverage the MCP server’s powerful Azure DevOps integration capabilities, despite having valid credentials and permissions.

However, there’s hope on the horizon. Microsoft is actively addressing this limitation through Issue #306, which introduces interactive browser authentication as a fallback method. This upcoming enhancement promises to unlock the MCP server’s full potential for enterprise developers who have been locked out due to authentication constraints.

Until then, Azure CLI remains a viable workaround for direct Azure DevOps operations, though it lacks the seamless integration that the MCP server is designed to provide.

Prerequisites before you can query work items

GitHub Copilot, over the past couple of months, has become remarkably intelligent, even though we don’t currently have a working MCP server. It is now possible to query the work items.

You need a couple of things installed:

Install Azure CLI

To install the CLI on Windows or Mac, you can do the following:

# Windows PowerShell
winget install --exact --id Microsoft.AzureCLI

# MacOS
brew update && brew install azure-cli

Linux is a bit more complex, so it’s best to consult the official documentation for that.

Install Azure DevOps CLI

Azure DevOps CLI is not a command line interface of its own; it is an extension to the Azure CLI.

az extension add --name azure-devops

Once you have added the extension, you are ready to query for work items.

Query for Work Items

The first thing you have to do is log in to Azure DevOps. I prefer, even though it sounds stupid, to use an agent for that.

I use the following prompt for that:

Please log in to Azure DevOps Organisation https://<tenant>.visualstudio.com and Project <myfancy project>

The agent, I used Claude Sonnet 4, will come back with something like this.

Screenshot of Github Copilots response
Copilot login to azure devops that actually even fixed my typos

When you then execute the given command, GitHub Copilot opens a dedicated terminal window that it uses and, more importantly, reuses for the upcoming task.

Screenshot of the Github Copilot dedicated Window
Github copilot terminal window

And now we are ready to query the work items with the following prompt.

Query my open Azure DevOps work items assigned to me in the <your project name> project and format the results 
as a clickable list directly in the chat response. Include only active/open work items (exclude closed items).

Include the work item ID, title, state, and type for each item, making them clickable with the Azure DevOps URL.

Also, add quick action links for creating new items and viewing the project board.
Display all results inline without creating any files.

Which then returns the following result.

Screenshot of the GitHub Copilot result
Github copilot output for azure devops work items

Now you are ready to see all open issues directly in your Visual Studio Code.

Prerequisites before you can query work items

Over the past couple of months, GitHub Copilot has become remarkably intelligent, even though we don’t currently have a working MCP server. It is now possible to query the work items.

You need a couple of things installed:

Install Azure CLI

To install the CLI on Windows or Mac, you can do the following:

# Windows PowerShell
winget install --exact --id Microsoft.AzureCLI

# MacOS
brew update && brew install azure-cli

Linux is a bit more complex, so it’s best to consult the official documentation for that.

Install Azure DevOps CLI

Azure DevOps CLI is not a command line interface of its own; it is an extension to the Azure CLI.

az extension add --name azure-devops

Once you have added the extension, you are ready to query for work items.

Query for Work Items

The first thing you have to do is log in to Azure DevOps. I prefer, even though it sounds stupid, to use an agent for that.

I use the following prompt for that:

Please log in to Azure DevOps Organisation https://<tenant>.visualstudio.com and Project <myfancy project>

The agent, I used Claude Sonnet 4, will come back with something like this.

Screenshot of Github Copilots response
Copilot login to azure devops that actually even fixed my typos

When you then execute the given command, GitHub Copilot opens a dedicated terminal window that it uses and, more importantly, reuses for the upcoming task.

Screenshot of the Github Copilot dedicated Window
Github copilot terminal window

And now we are ready to query the work items with the following prompt.

Query my open Azure DevOps work items assigned to me in the <your project name> project and format the results 
as a clickable list directly in the chat response. Include only active/open work items (exclude closed items).

Include the work item ID, title, state, and type for each item, making them clickable with the Azure DevOps URL.

Also, add quick action links for creating new items and viewing the project board.
Display all results inline without creating any files.

Which then returns the following result.

Screenshot of the GitHub Copilot result
Github copilot output for azure devops work items

Now you are ready to see all open issues directly in your Visual Studio Code.

Find more posts in the following categories

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.