Edit

Share via


Get started with the Azure MCP Server using Visual Studio Code

The Azure MCP Server uses the Model Context Protocol (MCP) to standardize integrations between AI apps and external tools and data sources, allowing for AI systems to perform operations that are context-aware of your Azure resources.

In this article, you learn how to complete the following tasks:

  • Install and authenticate to the Azure MCP Server
  • Connect to Azure MCP Server using GitHub Copilot agent mode in Visual Studio Code
  • Run prompts to test Azure MCP Server operations and interact with Azure resources

Prerequisites

Note

The Azure resources you intend to access with Azure MCP Server must already exist within your Azure subscription. Additionally, your user account must have the necessary RBAC roles and permissions assigned for those resources.

Install the Azure MCP Server

Select one of the following options to install the Azure MCP Server in Visual Studio Code:

  1. To install the Azure MCP Server Extension for Visual Studio Code, select the following link:

    Install with NPX in Visual Studio Code

    Tip

    For an optimal Azure MCP Server experience, install GitHub Copilot for Azure, which includes and uses the Azure MCP Server extension. GitHub Copilot for Azure streamlines your development workflow and enhances your productivity on the Azure platform.

  2. After you install the extension, open GitHub Copilot and select Agent Mode. To learn more about Agent Mode, visit the Visual Studio Code Documentation.

  3. Refresh the tools list to see Azure MCP Server as an available option:

    A screenshot showing Azure MCP Server as GitHub Copilot tool.

Use prompts to test the Azure MCP Server

  1. Open GitHub Copilot and select Agent Mode.

  2. Enter a prompt that causes the agent to use Azure MCP Server tools, such as List my Azure resource groups.

  3. In order to authenticate Azure MCP Server, Copilot prompts you to sign-in to Azure using the browser.

    Note

    Copilot won't prompt you to sign-in to Azure if you're already authenticated via other local tooling such as the Azure CLI.

  4. Copilot requests permission to run the necessary Azure MCP Server operation for your prompt. Select Continue or use the arrow to select a more specific behavior:

    • Current session always runs the operation in the current GitHub Copilot Agent Mode session.
    • Current workspace always runs the command for current Visual Studio Code workspace.
    • Always allow sets the operation to always run for any GitHub Copilot Agent Mode session or any Visual Studio Code workspace.

    A screenshot showing the options available to run Azure MCP Server operations.

    The output for the previous prompt should resemble the following text:

    The following resource groups are available for your subscription:
    
    1. **DefaultResourceGroup-EUS** (Location: `eastus`)
    2. **rg-testing** (Location: `centralus`)
    3. **rg-azd** (Location: `eastus2`)
    4. **msdocs-sample** (Location: `southcentralus`)
    14. **ai-testing** (Location: `eastus2`)
    
    Let me know if you need further details or actions related to any of these resource groups!
    
  5. Explore and test the Azure MCP operations using other relevant prompts, such as:

    List all of the storage accounts in my subscription
    Get the available tables in my storage accounts
    

Next steps