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.
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:
- Clone the repository to your local machine
- Install dependencies and build the project:
npm install
npm run build
- Ensure you have Azure credentials available. The server uses DefaultAzureCredential, which can leverage Azure CLI, managed identity, VS Code credentials, or environment variables.
- 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
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud