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
创建用于身份验证的 Azure 服务主体:
为服务主体分配适当的读取权限
记下你的 Azure 订阅 ID、租户 ID、客户端 ID 和客户端密钥
设置所需的环境变量
环境变量
此服务器需要以下环境变量:
安装
先决条件
Python 3.10+
具有适当权限的 Azure 订阅
具有资源读取器访问权限的服务主体
设置
如果您更喜欢使用 uv:
与 Claude Desktop 一起使用
要与 Claude Desktop 一起使用,请将以下内容添加到您的配置文件中:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
提供直接从任何 MCP 客户端列出和查询 Azure 资源的工具,使您无需离开工作流程即可高效浏览 Azure 基础架构并分析成本。
Related MCP Servers
- -securityAlicense-qualityAn MCP server that provides access to Azure Data Explorer (ADX) clusters, allowing users to list tables, execute queries, and retrieve schema information.Last updated -1MIT License
- -securityAlicense-qualityAn 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 -81MIT License
- AsecurityAlicenseAqualityA 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 -111MIT License
- -securityAlicense-qualityAn MCP server for interacting with Azure. Contains some common Compute and Networking actions, and extensible to add many more.Last updated -1Apache 2.0