Azure MCP服务器演示
此存储库演示了如何使用Node.js启动和使用Azure模型上下文协议(MCP)服务器。
先决条件
- Node.js(v14或更高版本)
- Azure CLI(用于身份验证)
入门指南
0.克隆存储库
首先,将此存储库克隆到本地计算机:```sh
git clone
cd
### 0.1在VS代码开发容器中打开
如果您使用的是Visual Studio Code,请在Dev容器中打开预配置开发环境的存储库:
1. 在VS Code中打开文件夹:
- `code `
1. 出现提示时,在开发容器中重新打开(或使用命令选项板: `Dev Containers: Reopen in Container`).
### 1.登录Azure
向您的Azure租户进行身份验证:```sh
az login --tenant
2.启动Azure MCP服务器
您可以使用单个命令启动Azure MCP服务器:```sh
npx -y @azure/mcp@latest server start
或者,如果使用VS Code,请使用提供的 `.vscode/mcp.json` 一键启动的配置。
### 3.探索Azure资源
一旦通过身份验证并且服务器正在运行,您就可以使用MCP服务器与Azure资源进行交互(例如,列出资源组、查询资源等)。
## 项目结构
- `.vscode/mcp.json`:启动Azure MCP服务器的VS代码配置
- `README.md`:此文件
- `MCP-Architecture.png`:架构图(可选)
## Azure MCP服务器提示示例
您可以在GitHub Copilot代理模式或自定义MCP客户端中使用以下提示与Azure资源进行交互:```
List all of the resource groups in my subscription
List all of the storage accounts in my subscription
Get the available tables in my storage accounts
列出资源组的示例输出:```
The following resource groups are available for your subscription:
- DefaultResourceGroup-EUS (Location:
eastus) - rg-testing (Location:
centralus) - rg-azd (Location:
eastus2) - msdocs-sample (Location:
southcentralus) - ai-testing (Location:
eastus2)
Let me know if you need further details or actions related to any of these resource groups!
```
有关更多示例提示和详细信息,请参阅 官方文件.
资源
- Azure MCP文档
- Azure MCP npm包
- 开始使用Azure MCP服务器(Microsoft学习)
许可证
该项目仅用于演示目的。有关许可证的详细信息,请参阅 Azure MCP存储库.
