Azure Resource Graph MCP Server

Azure Resource Graph MCP Server

MCP server for querying Azure Resource Graph across subscriptions

13
Stars
7
Forks
13
Watchers
1
Issues
Azure Resource Graph MCP Server enables users to perform Azure Resource Graph queries via the Model Context Protocol, offering seamless access to Azure resource information across multiple subscriptions. It supports both default and custom queries and integrates with development environments like Cursor IDE and Visual Studio Code. The server authenticates using Azure credentials and facilitates efficient retrieval of resource details such as resource ID, name, type, and location.

Key Features

Supports Azure Resource Graph queries
Exposes MCP server interface
Integration with Cursor IDE and Visual Studio Code
Custom and default queries for Azure resources
Authentication using Azure DefaultAzureCredential
Returns resource ID, name, type, and location
Environment variable configuration for credentials
Security assessment badge integration
Stdio protocol support
Guided setup for local development

Use Cases

Querying Azure resources across multiple subscriptions
Integrating Azure Resource Graph queries into AI-assisted development tools
Automating cloud infrastructure audits
Custom reporting on Azure resource inventory
Enhancing cloud governance workflows
Embedding resource data access in DevOps pipelines
Rapid troubleshooting of Azure environments
Enabling secure and credentialed cloud data access in local tooling
Developing AI assistants for Azure cloud management
Simplifying management and monitoring of cloud assets

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:
bash
npm install
npm run build
  1. Open Cursor Settings (JSON) and add the following configuration:
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:
bash
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:
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.

Star History

Star History Chart

Repository Owner

hardik-id
hardik-id

User

Repository Details

Language TypeScript
Default Branch main
Size 960 KB
Contributors 2
License MIT License
MCP Verified Nov 11, 2025

Programming Languages

TypeScript
91.58%
Dockerfile
8.42%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Azure MCP Server

    Azure MCP Server

    Connect AI agents with Azure services through Model Context Protocol.

    Azure MCP Server provides a seamless interface between AI agents and Azure services by implementing the Model Context Protocol (MCP) specification. It enables integration with tools like GitHub Copilot for Azure and supports a wide range of Azure resource management tasks directly via conversational AI interfaces. Designed for extensibility and compatibility, it offers enhanced contextual capabilities for agents working with Azure environments.

    • 1,178
    • MCP
    • Azure/azure-mcp
  • Azure DevOps MCP Server

    Azure DevOps MCP Server

    Standardized AI access to Azure DevOps via Model Context Protocol.

    Implements the Model Context Protocol (MCP) to enable AI assistants to securely and efficiently interact with Azure DevOps resources. Provides a standardized bridge for managing projects, work items, repositories, pull requests, and pipelines through natural language interfaces. Supports modular authentication and a feature-based architecture for scalability and integration. Facilitates seamless integration with AI tools such as Claude Desktop and Cursor AI.

    • 306
    • MCP
    • Tiberriver256/mcp-server-azure-devops
  • Azure Data Explorer MCP Server

    Azure Data Explorer MCP Server

    Enables AI assistants to query and analyze Azure Data Explorer using the Model Context Protocol.

    Azure Data Explorer MCP Server provides standardized MCP interfaces for AI assistants to execute KQL queries and interact with Azure Data Explorer (ADX/Kusto) databases. It supports secure authentication methods, database discovery, and delivers structured results in JSON format. Multiple deployment options, including Docker and various transports, enable flexible integration into development or production environments.

    • 49
    • MCP
    • pab1it0/adx-mcp-server
  • Firefly MCP Server

    Firefly MCP Server

    Seamless resource discovery and codification for Cloud and SaaS with Model Context Protocol integration.

    Firefly MCP Server is a TypeScript-based server implementing the Model Context Protocol to enable integration with the Firefly platform for discovering and managing resources across Cloud and SaaS accounts. It supports secure authentication, resource codification into infrastructure as code, and easy integration with tools such as Claude and Cursor. The server can be configured via environment variables or command line and communicates using standardized MCP interfaces. Its features facilitate automation and codification workflows for cloud resource management.

    • 15
    • MCP
    • gofireflyio/firefly-mcp
  • RAD Security MCP Server

    RAD Security MCP Server

    AI-powered security insights for Kubernetes and cloud environments via the Model Context Protocol.

    RAD Security MCP Server is an implementation of the Model Context Protocol designed to deliver AI-powered security insights and operations for Kubernetes and cloud platforms. It serves as an MCP server for RAD Security, providing a range of toolkits for container, cluster, identity, audit, and threat management. The server is easily configurable via environment variables, allowing for flexible toolkit activation and authentication options. Multiple deployment options are supported, including Node.js, Docker, and integration with development environments like Cursor IDE and Claude Desktop.

    • 5
    • MCP
    • rad-security/mcp-server
  • EntraID MCP Server (Microsoft Graph FastMCP)

    EntraID MCP Server (Microsoft Graph FastMCP)

    A modular FastMCP server for managing Microsoft Graph resources with advanced context and security.

    EntraID MCP Server provides a modular, resource-oriented implementation of a FastMCP server tailored for Microsoft Graph API interactions. It supports advanced operations across users, groups, applications, service principals, MFA, and sign-in logs, offering extensibility and strong security practices. Resource modules use a centralized authentication client, while comprehensive permission management, consistent context handling, error reporting, and logging are built in. The tool is designed for ease of development and extensibility, supporting standardized model context protocols.

    • 29
    • MCP
    • hieuttmmo/entraid-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results