Edit

Share via


Quickstart: Integrate Azure MCP Server with GitHub Copilot CLI

In this quickstart, you learn how to connect the Azure Model Context Protocol (MCP) Server to the GitHub Copilot CLI. This integration allows GitHub Copilot to interact with your Azure resources directly from your terminal.

Prerequisites

Sign in to Azure MCP Server for local development

Azure MCP Server authenticates to Microsoft Entra ID using the Azure Identity library for .NET. The server supports two authentication modes:

  • Broker mode: Uses your operating system's native authentication (like Windows Web Account Manager) with InteractiveBrowserCredential.
  • Credential chain mode: Tries multiple authentication methods in sequence: environment variables, Visual Studio Code, Visual Studio, Azure CLI, Azure PowerShell, Azure Developer CLI, and interactive browser authentication.

Sign in using any of these methods:

  1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac).
  2. Run Azure: Sign In and follow the prompts.

After signing in, Azure MCP Server can authenticate and run operations on Azure services based on your permissions.

Add Azure MCP Server

The GitHub Copilot CLI supports MCP servers through the /mcp command family.

  1. Open your terminal.

  2. Start the GitHub Copilot CLI in interactive mode:

    copilot
    
  3. In the interactive session, run the following command to open the MCP server configuration form:

    /mcp add
    
  4. Fill in the configuration fields with the following values:

    Field Value
    Server Name azure-mcp
    Server Type 1 (Local)
    Command npx -y @azure/mcp@latest server start
    Environment Variables (leave blank - utilizes Azure CLI authentication)
    Tools *

    Note

    If you prefer using .NET, set the Command to dotnet dnx -p Azure.Mcp server start.

  5. Press Ctrl+S (or Cmd+S on macOS) to save the server configuration.

  6. When you've finished, press esc to close the server configuration.

Verify the connection

Confirm that you configured the Azure MCP Server correctly and that the GitHub Copilot CLI recognizes it:

  1. In your Copilot CLI session, run:

    /mcp show
    
  2. Review the output. You should see azure-mcp listed in the configuration:

    ● MCP Server Configuration:
      • azure-mcp (local): Command: npx
    
    Total servers: 1
    Config file: ~/.copilot/mcp-config.json
    

Use Azure MCP Server

Once connected, you can use natural language to interact with your Azure resources.

  1. In the GitHub Copilot CLI session, type a prompt that requires Azure context. For example:

    > List my Azure resource groups.
    
  2. GitHub Copilot identifies the intent and uses the azure-mcp tools to fetch the information. It prints a response listing your Azure resource groups, similar to:

    I found the following resource groups in your subscription:
    
    - **my-resource-group-1** (East US)
    - **dev-environment** (West Europe)
    - **production-app** (Central US)
    

Manage MCP servers

Manage your configured MCP servers using the following commands:

  • List servers: /mcp show
  • Remove a server: /mcp remove azure-mcp
  • Get help: /mcp help

Next steps