HI

hardik-id/azure-resource-graph-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

18 stars 8 forks 质量 85 趋势 42MIT

提供Azure资源图查询访问的模型上下文协议(MCP)服务器. 它允许您在订阅时使用资源图获取关于 Azure 资源的信息...

概览

这是一个模式背景协议(MCP)服务器,提供对Azure资源图查询的访问. 它允许您在订阅时使用资源图表查询获取 Azure 资源的信息 。 - 使用资源图查询查询Azure资源 - 默认查询返回资源ID、名称、类型和位置 - 支持自定义资源图查询 - 使用 Azure 默认Azure证书进行认证 - 节点.js安装 - Azure订阅 - Azure CLI安装和登录,或配置其他Azure证书 您可以使用 Cursor IDE 或 Visual Studio 代码运行 MCP 服务器 。 要将 MCP 服务器与 Cursor IDE 集成 : 1. 将此寄存器切入您的本地机器( 如 C:\YOUR WORKSPACE\azure-resource-graph-mcp-server) 2. 构建工程 : 3. 打开光标设置(JSON)并添加以下配置: : 确保更新路径以匹配您的本地仓库位置 .

概述(AI 翻译)

流动

Azure 资源图 MCP 服务器

这是一个模式背景协议(MCP)服务器,提供对Azure资源图查询的访问. 它允许您在订阅时使用资源图表查询获取 Azure 资源的信息 。

□ 特性

  • 利用资源图查询查询Azure资源
  • 默认查询返回资源ID、名称、类型和位置
  • 支持自定义资源图表查询
  • 使用Azure默认验证证书进行认证

□ 先决条件

  • 安装了节点.js
  • Azure订阅
  • 安装和登录Azure CLI,或配置其他Azure证书

□ 运行 MCP 服务器

您可以使用 Cursor IDE 或 Visual Studio 代码运行 MCP 服务器 。

· 选项1: 光标 IDE 集成

要将 MCP 服务器与 Cursor IDE 集成 :

  1. 将此存储器切入您的本地机器( 例如 C:\YOUR_WORKSPACE\azure-resource-graph-mcp-server)

  2. 建设项目:

  3. 打开光标设置(JSON)并添加以下配置:

** 注**: 确保更新路径以匹配您的本地仓库位置 。

  1. 重新启动光标 IDE 应用更改

备选2:VS代码整合

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

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

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:
npm install
npm run build
  1. Open 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.

  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:
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:
{
    "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

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

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