Skip to content

This repository is for development of the Azure MCP Server, bringing the power of Azure to your agents.

License

Notifications You must be signed in to change notification settings

JonathanCrd/azure-mcp

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŸ Azure MCP Server

Install with NPX in VS Code Install with NPX in VS Code Insiders

The Azure MCP Server implements the MCP specification to create a seamless connection between AI agents and key Azure services like Azure Storage, Cosmos DB, and more.

Please note that this project is in Public Preview and implementation may significantly change prior to our General Availability.

๐Ÿ“‘ Table of contents

  1. ๐ŸŽฏ Overview
  2. ๐Ÿ› ๏ธ Currently Supported Tools
  3. ๐Ÿ”Œ Installation & Getting Started
  4. ๐Ÿงช Using Azure MCP Server
  5. ๐Ÿ“ Troubleshooting Issues
  6. ๐Ÿ‘ฅ Contributing to Azure MCP Server

๐ŸŽฏ Overview

โœจ What can you do with the Azure MCP Server?

The Azure MCP Server supercharges your agents with Azure context. Here are some cool prompts you can try:

๐Ÿ” Explore Your Azure Resources

  • "List my Azure storage accounts"
  • "Show me all my Cosmos DB databases"
  • "What indexes do I have in my Azure AI Search service 'mysvc'?"
  • "List my resource groups"
  • "Show me the tables in my Storage account"
  • "List containers in my Cosmos DB database"
  • "Get details about my Storage container"
  • "Get Kusto databases in cluster 'mycluster'"
  • "Sample 10 rows from table 'StormEvents' in Kusto database 'db1'"

๐Ÿ“Š Query & Analyze

  • "Query my Log Analytics workspace"
  • "Let's search this index for 'my search query'"

โš™๏ธ Manage Configuration

  • "List my App Configuration stores"
  • "Show my key-value pairs in App Config"

๐Ÿ”ง Advanced Azure Operations

  • "List my Azure CDN endpoints"
  • "Help me build an Azure application using Node.js"

๐Ÿ” How It Works

The Azure MCP Server creates a seamless integration between AI agents and Azure services through:

  • ๐Ÿ”„ Smart JSON communication that AI agents understand
  • ๐Ÿ—๏ธ Natural language commands that get translated to Azure operations
  • ๐Ÿ’ก Intelligent parameter suggestions and auto-completion
  • โšก Consistent error handling that makes sense

๐Ÿ› ๏ธ Currently Supported Tools

The Azure MCP Server provides tools for interacting with the following Azure services:

๐Ÿ”Ž Azure AI Search (search engine/vector database)

  • List Azure AI Search services
  • List indexes and look at their schema and configuration
  • Query search indexes

๐Ÿ“Š Azure Cosmos DB (NoSQL Databases)

  • List Cosmos DB accounts
  • List and query databases
  • Manage containers and items
  • Execute SQL queries against containers

๐Ÿ˜ Azure Database for PostgreSQL - Flexible Server

  • List and query databases.
  • List and get schema for tables.
  • List, get configuration and get parameters for servers.

๐Ÿงฎ Kusto (Azure Data Explorer)

  • List Kusto clusters
  • List databases in a Kusto cluster
  • List tables in a Kusto database
  • Get schema for a Kusto table
  • Sample rows from a Kusto table
  • Query Kusto databases using KQL

๐Ÿ’พ Azure Storage

  • List Storage accounts
  • Manage blob containers and blobs
  • List and query Storage tables
  • Get container properties and metadata

๐Ÿ“ˆ Azure Monitor (Log Analytics)

  • List Log Analytics workspaces
  • Query logs using KQL
  • List available tables

โš™๏ธ Azure App Configuration

  • List App Configuration stores
  • Manage key-value pairs
  • Handle labeled configurations
  • Lock/unlock configuration settings

๐Ÿ”‘ Azure Key Vault

  • List, create, and get keys

๐Ÿ“ฆ Azure Resource Groups

  • List resource groups

๐ŸšŒ Azure Service Bus

  • Examine properties and runtime information about queues, topics, and subscriptions

๐Ÿ”ง Azure CLI Extension

  • Execute Azure CLI commands directly
  • Support for all Azure CLI functionality
  • JSON output formatting
  • Cross-platform compatibility

๐Ÿš€ Azure Developer CLI (azd) Extension

  • Execute Azure Developer CLI commands directly
  • Support for template discovery, template initialization, provisioning and deployment
  • Cross-platform compatibility

Agents and models can discover and learn best practices and usage guidelines for the azd MCP tool. For more information, see AZD Best Practices.

๐Ÿ›ก๏ธ Azure Best Practices

  • Get secure, production-grade Azure SDK best practices for effective code generation.

For detailed command documentation and examples, see Azure MCP Commands.

๐Ÿ”Œ Getting Started

The Azure MCP Server requires Node.js to install and run the server. If you don't have it installed, follow the instructions here.

VS Code + GitHub Copilot

The Azure MCP Server provides Azure SDK and Azure CLI developer tools. It can be used alone or with the GitHub Copilot for Azure extension in VS Code. If you're interested in broad developer support across a variety of Azure development scenarios not included in the Azure MCP Server, such as searching documentation on Microsoft Learn, we recommend this extension as well.

Prerequisites

  1. Install either the stable or Insiders release of VS Code:
  2. Install the GitHub Copilot and GitHub Copilot Chat extensions
  3. Install Node.js 20 or later
    • Ensure node and npm are in your path
  4. Open VS Code in an empty folder

Installation

โœจ One-Click Install

Click one of these buttons to install the Azure MCP Server for VS Code or VS Code Insiders.

Install with NPX in VS Code Install with NPX in VS Code Insiders

Once you've installed the Azure MCP Server, make sure you select GitHub Copilot Agent Mode and refresh the tools list. To learn more about Agent Mode, visit the VS Code Documentation.

๐Ÿ”ง Manual Install

For a step-by-step installation, follow these instructions:

  1. Add .vscode/mcp.json:
{
  "servers": {
    "Azure MCP Server": {
      "command": "npx",
      "args": [
        "-y",
        "@azure/mcp@latest",
        "server",
        "start"
      ]
    }
  }
}

Docker Install

For a step-by-step installation, follow these instructions:

  1. Clone repository
  2. From repository root, build Docker image: docker build -t azure/azuremcp .
  3. Create an .env file with environment variables that match one of the EnvironmentCredential sets. For example, a .env file using a service principal could look like:
AZURE_TENANT_ID={YOUR_AZURE_TENANT_ID}
AZURE_CLIENT_ID={YOUR_AZURE_CLIENT_ID}
AZURE_CLIENT_SECRET={YOUR_AZURE_CLIENT_SECRET}
  1. Add .vscode/mcp.json or update existing MCP configuration. Replace /full/path/to/.env with a path to your .env file.
{
  "servers": {
    "Azure MCP Server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "azure/azuremcp",
        "--env-file",
        "/full/path/to/.env"
      ]
    }
  }
}

Optionally, customers can use --env or --volume to pass authentication values.

๐Ÿงช Test the Azure MCP Server

  1. Open GitHub Copilot in VS Code and switch to Agent mode
  2. You should see the Azure MCP Server in the list of tools
  3. Try a prompt that tells the agent to use the Azure MCP Server, such as "List my Azure Storage containers"
  4. The agent should be able to use the Azure MCP Server tools to complete your query

๐Ÿค– Custom MCP Clients

You can easily configure your MCP client to use the Azure MCP Server. Have your client run the following command and access it via standard IO or SSE.

Using standard IO

Configure the MCP client to execute: npx -y @azure/mcp@latest server start. For instructions on using VS Code, follow instructions in One-Click Install or Manual Install.

Using SSE

  1. Open a terminal window and execute: npx -y @azure/mcp@latest server start --transport sse
  2. The server starts up and is hosted at: http://localhost:5008. To use another port, append --port {YOUR-PORT-NUMBER}.
  3. Open your MCP client and add the SSE configuration value. This may differ between MCP clients. In VS Code, it will look like:
    {
       "servers": {
         "Azure MCP Server": {
           "type": "sse",
           "url": "http://localhost:5008/sse"
         }
       }
     }

More end-to-end MCP client/agent guides are coming soon!

๐Ÿ“ Troubleshooting

See Troubleshooting guide for help with common issues and logging.

๐Ÿ”‘ Authentication

The Azure MCP Server seamlessly integrates with your host operating system's authentication mechanisms, making it super easy to get started! We use Azure Identity under the hood via DefaultAzureCredential, which tries these credentials in order:

  1. Environment Variables (EnvironmentCredential) - Perfect for CI/CD pipelines
  2. Shared Token Cache (SharedTokenCacheCredential) - Uses cached tokens from other tools
  3. Visual Studio (VisualStudioCredential) - Uses your Visual Studio credentials
  4. Azure CLI (AzureCliCredential) - Uses your existing Azure CLI login
  5. Azure PowerShell (AzurePowerShellCredential) - Uses your Az PowerShell login
  6. Azure Developer CLI (AzureDeveloperCliCredential) - Uses your azd login
  7. Interactive Browser (InteractiveBrowserCredential) - Falls back to browser-based login if needed

If you're already logged in through any of these methods, the Azure MCP Server will automatically use those credentials. Ensure that you have the correct authorization permissions in Azure (e.g. read access to your Storage account) via RBAC (Role-Based Access Control). To learn more about Azure's RBAC authorization system, visit this link.

If you're running into any issues with authentication, visit our troubleshooting guide.

Production Credentials

By default, the Azure MCP Server excludes production credentials like Managed Identity and Workload Identity. To enable these credentials, set the environment variable:

AZURE_MCP_INCLUDE_PRODUCTION_CREDENTIALS=true

This is useful when running on Azure services where you want to use managed identities.

๐Ÿ›ก๏ธ Security Note

Your credentials are always handled securely through the official Azure Identity SDK - we never store or manage tokens directly.

MCP as a phenomenon is very novel and cutting-edge. As with all new technology standards, consider doing a security review to ensure any systems that integrate with MCP servers follow all regulations and standards your system is expected to adhere to. This includes not only the Azure MCP Server, but any MCP client/agent that you choose to implement down to the model provider.

๐Ÿ‘ฅ Contributing

We welcome contributions to the Azure MCP Server! Whether you're fixing bugs, adding new features, or improving documentation, your contributions are welcome.

Please read our Contributing Guide for guidelines on:

  • ๐Ÿ› ๏ธ Setting up your development environment
  • โœจ Adding new commands
  • ๐Ÿ“ Code style and testing requirements
  • ๐Ÿ”„ Making pull requests

๐Ÿค Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

About

This repository is for development of the Azure MCP Server, bringing the power of Azure to your agents.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 49.1%
  • C# 48.4%
  • Bicep 1.0%
  • JavaScript 0.8%
  • CSS 0.4%
  • Shell 0.1%
  • Other 0.2%