适用于 Claude Desktop 的 Azure MCP(模型上下文协议)
模型上下文协议 (MCP) 实现,使 Claude Desktop 能够与 Azure 服务交互。此集成允许 Claude 直接通过自然语言对话查询和管理 Azure 资源。
特征
Azure 资源管理:与 Azure 资源管理客户端接口
订阅管理:列出和管理 Azure 订阅
租户管理:列出并选择 Azure 租户
自动身份验证:利用 DefaultAzureCredential 实现灵活的身份验证方法
错误处理:强大的错误处理功能,可重试瞬时故障
清洁响应格式:与 Claude Desktop 兼容的正确格式的响应
先决条件
Node.js(v18 或更高版本)
Claude 桌面应用程序
具有适当权限的 Azure 帐户
Azure CLI(可选,用于基于 CLI 的身份验证)
安装
手动安装
克隆存储库:
安装依赖项:
配置Claude桌面:
打开
claude_desktop_config.json
添加以下 MCP 配置:
验证
服务器通过DefaultAzureCredential支持多种身份验证方法:
环境变量
托管标识
Azure CLI
Visual Studio 代码
交互式浏览器
服务器将自动按顺序尝试这些方法,直到成功为止。
用法
如果 Claude Desktop 正在运行,请关闭它(检查任务管理器)
启动 Claude Desktop
在聊天中,您现在可以询问与 Azure 相关的问题,例如:
“您能获得所有可用的 Azure 帐户和订阅吗?”
“列出我的订阅中的所有资源组”
“显示特定资源组中的所有虚拟机”
对话示例
发展
项目结构
关键组件
AzureMCPServer :实现 MCP 协议的主服务器类
HandleCallTool :处理传入的工具请求
ExecuteWithRetry :实现弹性操作的重试逻辑
故障排除
身份验证问题:
确保您已通过 Azure CLI (
az login
) 登录如果使用服务主体,请检查环境变量
验证 Azure 帐户是否具有必要的权限
连接问题:
验证 Claude Desktop 配置
检查配置文件中的路径是否符合您的安装
确保没有其他实例正在运行
常见错误:
NO_TENANT
:使用“select-tenant”工具选择租户NO_CLIENTS
:确保正确的初始化和身份验证CODE_EXECUTION_FAILED
:检查 Azure 权限和连接
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
贡献者
@calclavia——与 smithery.ai 集成
致谢
Claude Desktop 团队负责 MCP 实施
Azure SDK 团队提供全面的 SDK
用于实现 AI 服务集成的模型上下文协议
安全说明
此实现遵循 Azure 安全最佳实践:
没有硬编码凭证
安全凭证链实施
正确的错误处理和清理
对于安全问题或漏洞,请创建问题。
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.
Tools
通过 Claude Desktop 实现与 Azure 服务的自然语言交互,支持资源管理、订阅处理和租户选择以及安全身份验证。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityLets you use Claude Desktop, or any MCP Client, to use natural language to accomplish things on your Cloudflare account.Last updated -21,1862,949Apache 2.0
- -securityFlicense-qualityIntegrates Claude Desktop with Azure AI Search, allowing users to query search indexes using keyword, vector, or hybrid search methods.Last updated -52
- AsecurityFlicenseAqualityEnables managing Google Cloud Platform resources through natural language commands in Claude Desktop, supporting comprehensive operations across compute, storage, databases, networking, monitoring, and IAM without manual credential setup.Last updated -5621
- -securityAlicense-qualityEnables management of Azure Cloud PCs using the Microsoft Graph API, allowing users to list available Cloud PCs in their tenant through Claude Desktop.Last updated -MIT License