使用说明

项目简介

Azure MCP Server 是一个基于 Model Context Protocol (MCP) 构建的后端服务,旨在桥接 LLM 客户端(如 Claude Desktop)与 Microsoft Azure 云平台。它允许 LLM 通过标准化的 MCP 协议调用预定义的工具,从而实现对 Azure 资源的查询、管理和操作。

主要功能点

  • Azure 资源管理:提供工具与 Azure Resource Management 客户端交互,管理 Azure 资源。
  • 订阅和租户管理:支持列出和选择 Azure 订阅和租户。
  • 自动身份验证:利用 DefaultAzureCredential 实现灵活的身份验证方式,支持多种 Azure 身份验证方法。
  • 错误处理和重试:具备完善的错误处理机制和重试逻辑,提高服务器的稳定性。
  • 结构化响应:返回符合 Claude Desktop 客户端要求的格式化 JSON 响应。

安装步骤

  1. 克隆仓库
    git clone https://github.com/Streen9/azure-mcp.git
  2. 进入目录
    cd azure-mcp
  3. 安装依赖
    npm install

服务器配置

  • 在 MCP 客户端(如 Claude Desktop)的配置文件中,添加以下服务器配置信息:
    {
      "server name": "azure",
      "command": "tsx",
      "args": [
        "C:/Users/[YourUsername]/path/to/azure-mcp/src/launcher.ts"  // 请替换为 azure-mcp 仓库中 launcher.ts 文件的实际路径
      ]
    }
    • 'server name': 服务器的名称,例如 "azure",客户端使用此名称引用服务器。
    • 'command': 启动服务器的命令,这里使用 'tsx' (ts-node-esm 的快速替代品,用于运行 TypeScript 代码)。请确保已安装 'tsx' 或将其替换为 'node' 和 'ts-node-esm'。
    • 'args': 传递给启动命令的参数,这里指定了 'launcher.ts' 文件的路径。请务必将 'C:/Users/[YourUsername]/path/to/azure-mcp/src/launcher.ts' 替换为实际的 'launcher.ts' 文件路径。

基本使用方法

  1. 确保已安装 Node.js (v18 或更高版本)Claude Desktop 客户端。
  2. 按照安装步骤配置并启动 Azure MCP Server。
  3. 启动 Claude Desktop 客户端。
  4. 在 Claude Desktop 中,即可通过自然语言指令,例如 "Can you get all the available Azure accounts and subscriptions?" 或 "List all resource groups in my subscription",与 Azure 云服务进行交互。Claude 将调用 Azure MCP Server 提供的工具来执行 Azure 操作并返回结果。

信息

分类

商业系统