Get the FREE Ultimate OpenClaw Setup Guide →

azure-resource-graph

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio hardik-id-azure-resource-graph-mcp-server node build/index.js \
  --env SUBSCRIPTION_ID="xxxxxx-xx-xx-xx-xxxxxx"

How to use

This MCP server provides access to Azure Resource Graph queries. It runs as a Node.js-based MCP service that uses the Azure DefaultAzureCredential for authentication, enabling you to run Resource Graph queries across your Azure subscriptions. The server exposes a tool named query-resources which retrieves details about Azure resources, such as resource IDs, names, types, and locations. You can supply a custom Resource Graph query to tailor the results. The default query returns essential fields and can be overridden via the query parameter when invoking the tool.

How to install

Prerequisites:

  • Node.js and npm installed
  • Access to an Azure subscription (with credentials available via Azure CLI or environment variables)

Installation steps:

  1. Clone the repository to your local machine
  2. Install dependencies and build the project:
npm install
npm run build
  1. Ensure you have Azure credentials available. The server uses DefaultAzureCredential, which can leverage Azure CLI, managed identity, VS Code credentials, or environment variables.
  2. Configure environment variables if needed (see below) and run the server using the configuration example in your MCP editor (Cursor or VS Code) that points to build/index.js.

Environment variables (optional but supported):

  • SUBSCRIPTION_ID: Your Azure subscription ID (default used if not provided in code)
  • AZURE_SUBSCRIPTION_ID, AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET: Credentials if using non-CLI authentication

Usage in MCP clients (Cursor or VS Code) will reference the built entry point at build/index.js as shown in the example configuration.

Additional notes

Notes and tips:

  • The server uses DefaultAzureCredential, so it can authenticate via Azure CLI cache, managed identity, or explicit environment variables. Ensure you have az login or appropriate service principal credentials when running locally.
  • If you change the subscription context, update SUBSCRIPTION_ID accordingly in your MCP configuration or environment.
  • The example configurations in the README show how to integrate with Cursor IDE and VS Code. Replace the placeholder paths with your actual local paths where the repository is built.
  • When building, ensure you run npm install before npm run build to install dependencies.
  • If you encounter connection or authentication errors, verify that your environment can access Azure resources and that the credentials provided have the necessary permissions for Resource Graph queries.

Related MCP Servers

Sponsor this space

Reach thousands of developers