DEV Community

Cover image for How I Gave Claude Code Access to 6,500 Azure Cmdlets
Yoshifumi Tsuda
Yoshifumi Tsuda

Posted on

How I Gave Claude Code Access to 6,500 Azure Cmdlets

TL;DR

I told Claude Code: "Create me a VM on Azure for dev testing." It asked a few questions, ran Az module commands through a persistent PowerShell session, hit a capacity error, but the AI recovered on its own and handed me an SSH command. The whole thing took about 15 minutes — including error recovery and retry.

The secret ingredient? PowerShell.MCP — an MCP server that gives AI agents a persistent PowerShell console.

What is PowerShell.MCP?

PowerShell.MCP is an MCP server that gives AI agents a persistent, shared PowerShell console. One installation provides access to 10,000+ PowerShell modules and any CLI tool. It works with any MCP-compatible AI agent.

The Conversation

Here's what actually happened — errors and all.

Step 1: "Make me a VM"

I gave Claude Code a simple request:

I need a VM on Azure for development testing. Please use the Az PowerShell module to create it.

Instead of guessing, Claude presented an interactive prompt asking me to choose OS, VM size, region, and naming:

Claude presents interactive prompts for OS, VM size, region, and naming

Step 2: Pre-flight Checks

Claude launched a PowerShell console on its own — that's the window on the left side of the screen. From this point on, the AI executes commands directly in that console. I'm not typing these commands; Claude is.

PowerShell console launched by Claude, showing Az module and login verification

It confirmed the Az module was installed and I was already logged in. No unnecessary Connect-AzAccount prompts.

Step 3: Resource Group Creation

Claude creating resource group with traceability tags in PowerShell console

Claude tagged the resource group for traceability — a nice touch I didn't ask for.

Step 4: The Capacity Wall

Here's where it gets interesting. The VM creation failed:

SkuNotAvailable error shown in PowerShell console

Claude didn't panic. It queried available SKUs:

Claude querying available VM SKUs in Japan East region

Then presented me with alternatives. I picked Standard_D2s_v3 (2 vCPU, 8 GB RAM) and it continued seamlessly.

Claude presents alternative VM sizes with descriptions

Step 5: VM Created

Claude built the entire infrastructure from scratch — NSG, VNet, public IP, NIC, and the VM itself:

PowerShell console showing VM infrastructure creation in progress

And presented a clean summary:

Claude presenting VM summary with public IP and SSH command

ssh azureuser@13.78.36.131
Enter fullscreen mode Exit fullscreen mode

Step 6: Cleanup

When I was done testing:

I'm done testing. Delete the resource group to stop all charges.

Claude deleting the resource group after testing

Confirmed the deletion:

Confirm the resource group has been fully deleted.

PowerShell confirming resource group no longer exists

Gone. No orphaned resources, no surprise bills.

Beyond Azure

This demo used Azure, but PowerShell.MCP works with anything on PowerShell Gallery — Microsoft 365, AWS, Active Directory, and 10,000+ other modules. Tell the AI what you want to do; it will find and install the right module on its own.

Why PowerShell.MCP?

  • One gateway, not dozens of MCP servers. The AI finds and installs the right PowerShell modules on its own, and learns cmdlets through Get-Help. No dedicated MCP server needed per service.
  • Shared console. Every command the AI runs appears in your PowerShell console in real-time. You can run your own commands in the same console between AI operations, and respond to cmdlet prompts directly. You learn just by watching.
  • AI handles interactive prompts. When Connect-AzAccount opens a browser for authentication, you sign in — the AI waits and continues where it left off. Workflows that require human intervention don't break.
  • Session persistence. This VM build chained $nsg$vnet$subnet$pip$nic$vmConfig across multiple steps. It worked because variables stayed alive within the session.
  • Pipelines. MCP tools can't be chained together, but cmdlets can. Get-AzComputeResourceSku | Where-Object { ... } handled retrieval and filtering in a single line. The AI translates natural language into efficient pipelines.

How to Set It Up

See the Quick Start guide on GitHub. Once set up, just tell the AI what you want:

Create me a VM on Azure for dev testing.

Wrapping Up

PowerShell.MCP bridges the gap between "I know what I want" and "I know the exact cmdlets, parameters, and sequence to get there." The AI handles the syntax; you make the decisions.

PowerShell is already powerful. PowerShell.MCP gives that power to AI.


PowerShell.MCP is available on the PowerShell Gallery and GitHub.

Top comments (0)