A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jdubois/azure-cli-mcp below:

jdubois/azure-cli-mcp: Talk with Azure using MCP

The Azure CLI MCP Server is an MCP Server that wraps the Azure CLI, adds a nice prompt to improve how it works, and exposes it.

Important

The @Azure organization offers an official Azure MCP server, which uses the code from this Azure CLI MCP server. As it's an official server, maintained by Microsoft, we recommend to use it unless you have specific resource contraints (the Azure CLI MCP Server uses less resources as it does less, and as it can be packaged with GraalVM), or if you're a Java developer and want to tweak the prompts. You can find more details at its Getting started documentation or at the Azure MCP Server repository.

Short 2-minute demo with Claude Desktop

Complete 18-minute demo with VS Code

It has access to the full Azure CLI, so it can do anything the Azure CLI can do. Here are a few scenarios:

As the MCP server is driven by an LLM, we would recommend to be careful and validate the commands it generates. Then, if you're using a good LLM like Claude 3.7 or GPT-4o, which has excellent training data on Azure, our experience has been very good.

Please read our License which states that "THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND", so you use this MCP server at your own risk.

Is it secured, and should I run this on a remote server?

Short answer: NO.

This MCP server runs az commands for you, and could be hacked by an attacker to run any other command. The current implementation, as with most MCP servers at the moment, only works with the stio transport: it's supposed to run locally on your machine, using your Azure CLI credentials, as you would do by yourself.

In the future, it's totally possible to have this MCP server support the http transport, and an Azure token authentication, so that it could be used remotely by different persons. It's a second step, that will be done once the MCP specification and SDK are more stable.

This server can run inside a Docker container or as a Java executable JAR file.

For both options, only the stio transport is available. The http transport will be available later.

Install and configure the server with Docker

Create an Azure Service Principal and set the AZURE_CREDENTIALS environment variable. You can do this by running the following command in your terminal:

az ad sp create-for-rbac --name "azure-cli-mcp" --role contributor --scopes /subscriptions/<your-subscription-id>/resourceGroups/<your-resource-group> --json-auth

This will create a new Service Principal with the specified name and role, and output the credentials in JSON format.

You can then run the server using Docker with the following command. To authenticate, set the AZURE_CREDENTIALS with the output of the previous command.

docker run --rm -p 6273:6273 -e AZURE_CREDENTIALS="{"clientId":"....","clientSecret":"....",...}" -i ghcr.io/jdubois/azure-cli-mcp:latest

To use the server from VS Code:

You can secure the AZURE_CREDENTIALS environment using the methode described in the documentation, here is a complete example:

{
  "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}"
      }
    }
  }
}

To use the server from Claude Desktop, add the server to your claude_desktop_config.json file. The AZURE_CREDENTIALS environment variable should be set to the JSON output from the Service Principal creation, with the quotes escaped.

{
  "mcpServers": {
    "azure-cli": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "AZURE_CREDENTIALS",
        "ghcr.io/jdubois/azure-cli-mcp:latest"
      ],
      "env": {
        "AZURE_CREDENTIALS": "{\"clientId\":\"...\",\"clientSecret\":\"...\",..."
      }
    }
  }
}
Installation with Smithery.ai

You can install the MCP server through Smithery.ai:

This is similar to our Docker container installation above, but runs on Smithery.ai's servers. While this installation is initially the easiest, please note that:

Install and configure the server with Java

This configuration is running the server locally. It's easier to set up than with Docker, but it's less secured as it uses directly your credentials using the Azure CLI configured on your machine.

Binaries are available on the GitHub Release page, here's how you can download the latest one with the GitHub CLI:

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.

{
    "mcpServers": {
        "azure-cli": {
            "command": "java",
            "args": [
                "-jar",
              "~/Downloads/azure-cli-mcp.jar"
            ]
        }
    }
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4