Azure Resource Graph MCP Server logo

Azure Resource Graph MCP Server

by hardik-id

MCP server enabling AI agents to query and analyze Azure resources at scale via Azure Resource Graph.

Install Azure Resource Graph MCP Server

Run the project’s own setup commands, in order.

Setup steps from the project

hardik-id/azure-resource-graph-mcp-server installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    npm install
    
  2. 2. Install
    npm run build
    
  3. 3. Sign in
    az login
    

Overview

This MCP server allows AI assistants to retrieve and analyze Azure resource information across subscriptions using Azure Resource Graph queries. It supports default and custom queries and authenticates via Azure DefaultAzureCredential, leveraging Azure CLI or other credential methods. Use this server to integrate Azure infrastructure data exploration and monitoring into AI workflows.

Use cases

  • Query Azure resources across subscriptions
  • Retrieve resource details like ID, name, type, and location
  • Run custom Azure Resource Graph queries
  • Integrate Azure resource data into AI assistant workflows

Key features

  • Supports Azure Resource Graph queries with default and custom options
  • Uses Azure DefaultAzureCredential for flexible authentication
  • Provides resource data including ID, name, type, and location
  • Handles query execution and parameter validation errors

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/16 checks healthy over the last 113d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars18Stargazers on the source repository.
Last commit29d agoMost recent push to the default branch.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

Demo

MCP Server Demo

Flow

Request Flow

Azure Resource Graph MCP Server

This is a Model Context Protocol (MCP) server that provides access to Azure Resource Graph queries. It allows you to retrieve information about Azure resources across your subscriptions using Resource Graph queries.

MseeP.ai Security Assessment Badge

Features

  • Query Azure resources using Resource Graph queries
  • Default query returns resource ID, name, type, and location
  • Supports custom Resource Graph queries
  • Uses Azure DefaultAzureCredential for authentication

Prerequisites

  • Node.js installed
  • Azure subscription
  • Azure CLI installed and logged in, or other Azure credentials configured

Running the MCP Server

You can run the MCP server using either Cursor IDE or Visual Studio Code.

Option 1: Cursor IDE Integration

To integrate the MCP server with Cursor IDE:

  1. Clone this repository to your local machine (e.g., C:\YOUR_WORKSPACE\azure-resource-graph-mcp-server)
  2. Build the project:
Terminal
npm install
npm run build
  1. Open Cursor Settings (JSON) and add the following configuration:
config.json
{
  "mcpServers": {
    "azure-resource-graph-mcp-server": {
      "command": "node",
      "args": [
        "C:\\YOUR_WORKSPACE\\azure-resource-graph-mcp-server\\build\\index.js"
      ],
      "env": {
        "SUBSCRIPTION_ID": "xxxxxx-xx-xx-xx-xxxxxx"
      },
    }
  }
}

Note: Make sure to update the path to match your local repository location.

  1. Restart Cursor IDE to apply the changes

Option 2: VS Code Integration

To integrate the MCP server with Visual Studio Code:

  1. Clone this repository to your local machine
  2. Build the project:
Terminal
npm install
npm run build
  1. Open VS Code Settings (JSON) by pressing Ctrl+Shift+P, type "Settings (JSON)" and select "Preferences: Open User Settings (JSON)"
  2. Add the following configuration:
config.json
{
    "mcp": {
        "servers": {
            "azure-resource-graph": {
                "type": "stdio",
                "command": "node",
                "args": [
                    "C:\\YOUR_WORKSPACE\\azure-resource-graph-mcp-server\\build\\index.js"
                ],
                "env": {
                  "SUBSCRIPTION_ID": "xxxxxx-xx-xx-xx-xxxxxx"
                },
            }
        }
    }
}

Note: Make sure to update the path to match your local repository location.

  1. Save the settings.json file
  2. Restart VS Code to apply the changes

The MCP server will now be available to use within VS Code with cursor integration.

Usage

The server provides the following tool:

query-resources

Retrieves resources and their details from Azure Resource Graph.

Parameters:

  • subscriptionId (optional): Azure subscription ID (defaults to configured ID)
  • query (optional): Custom Resource Graph query (defaults to "Resources | project id, name, type, location")

Environment Setup

  1. First, make sure you're logged in to Azure CLI by running:

    bash
    az login
    

    This step is crucial for local development as the DefaultAzureCredential will automatically use your Azure CLI credentials.

  2. Set up your environment variables:

    • Copy .env.example to .env
    • Update AZURE_SUBSCRIPTION_ID in .env with your actual subscription ID
    • Other variables (AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET) are optional when using Azure CLI authentication
  3. Make sure you have proper Azure credentials configured. The server uses DefaultAzureCredential which supports:

    • Azure CLI
    • Managed Identity
    • Visual Studio Code credentials
    • Environment variables
  4. If using environment variables, set up:

    • AZURE_SUBSCRIPTION_ID
    • AZURE_TENANT_ID
    • AZURE_CLIENT_ID
    • AZURE_CLIENT_SECRET

Error Handling

The server includes robust error handling for:

  • Azure client initialization failures
  • Query execution errors
  • Invalid queries or parameters

Development

To work on this project:

  1. Make changes in the src directory
  2. Build using npm run build
  3. Test your changes by running the server

License

This project is licensed under the MIT License. See the LICENSE file for details.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Azure Resource Graph MCP Server

It uses Azure DefaultAzureCredential, supporting Azure CLI login, managed identities, Visual Studio Code credentials, and environment variables.

Set the subscription ID via the SUBSCRIPTION_ID environment variable or pass it as a parameter in queries.

Yes, the server accepts custom Resource Graph queries as input parameters.

At minimum, SUBSCRIPTION_ID or AZURE_SUBSCRIPTION_ID is required; AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET are optional depending on authentication method.

Clone the repo, run npm install and npm run build, then start the server with Node.js specifying the built index.js file.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewAzure Resource Graph MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/hardik-id-azure-resource-graph-mcp-server?style=directory)](https://allmcps.com/mcp/hardik-id-azure-resource-graph-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/hardik-id-azure-resource-graph-mcp-server"><img src="https://allmcps.com/api/badge/hardik-id-azure-resource-graph-mcp-server?style=directory" alt="Azure Resource Graph MCP Server on AllMCPs" /></a>