AZ

Azure MCP Server for Storage, Cosmos DB, CLI

Access Azure Storage, Cosmos DB, the Azure CLI and more with the MCP server to manage resources, run commands, and streamline cloud workflows.

Quick Install
npx -y @servers/Azure.Mcp.Server

Overview

Azure MCP Server implements the Model Context Protocol (MCP) to bridge AI agents and developer tools with Azure resources. It gives MCP-compatible clients (for example the GitHub Copilot for Azure extension in VS Code) direct, contextual access to Azure services so agents can inspect and act on cloud resources, read and write files, run CLI commands, and help automate cloud workflows.

The server exposes a collection of tools and resource adapters for Azure — including Storage, Cosmos DB, the Azure CLI, Resource Manager, and others — so that agents can perform common tasks safely and with the right permissions. You can run the server locally, in a container, or as part of an IDE integration to streamline development, diagnostics, and automation.

Features

  • Implements the MCP specification to expose Azure context to MCP clients and agents
  • Access to Azure Storage (Blob, File, Queue) and Cosmos DB instances
  • Execute Azure CLI commands programmatically via MCP
  • Integrates with common IDEs (VS Code, Visual Studio, JetBrains, Eclipse)
  • Support for sovereign and commercial Azure cloud endpoints
  • Works with service principal credentials or interactive az login
  • Local-first operation: secrets and tokens remain under your control
  • Enables automation scenarios and agent-driven workflows for provisioning, diagnostics, and data operations

Installation / Configuration

Prerequisites:

  • .NET SDK (if running from source)
  • Docker (optional)
  • Azure CLI (for authentication workflows)

Example: run from source (typical if you build the repository)

# Clone the repo and run the server project
git clone https://github.com/microsoft/mcp.git
cd mcp/servers/Azure.Mcp.Server
dotnet run --project src/Azure.Mcp.Server

Example: build and run with Docker

# Build a local Docker image
docker build -t azure-mcp-server .

# Run the container and expose a local port (adjust as needed)
docker run -p 5000:5000 \
  -e ASPNETCORE_URLS=http://+:5000 \
  -e AZURE_CLIENT_ID=$AZURE_CLIENT_ID \
  -e AZURE_TENANT_ID=$AZURE_TENANT_ID \
  -e AZURE_CLIENT_SECRET=$AZURE_CLIENT_SECRET \
  azure-mcp-server

Authenticate with Azure (interactive)

# Login interactively (recommended for local development)
az login
# Optionally set the subscription to work against
az account set --subscription "SUBSCRIPTION_ID_OR_NAME"

Authenticate with a Service Principal (CI / headless)

# Export service principal credentials (Linux / macOS)
export AZURE_CLIENT_ID="your-client-id"
export AZURE_TENANT_ID="your-tenant-id"
export AZURE_CLIENT_SECRET="your-client-secret"
# Or configure these as environment variables in Docker or your host OS

VS Code: enable autostart (optional)

// in settings.json
"chat.mcp.autostart": "newAndOutdated"

Connecting an MCP client: point your MCP-capable client (IDE extension or tooling) at the server endpoint (for example http://localhost:5000) and follow the client instructions to register or attach the server.

Available Tools / Resources

Common resources surfaced by the Azure MCP Server include:

  • Azure Storage: Blob, File, Queue operations (upload, download, list, delete)
  • Azure Cosmos DB: read/query documents, inspect containers and throughput
  • Azure CLI: run az commands and return structured output
  • Azure Resource Manager: inspect resources, resource groups, deployments
  • Key Vault: read metadata and (with permission) fetch secrets/keys
  • App Service, Functions, SQL, Monitor, and many other Azure service adapters (40+ services supported)

Refer to the repository for the complete, up-to-date list of supported services: https://github.com/microsoft/mcp/tree/main/servers/Azure.Mcp.Server

Use Cases

  • Debugging: Ask an agent to list blobs in a storage container, download a configuration file, and summarize its contents to diagnose issues.
  • Data operations: Agent-driven queries to Cosmos DB to pull a sample of documents and prepare a report or migrate data.
  • DevOps actions: Have an agent run az deployment group create from a prepared template to provision a resource group, then verify deployment status and report back.
  • Automation & scripting: Integrate the MCP server into CI or local automation so agents can orchestrate multi-step tasks (create resources, update configs, rotate keys) while observing permission boundaries.
  • Interactive help in IDE: While editing infrastructure IaC, an MCP-enabled assistant can inspect live resources, validate settings, and propose corrective commands.

Concrete example — list blobs and download one:

# (From an agent using the MCP server) invoke the storage tool to list blobs:
storage.listBlobs --container mycontainer

# Then request download:
storage.downloadBlob --container mycontainer --name logs/latest.log --output ./latest.log

Security and Permissions

  • Principle of least privilege: create and use service principals or role assignments that scope permissions only to the resources agents need.
  • Local-first tokens: the server uses whatever Azure credentials are available on the host (az login or environment variables). Keep these credentials secure.
  • Review actions: agents can execute CLI commands and modify resources. Use approval workflows or limit write-access where needed.

Support and Next Steps

  • See the project repository for source, issues, and contribution guidance: https://github.com/microsoft/mcp/tree/main/servers/Azure.Mcp.Server
  • For interactive IDE usage, install the GitHub Copilot for Azure / MCP extensions for VS Code or other supported IDEs and point them at your