Skip to main content
Glama
Azure Resource Graph MCP Server

Azure Resource Graph MCP Server

by hardik-id

デモ

MCP サーバーデモ

流れ

リクエストフロー

Azure リソース グラフ MCP サーバー

これは、Azure Resource Graph クエリへのアクセスを提供するモデルコンテキストプロトコル (MCP) サーバーです。これにより、Resource Graph クエリを使用して、サブスクリプション全体の Azure リソースに関する情報を取得できます。

特徴

  • Resource Graph クエリを使用して Azure リソースをクエリする

  • デフォルトのクエリはリソースID、名前、タイプ、場所を返します

  • カスタムリソースグラフクエリをサポート

  • 認証にはAzure DefaultAzureCredentialを使用します

Related MCP server: Azure DevOps MCP Server

前提条件

  • Node.jsがインストールされている

  • Azureサブスクリプション

  • Azure CLI がインストールされログインしているか、その他の Azure 資格情報が構成されている

MCPサーバーの実行

MCP サーバーは、Cursor IDE または Visual Studio Code を使用して実行できます。

オプション1: カーソルIDE統合

MCP サーバーを Cursor IDE と統合するには:

  1. このリポジトリをローカル マシンにクローンします (例: C:\YOUR_WORKSPACE\azure-resource-graph-mcp-server )

  2. プロジェクトをビルドします。

npm install
npm run build
  1. カーソル設定 (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"
      },
    }
  }
}

注: ローカル リポジトリの場所と一致するようにパスを更新してください。

  1. 変更を適用するには、カーソル IDE を再起動します。

オプション2: VS Code統合

MCP サーバーを Visual Studio Code と統合するには:

  1. このリポジトリをローカルマシンにクローンします

  2. プロジェクトをビルドします。

npm install
npm run build
  1. Ctrl+Shift+Pを押して VS Code 設定 (JSON) を開き、「設定 (JSON)」と入力して、「設定: ユーザー設定 (JSON) を開く」を選択します。

  2. 次の構成を追加します。

{
    "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"
                },
            }
        }
    }
}

注: ローカル リポジトリの場所と一致するようにパスを更新してください。

  1. 設定.jsonファイルを保存する

  2. 変更を適用するにはVS Codeを再起動してください。

MCP サーバーは、カーソル統合により VS Code 内で使用できるようになります。

使用法

サーバーは次のツールを提供します。

クエリリソース

Azure Resource Graph からリソースとその詳細を取得します。

パラメータ:

  • subscriptionId (オプション): Azure サブスクリプション ID (デフォルトは構成された ID)

  • query (オプション): カスタム リソース グラフ クエリ (デフォルトは「リソース | プロジェクト ID、名前、タイプ、場所」)

環境設定

  1. まず、次のコマンドを実行して、Azure CLI にログインしていることを確認します。

    az login

    DefaultAzureCredential によって Azure CLI 資格情報が自動的に使用されるため、この手順はローカル開発にとって重要です。

  2. 環境変数を設定します。

    • .env.exampleを.envにコピーする

    • .envのAZURE_SUBSCRIPTION_ID実際のサブスクリプション ID に更新します。

    • Azure CLI 認証を使用する場合、その他の変数 ( AZURE_TENANT_ID 、 AZURE_CLIENT_ID 、 AZURE_CLIENT_SECRET ) はオプションです。

  3. 適切なAzure認証情報が設定されていることを確認してください。サーバーはDefaultAzureCredentialを使用しており、以下をサポートしています。

    • Azure CLI

    • マネージドID

    • Visual Studio Code の資格情報

    • 環境変数

  4. 環境変数を使用する場合は、以下を設定します。

    • AZURE_サブスクリプション_ID

    • AZURE_テナント_ID

    • AZURE_クライアントID

    • AZURE_クライアント_シークレット

エラー処理

サーバーには、次の堅牢なエラー処理機能が含まれています。

  • Azure クライアントの初期化エラー

  • クエリ実行エラー

  • 無効なクエリまたはパラメータ

発達

このプロジェクトに取り組むには:

  1. srcディレクトリに変更を加える

  2. npm run buildを使用してビルドする

  3. サーバーを実行して変更をテストします

ライセンス

このプロジェクトはMITライセンスの下で提供されています。詳細はLICENSEファイルをご覧ください。

Available Tools

1 tool
query-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

    B3.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count2/5

    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.

    Completeness2/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      A 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
      -
    • A
      license
      B
      quality
      A
      maintenance
      A 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.
      203
      92,247 npm
      1,163
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A 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.
      4
      19
      1,196 npm
      151
      MIT