Skip to main content
Glama

mcp-azure

CI License: MIT npm

A Model Context Protocol server for Azure (via the Azure Resource Manager API — the programmatic layer behind the Azure Portal). It lets an MCP-capable client (Claude Desktop, Claude Code, Cursor, Codex, …) inventory and operate Azure resources — with a governance layer that keeps an AI agent inside safe boundaries.

What this offers

  • Inventory — list subscriptions, locations, resource groups, and resources; get any resource by ARM id.

  • Operations — create resource groups (in approved regions), merge tags onto any resource, and control VM power state (start / stop / restart / deallocate).

  • Lifecycle — delete resource groups and individual resources, guarded.

  • Governance built in — access modes, subscription/resource-group allowlists, protected resource groups, a location allowlist for new groups, delete gating, typed confirmation for high-impact deletes, dry-run, and JSON audit logging.

Related MCP server: Azure MCP Server

Governance & security model

Concern

Flag

Default

Effect

What can the server do?

AZURE_MODE

read-only

read-only → inventory; read-write → create RG, tag, VM power; admin → deletes. Tools above the mode are never registered.

Which subscriptions?

AZURE_SUBSCRIPTION_ALLOWLIST

(all)

Operations on other subscriptions are refused. For tools taking a resourceId, the subscription is the one in the id.

Which resource groups?

AZURE_RESOURCE_GROUP_ALLOWLIST

(all)

Operations outside the list are refused, and list_resources / list_resource_groups omit resources and groups outside it (a resource whose group cannot be determined is omitted). For tools taking a resourceId, the group is the one in the id (case-insensitive); an optional resourceGroup argument must match it.

Read-only-forever groups

AZURE_PROTECTED_RESOURCE_GROUPS

(none)

Readable, never mutable.

Approved regions

AZURE_LOCATION_ALLOWLIST

(any)

New resource groups may only be created here.

Can it delete?

AZURE_ALLOW_DELETE

false

Deletes need this and admin mode.

Typed confirmation

AZURE_REQUIRE_CONFIRMATION

true

Deletes require confirm to equal the target name — not just a boolean. For delete_resource that name is the final segment of resourceId; a differing resourceName is refused.

Preview

AZURE_DRY_RUN

false

Write/admin tools validate + log intent, then return.

Audit trail

AZURE_AUDIT_LOG

true

JSON line to stderr per guarded operation.

Interactive confirmation

(automatic)

—

Destructive & high-impact actions prompt the human to approve via MCP elicitation before running. The prompt shows the tool, the exact arguments and a fingerprint; the target's version is pinned across the prompt and the action is refused if it changed; a prompt nobody answers is a refusal. delete_resource_group also asks the human to type the group name (this is separate from the model-supplied confirm argument above, which is checked first and still required when AZURE_REQUIRE_CONFIRMATION=true).

Require a human

AZURE_REQUIRE_HUMAN_APPROVAL

false

When true, destructive ops are refused if the client cannot elicit (instead of falling back to the *_ALLOW_* gate alone).

Tools

Read (read-only+): list_subscriptions, list_locations, list_resource_groups, list_resources, get_resource

The three paged listings (list_subscriptions, list_resource_groups, list_resources) return every page up to a 50-page limit. A complete listing is a plain JSON array; if the limit is hit the result is { "truncated": true, "note": …, "items": […] }, so a partial list is never mistaken for a complete one.

Write (read-write+): create_resource_group, tag_resource, control_vm

Admin (admin): delete_resource_group, delete_resource (both need AZURE_ALLOW_DELETE + typed confirm)

Quickstart — add to your agent

Published on npm as @dockndevai/mcp-azure. Runs via npx with an Entra ID service principal. See docs/CLIENTS.md for every client and .env.example for all variables.

Claude Code

claude mcp add azure -e AZURE_TENANT_ID="…" -e AZURE_CLIENT_ID="…" -e AZURE_CLIENT_SECRET="…" -e AZURE_SUBSCRIPTION_ID="…" -e AZURE_MODE="read-only" -- npx -y @dockndevai/mcp-azure

Claude Desktop · Cursor · Windsurf

{
  "mcpServers": {
    "azure": {
      "command": "npx",
      "args": ["-y", "@dockndevai/mcp-azure"],
      "env": {
        "AZURE_TENANT_ID": "…",
        "AZURE_CLIENT_ID": "…",
        "AZURE_CLIENT_SECRET": "…",
        "AZURE_SUBSCRIPTION_ID": "…",
        "AZURE_MODE": "read-only"
      }
    }
  }
}

Example prompts

  • "List all resource groups in my subscription and which region each is in"

  • "Show every resource in the rg-web group"

  • "Tag the app-plan resource with env=prod and owner=team-a" (needs read-write)

  • "Stop the build-agent VM in rg-ci" (needs read-write)

Run from source (development)

npm install
npm run build
node dist/index.js   # with the environment variables set

Develop

npm run dev
npm test          # governance policy: modes, scoping, location allowlist, delete + confirmation
npm run typecheck

Publishing

Ships a server.json for the official MCP registry and an mcpName for npm ownership validation. See PUBLISHING.md.

License

MIT

Available Tools

5 tools
get_resourceGet resourceB
Read-onlyIdempotent

Fetch a resource by its full ARM id. Provide the api-version for the resource type.

Inputs: apiVersion (required), resourceId (required).

list_locationsList locationsC
Read-onlyIdempotent

List the regions available to a subscription.

Inputs: subscription.

list_resource_groupsList resource groupsB
Read-onlyIdempotent

List resource groups in a subscription (filtered by allowlist).

Inputs: subscription.

list_resourcesList resourcesA
Read-onlyIdempotent

List resources in a subscription, or within a specific resource group (filtered by the resource group allowlist; resources in protected groups are flagged).

Inputs: subscription, resourceGroup.

list_subscriptionsList subscriptionsA
Read-onlyIdempotent

List subscriptions the service principal can see (filtered by allowlist).

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct Azure concept: subscriptions, resource groups, locations, resources (list), and a single resource by ARM id. list_resources vs get_resource is clearly separated by filter-based listing versus full-id lookup. No two tools could be plausibly confused.

    Naming Consistency5/5

    All names follow a strict snake_case verb_noun pattern with list_/get_ prefixes (list_resources, get_resource, list_locations, list_resource_groups, list_subscriptions). No stylistic deviations.

    Tool Count4/5

    Five tools is on the thin side but each maps to a necessary inventory operation and none feels redundant. It is well-scoped for a read-only Azure exploration server, though a couple more read operations could be justified.

    Completeness4/5

    The read-only inventory surface covers subscriptions, resource groups, resources (list and get), and regions, which supports the main discovery workflow. Minor gaps remain, such as listing resource types/providers or fetching resource group details, and there are no write operations by design.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers