A wrapper around the Azure CLI command line that allows you to talk directly to Azure
Harness the full potential of the Azure CLI within your LLM applications using this Model Context Protocol (MCP) server. Seamlessly integrate Azure management into your AI workflows, enabling intelligent automation and insightful analysis.
This MCP server unlocks the complete functionality of the Azure CLI, empowering you to:
While this MCP server offers immense power, it's crucial to exercise caution. Always validate the commands generated by the LLM before execution. Leverage advanced LLMs like Claude 3.7 or GPT-4o, known for their robust Azure training data, to minimize potential errors.
Important: This MCP server is designed for local execution only. Do not deploy it on a remote server.
The server executes az
commands on your behalf and could be exploited by malicious actors if exposed to external networks. The current implementation utilizes the stio
transport, intended for local operation with your existing Azure CLI credentials.
Future iterations may incorporate http
transport and Azure token authentication for secure remote access, pending further stabilization of the MCP specification and SDK.
Choose the installation method that best suits your environment: Docker container or Java executable JAR file. Both options currently support the stio
transport.
Create an Azure Service Principal:
az ad sp create-for-rbac --name "azure-cli-mcp" --role contributor --scopes /subscriptions/<your-subscription-id>/resourceGroups/<your-resource-group> --json-auth
Replace <your-subscription-id>
and <your-resource-group>
with your actual Azure subscription and resource group details.
Run the Docker Container:
docker run --rm -p 6273:6273 -e AZURE_CREDENTIALS="{"clientId":"....","clientSecret":"....",...}" -i ghcr.io/jdubois/azure-cli-mcp:latest
Set the AZURE_CREDENTIALS
environment variable with the JSON output from the Service Principal creation.
MCP: Add Server...
).
stio
transport.docker run -i --rm -e AZURE_CREDENTIALS ghcr.io/jdubois/azure-cli-mcp:latest
.AZURE_CREDENTIALS
environment variable using VS Code's input mechanism (see example below).Agent
mode in GitHub Copilot.azure-cli-mcp
server is listed as a tool in the chat window.Securely Configuring AZURE_CREDENTIALS
in VS Code:
{ "inputs": [ { "type": "promptString", "id": "azure-credentials", "description": "Azure Credentials", "password": true } ], "servers": { "azure-cli": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "AZURE_CREDENTIALS", "ghcr.io/jdubois/azure-cli-mcp:latest" ], "env": { "AZURE_CREDENTIALS": "${input:azure-credentials}" } } } }
Add the server configuration to your claude_desktop_config.json
file:
{ "mcpServers": { "azure-cli": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "AZURE_CREDENTIALS", "ghcr.io/jdubois/azure-cli-mcp:latest" ], "env": { "AZURE_CREDENTIALS": "{\"clientId\":\"...\",\"clientSecret\":\"...\",..." } } } }
Install the Azure CLI: Follow the instructions here.
Authenticate to Azure: Run az login
in your terminal.
Install Java 17 or higher: Verify with java -version
.
Download the JAR file: Obtain the latest release from the GitHub Release page using the GitHub CLI:
gh release download --repo jdubois/azure-cli-mcp --pattern='azure-cli-mcp.jar'
MCP: Add Server...
).
stio
transport.java -jar ~/Downloads/azure-cli-mcp.jar
(adjust the path to your downloaded JAR file).Agent
mode in GitHub Copilot.azure-cli-mcp
server is listed as a tool in the chat window.Add the server configuration to your claude_desktop_config.json
file:
{ "mcpServers": { "azure-cli": { "command": "java", "args": [ "-jar", "~/Downloads/azure-cli-mcp.jar" ] } } }
Install the MCP server directly through Smithery.ai:
Important Considerations:
AZURE_CREDENTIALS
key to Smithery.ai.๐ A gateway demo for MCP SSE Server.
๐ โ๏ธ A lightweight mcp server that tells you exactly what time is it.
#๏ธโฃ ๐ A C# SDK for building MCP servers on .NET 9 with NativeAOT compatibility โก ๐
โ Java SDK for building MCP servers using Quarkus.