MCP — Azure CLI integration
You’ve probably heard of Model Context Protocol (MCP), which has recently attracted a lot of attention from the AI community. We will discuss what MCP is and why it is important in this post. Think of MCP as “USB-C for AI integrations,” an open standard that enables consistent connections between AI models and a wide range of applications and data sources. Simply put, MCP eliminates the need for separate adapters or unique code for each software application by allowing an AI assistant to communicate with them all using a standard language. MCP functions similarly to providing your AI assistant with a universal remote control for all of your electronic gadgets and services. Using an AI assistant with external tools without MCP is similar to having a number of appliances, each with its own plug and no universal outlet. Everywhere, developers had to contend with disjointed integrations. Your AI IDE may, for instance, employ one technique to pull code from GitHub, another to retrieve information from a database, and a third to automate a design tool; each of these integrations requires a unique adapter. This is not only time-consuming, but it is also fragile and non-scalable.MCP is based on a client-server architecture, which allows a host programme to communicate with several servers. Three main parts form the framework of the protocol: Host Client Server Before we get into detail on each, here is a high-level summary. MCP Server : The server functions as an internal translator for the app; it may interpret a natural language request (from an AI) and carry out the corresponding action within the app. The functionality (or “services”) of the application is made uniformly available by an MCP server. These adapters are small and lightweight and work with a particular programme or service. The functionality of such programme (its “services”) is made readily accessible via an MCP server. Tool Discovery: They can describe what actions/capabilities the application offers Command parsing: They convert incoming AI instructions into exact API calls or application commands. Response formatting: Involves taking the data, confirmation messages, and other output from the app and formatting it so the AI model can interpret it. Typically, this is done as text or structured data. Error Handling : Handle exceptions and erroneous requests and provide helpful error messages. MCP client: AI assistant includes an MCP client component. This client maintains a 1:1 connection to an MCP server. I have played with Azure CLI MCP Server ,MCP Server that wraps the Azure CLI, adds a nice prompt to improve how it works, and exposes it. It has access to the full Azure CLI, so it can do anything the Azure CLI can do. This MCP server currently only works with the stdio transport, so it should run locally on your machine, using your Azure CLI credentials. This server can run as a Java application or inside a Docker container. Install MCP Claude desktop https://claude.ai/download Install and configure the server with Java Install the Azure CLI: you can do this by following the instructions here (https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) Authenticate to your Azure account. You can do this by running az login in your terminal. Make sure you have Java 17 or higher installed Download azure-cli-mcp https://github.com/jdubois/azure-cli-mcp/releases Download the latest release: gh release download — repo jdubois/azure-cli-mcp — pattern=’azure-cli-mcp.jar’ % gh release download --repo jdubois/azure-cli-mcp --pattern='azure-cli-mcp.jar' To get started with GitHub CLI, please run: gh auth login Alternatively, populate the GH_TOKEN environment variable with a GitHub API authentication token. % gh auth login ? Where do you use GitHub? GitHub.com ? What is your preferred protocol for Git operations on this host? HTTPS ? Authenticate Git with your GitHub credentials? Yes ? How would you like to authenticate GitHub CLI? Login with a web browser ! First copy your one-time code: xxxxxxxx Press Enter to open https://github.com/login/device in your browser... ✓ Authentication complete. - gh config set -h github.com git_protocol https ✓ Configured git protocol ✓ Logged in as xxxxxxxxxxxxx % gh release download --repo jdubois/azure-cli-mcp --pattern='azure-cli-mcp.jar' To use the server from Claude Desktop, add the server to your claude_desktop_config.json file. Please note that you need to point to the location where you downloaded the azure-cli-mcp.jar file. % open ~/Library/Application\ Support/Claude % touch ~/Library/Application\ Support/Claude/claude_desktop_config.json % vi ~/Library/Application\ Support/Claude/claude_desktop_config.json { "mcpServers": { "azure-cli": { "command": "java", "args": [ "-jar", "~/Downloads/azure-cli-mcp.jar" ] } } } Create azure resource group and storage

You’ve probably heard of Model Context Protocol (MCP), which has recently attracted a lot of attention from the AI community.
We will discuss what MCP is and why it is important in this post.
Think of MCP as “USB-C for AI integrations,” an open standard that enables consistent connections between AI models and a wide range of applications and data sources.
Simply put, MCP eliminates the need for separate adapters or unique code for each software application by allowing an AI assistant to communicate with them all using a standard language.
MCP functions similarly to providing your AI assistant with a universal remote control for all of your electronic gadgets and services.
Using an AI assistant with external tools without MCP is similar to having a number of appliances, each with its own plug and no universal outlet. Everywhere, developers had to contend with disjointed integrations. Your AI IDE may, for instance, employ one technique to pull code from GitHub, another to retrieve information from a database, and a third to automate a design tool; each of these integrations requires a unique adapter.
This is not only time-consuming, but it is also fragile and non-scalable.MCP is based on a client-server architecture, which allows a host programme to communicate with several servers.
Three main parts form the framework of the protocol:
- Host
- Client
- Server
Before we get into detail on each, here is a high-level summary.
MCP Server : The server functions as an internal translator for the app; it may interpret a natural language request (from an AI) and carry out the corresponding action within the app.
The functionality (or “services”) of the application is made uniformly available by an MCP server.
These adapters are small and lightweight and work with a particular programme or service. The functionality of such programme (its “services”) is made readily accessible via an MCP server.
Tool Discovery: They can describe what actions/capabilities the application offers
Command parsing: They convert incoming AI instructions into exact API calls or application commands.
Response formatting: Involves taking the data, confirmation messages, and other output from the app and formatting it so the AI model can interpret it. Typically, this is done as text or structured data.
Error Handling : Handle exceptions and erroneous requests and provide helpful error messages.
MCP client: AI assistant includes an MCP client component. This client maintains a 1:1 connection to an MCP server.
I have played with Azure CLI MCP Server ,MCP Server that wraps the Azure CLI, adds a nice prompt to improve how it works, and exposes it.
It has access to the full Azure CLI, so it can do anything the Azure CLI can do. This MCP server currently only works with the stdio transport, so it should run locally on your machine, using your Azure CLI credentials.
This server can run as a Java application or inside a Docker container.
Install MCP Claude desktop
https://claude.ai/download
Install and configure the server with Java
Install the Azure CLI: you can do this by following the instructions here (https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
Authenticate to your Azure account. You can do this by running az login in your terminal.
Make sure you have Java 17 or higher installed
Download azure-cli-mcp
https://github.com/jdubois/azure-cli-mcp/releases
Download the latest release: gh release download — repo jdubois/azure-cli-mcp — pattern=’azure-cli-mcp.jar’
% gh release download --repo jdubois/azure-cli-mcp --pattern='azure-cli-mcp.jar'
To get started with GitHub CLI, please run: gh auth login
Alternatively, populate the GH_TOKEN environment variable with a GitHub API authentication token.
% gh auth login
? Where do you use GitHub? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
! First copy your one-time code: xxxxxxxx
Press Enter to open https://github.com/login/device in your browser...
✓ Authentication complete.
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as xxxxxxxxxxxxx
% gh release download --repo jdubois/azure-cli-mcp --pattern='azure-cli-mcp.jar'
To use the server from Claude Desktop, add the server to your claude_desktop_config.json file. Please note that you need to point to the location where you downloaded the azure-cli-mcp.jar file.
% open ~/Library/Application\ Support/Claude
% touch ~/Library/Application\ Support/Claude/claude_desktop_config.json
% vi ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"azure-cli": {
"command": "java",
"args": [
"-jar",
"~/Downloads/azure-cli-mcp.jar"
]
}
}
}
Create azure resource group and storage blob using using Claude desktop
Open Cluade desktop
Is it Secured : No, This MCP server executes az commands for you; an attacker might use it to execute any other command. The current implementation only supports the stio transport, like the majority of MCP servers now in use. It is designed to operate locally on your computer using your Azure CLI credentials, much like you would if you were doing it yourself.
It is entirely feasible to have this MCP server support the http transport and Azure token authentication in the future, allowing for remote use by various users. The second step will be completed after the SDK and MCP standard are more stable.