Skip to main content
Glama

Azure Resource MCP Server

by tim10002

Azure 资源 MCP 服务器

该 MCP 服务器提供从任何 MCP 客户端直接列出和查询 Azure 资源的工具,让您无需离开工作流程即可高效浏览 Azure 基础架构并分析成本。

这是如何查询 Azure 资源的示例:

这是如何查询 Azure 成本的示例:

特征

  • 📊资源发现- 列出 Azure 订阅中的所有资源

  • 🔍过滤- 按资源组名称过滤资源

  • 💰成本分析- 检索 Azure 订阅的成本信息

  • 🔐安全- 使用您的 Azure 服务主体凭据

  • 🏷️详细视图- 查看所有资源的位置、类型和标签

工具

  • 列出 azure 资源

    • 使用服务主体身份验证列出 Azure 资源组和资源

    • 输入:

      • subscription_id (字符串,可选):要查询的具体订阅 ID。如果未提供,则使用环境变量中的默认订阅。

      • resource_group_filter (字符串,可选):按名称过滤资源组(不区分大小写包含匹配)。

    • 返回:资源组及其资源的格式化 markdown 列表,其中包含位置、类型和标签等详细信息。

  • 获取 Azure 成本

    • 使用 REST API 获取 Azure 订阅的成本分析数据

    • 输入:

      • subscription_id (字符串,可选):要查询的具体订阅 ID。如果未提供,则使用环境变量中的默认订阅。

      • timeframe (字符串,可选):成本分析的时间段。默认值为“MonthToDate”。

    • 返回:带有成本分析数据的格式化降价,包括每日成本和总计。

配置

设置 Azure

  1. 创建用于身份验证的 Azure 服务主体:

az ad sp create-for-rbac --name {service principal name}
  1. 为服务主体分配适当的读取权限

  2. 记下你的 Azure 订阅 ID、租户 ID、客户端 ID 和客户端密钥

  3. 设置所需的环境变量

环境变量

此服务器需要以下环境变量:

# Required Azure authentication AZURE_TENANT_ID=your-tenant-id AZURE_CLIENT_ID=your-client-id AZURE_CLIENT_SECRET=your-client-secret AZURE_SUBSCRIPTION_ID=your-subscription-id

安装

先决条件

  • Python 3.10+

  • 具有适当权限的 Azure 订阅

  • 具有资源读取器访问权限的服务主体

设置

如果您更喜欢使用 uv:

# Setup environment with uv uv venv .venv\Scripts\activate # On Windows source .venv/bin/activate # On macOS/Linux # Install dependencies uv add mcp[cli] azure-identity python-dotenv azure-mgmt-resource aiohttp # Run server uv run -m azure_resource_mcp_server

与 Claude Desktop 一起使用

要与 Claude Desktop 一起使用,请将以下内容添加到您的配置文件中:

{ "mcpServers": { "azure-resource": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/PARENT/FOLDER", "run", "-m", "azure_resource_mcp_server" ], "env": { "AZURE_TENANT_ID": "your-tenant-id", "AZURE_CLIENT_ID": "your-client-id", "AZURE_CLIENT_SECRET": "your-client-secret", "AZURE_SUBSCRIPTION_ID": "your-subscription-id" } } } }
-
security - not tested
F
license - not found
-
quality - not tested

Related MCP Servers

  • -
    security
    A
    license
    -
    quality
    An MCP server that provides access to Azure Data Explorer (ADX) clusters, allowing users to list tables, execute queries, and retrieve schema information.
    Last updated -
    1
    MIT License
  • -
    security
    -
    license
    -
    quality
    An MCP server that wraps the Azure CLI. As LLMs are very good at generating Azure CLI commands, this server allows your LLM to list resources, update/create/delete them, fix errors (by looking at the logs), fix security issues...
    Last updated -
    81
    MIT License
    • Linux
    • Apple
  • A
    security
    A
    license
    A
    quality
    A Model Context Protocol server for querying and analyzing Azure resources at scale using Azure Resource Graph, enabling AI assistants to explore and monitor Azure infrastructure.
    Last updated -
    1
    13
    MIT License
    • Linux
    • Apple
  • -
    security
    A
    license
    -
    quality
    An MCP server for interacting with Azure. Contains some common Compute and Networking actions, and extensible to add many more.
    Last updated -
    1
    Apache 2.0

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tim10002/mcp-azresource'

If you have feedback or need assistance with the MCP directory API, please join our Discord server