Azure Resource Graph MCP Server
The Azure Resource Graph MCP Server allows you to query and analyze Azure resources across multiple subscriptions using Resource Graph queries. With this server, you can:
Query Azure resources: Retrieve resource details like ID, name, type, and location using Kusto Query Language (KQL)
Create custom queries: Filter and search resources by various properties including type, location, and tags
Perform infrastructure auditing: Analyze your Azure environment for compliance, resource inventory, and understanding current state
Work across subscriptions: Query resources spanning multiple Azure subscriptions
Use robust authentication: Connect via Azure CLI, Managed Identity, Visual Studio Code credentials, or environment variables through DefaultAzureCredential
Handle errors: Benefit from built-in handling for initialization failures, query execution errors, and invalid parameters
Uses environment variables loaded from .env files to configure the Azure Resource Graph MCP server, particularly for setting up authentication credentials.
Serves as the runtime environment for the Azure Resource Graph MCP server, allowing it to execute Azure Resource Graph queries from within Cursor IDE or VS Code.
Used for package management and build process for the Azure Resource Graph MCP server.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Azure Resource Graph MCP Server list all virtual machines in my subscription"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Demo

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.
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
Related MCP server: Azure DevOps MCP Server
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:
Clone this repository to your local machine (e.g.,
C:\YOUR_WORKSPACE\azure-resource-graph-mcp-server)Build the project:
npm install
npm run buildOpen Cursor Settings (JSON) and add the following configuration:
{
"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.
Restart Cursor IDE to apply the changes
Option 2: VS Code Integration
To integrate the MCP server with Visual Studio Code:
Clone this repository to your local machine
Build the project:
npm install
npm run buildOpen VS Code Settings (JSON) by pressing
Ctrl+Shift+P, type "Settings (JSON)" and select "Preferences: Open User Settings (JSON)"Add the following configuration:
{
"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.
Save the settings.json file
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
First, make sure you're logged in to Azure CLI by running:
az loginThis step is crucial for local development as the DefaultAzureCredential will automatically use your Azure CLI credentials.
Set up your environment variables:
Copy
.env.exampleto.envUpdate
AZURE_SUBSCRIPTION_IDin.envwith your actual subscription IDOther variables (
AZURE_TENANT_ID,AZURE_CLIENT_ID,AZURE_CLIENT_SECRET) are optional when using Azure CLI authentication
Make sure you have proper Azure credentials configured. The server uses DefaultAzureCredential which supports:
Azure CLI
Managed Identity
Visual Studio Code credentials
Environment variables
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:
Make changes in the
srcdirectoryBuild using
npm run buildTest your changes by running the server
License
This project is licensed under the MIT License. See the LICENSE file for details.
Available Tools
1 toolquery-resourcesB
Retrieves resources and their details from Azure Resource Graph. Use this tool to search, filter, and analyze Azure resources across subscriptions. It supports Kusto Query Language (KQL) for complex queries to find resources by type, location, tags, or properties. Useful for infrastructure auditing, resource inventory, compliance checking, and understanding your Azure environment's current state.
Inputs: subscriptionId, query.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap in purpose. The tool 'query-resources' has a clearly defined and singular function, making it impossible for an agent to confuse it with another tool.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'query-resources' follows a clear verb_noun pattern, and there are no other tools to create inconsistency.
A single tool for an Azure Resource Graph server feels thin and under-scoped. While the tool is powerful, typical MCP servers for cloud resource management offer multiple operations (e.g., list, get, filter, aggregate), making one tool insufficient for comprehensive coverage and likely to limit agent workflows.
The tool surface is severely incomplete for the domain of Azure resource management. It only provides a generic query function, missing essential operations like listing resource types, getting specific resources by ID, aggregating metrics, or managing tags, which are common in such systems and necessary for full agent functionality.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Related MCP Servers
- AlicenseCqualityAmaintenanceA Model Context Protocol server that enables AI assistants to interact with Azure DevOps resources including projects, work items, repositories, pull requests, branches, and pipelines through a standardized protocol.498,058 npm399MIT
- -licenseNot gradedqualityNot gradedmaintenanceA reference server implementation for the Model Context Protocol that enables AI assistants to interact with Azure DevOps resources and perform operations such as project management, work item tracking, repository operations, and code search programmatically.7-
- AlicenseBqualityAmaintenanceA Model Context Protocol server that enables interaction with Microsoft 365 services (Excel, Calendar, Mail, OneDrive, Teams, etc.) through the Graph API, allowing AI assistants to manage Microsoft 365 resources via natural language.20388,164 npm1,132MIT
- AlicenseAqualityBmaintenanceA Model Context Protocol server that provides AI assistants with access to Microsoft Teams, enabling interaction with teams, channels, chats, and organizational data through Microsoft Graph APIs.4191,622 npm151MIT