azure-mcp (server name: "Azure")

An MCP server for Microsoft Azure and Entra ID that gives a model the whole Azure CLI, one command to one tool call, without giving it the keys to everything. Every az command is classified before it runs (src/cli-policy.ts) into read, write or destructive, and each tier sits behind its own operator-controlled gate, so the server starts read-only and a delete needs two settings and an explicit confirm. On top of that come Microsoft's own Azure MCP Server one-to-one (every tool of the pinned @azure/mcp, proxied and gated per command), 105 dedicated tools, tenant profiles so one server can work in several Entra tenants with service principals or your az login, eight MCP Apps views that render inside the chat (tenants, estate, VMs, web apps, costs, resources, security, and an Azure Services explorer), and two ways to run it: local stdio, or remote on Azure Container Apps behind Entra ID where every call runs as the signed-in user.
Quickstart
You need Node.js 20 or later and, for the local lanes, the Azure CLI signed in with az login. With no settings the server uses that sign-in in read-only mode.
Claude Code
As a plugin (a self-contained build in plugin/, no npm install):
/plugin marketplace add patrickking67/azure-mcp
/plugin install azure@azure-mcp
The plugin reads AZURE_MODE, AZURE_ALLOW_DESTRUCTIVE, AZURE_SUBSCRIPTION_ID and AZ_PATH from your shell environment. Unset, it is read-only.
Or from a clone:
git clone https://github.com/patrickking67/azure-mcp.git && cd azure-mcp
npm ci && npm run build
claude mcp add azure --scope user --env AZURE_MODE=read -- node "$(pwd)/dist/index.js"
Claude Desktop (.mcpb)
npm ci
npm run mcpb:pack
Open the resulting azure.mcpb (Settings > Extensions > Install extension). Every setting is optional; Mode and Allow destructive operations are the two gates described under Safety model.
Remote (Azure Container Apps + Entra ID)
# 1. Infrastructure and image (plan first; --apply builds the image inside Azure and verifies the release)
az group create -n rg-azure-mcp -l eastus
cp infra/main.bicepparam.example infra/main.bicepparam # your tenant id
AZ_SUBSCRIPTION=<sub> AZ_RG=rg-azure-mcp npm run deploy:plan # checks + what-if, changes nothing
AZ_SUBSCRIPTION=<sub> AZ_RG=rg-azure-mcp bash scripts/deploy-azure.sh --apply
# 2. Entra app registration (plan first, then --apply), using the outputs of step 1
ENTRA_TENANT_ID=<tenant> PUBLIC_URL=<publicUrl> MI_PRINCIPAL_ID=<identityPrincipalId> bash scripts/entra-setup.sh
# 3. Put the app id in infra/main.bicepparam and run step 1's --apply again
An admin then grants consent and assigns users to the Azure.Read / Azure.Write / Azure.Destructive app roles. Add <publicUrl>/mcp as a custom connector in Claude (or ChatGPT). The full walkthrough, including the Entra app roles and rollback, is in docs/remote.md.
Safety model
The design assumes the model will sometimes be wrong or be talked into something by content it reads (a resource tag, a log line, a web page). The operator decides what is possible; the model only decides what to ask for within that.
Three tiers, two gates, one confirm.
| Tier | What | Needs |
|---|
| Read | List_*, Get_*, Query_*, views, Az_CLI | nothing |
| Write | creates, updates, starts, tags, credential reads | AZURE_MODE=write + confirm: true |
| Destructive | delete, stop, deallocate, restart, resize, purge, regenerate, run code on a machine | AZURE_MODE=write + AZURE_ALLOW_DESTRUCTIVE=true + confirm: true |
- The gates are environment settings the operator sets and the client restarts on. A tool call cannot change them.
- Write tools stay listed in read mode and refuse with a message that names the setting, so a refusal is explainable rather than a missing tool.
Status_Gate reports the current state.
- Remotely, the caller also needs the
Azure.Write or Azure.Destructive Entra app role. The server's gate is the ceiling for everyone; the role narrows it per caller.
- Everything is bounded by the identity's own Azure RBAC and Graph permissions. The server grants nothing.
The Azure CLI is classified, not trusted. Az_CLI runs reads only; Az_CLI_Run runs anything else at the tier its command earns. The classifier reads argv the way the CLI will: