本文帮助你开始在 Microsoft Foundry 中使用 Microsoft Learn 模型上下文协议 (MCP) 服务器。 了解 MCP 服务器可通过多种方式使用。 常见方案是将 Learn MCP Server 添加到 VS Code、Visual Studio、GitHub.com 等代理开发环境,如 “入门”中所述。 本文介绍如何在自定义解决方案中使用 Learn MCP Server,并将 Microsoft Foundry 与代理、语言模型、MCP 服务器和说明结合使用。 Copilot Studio 中存在类似的概念。
我们通过的高层次过程是:
- 创建资源
- 创建代理
先决条件
若要遵循本文中的步骤,需要一个 Azure 订阅和一个 Foundry 实例。
创建资源
配置 Foundry 的最简单方法是使用 门户。 看到可以使用新的 Foundry 门户体验的选项时,应该选择使用它。
- 单击顶部导航中的“发现”
- 在左侧导航中选择模型
- 选择模型,例如 gpt-4.1-mini
- 单击“部署”,默认设置
有关详细信息,请参阅 Microsoft Foundry 快速入门
创建代理
如果刚刚部署了模型,可以直接登录代理详细信息视图并跳过一些步骤
- 单击顶部导航中的“生成”
- 在左侧导航中选择代理
- 单击“创建代理”按钮
- 输入代理名称,然后单击“创建”
- 选择已部署的模型
- 输入说明:
You have access to MCP tools called `microsoft_docs_search`, `microsoft_docs_fetch`, and `microsoft_code_sample_search` - these tools allow you to search through and fetch Microsoft's latest official documentation and code samples, and that information might be more detailed or newer than what's in your training data set.
When handling questions around how to work with native Microsoft technologies, such as C#, F#, ASP.NET Core, Microsoft.Extensions, NuGet, Entity Framework, the `dotnet` runtime - please use these tools for research purposes when dealing with specific / narrowly defined questions that may occur.
- 在“工具”中,选择“添加”,添加新工具
- 选择“自定义”,选择 MCP,单击“创建”
- 输入名称、终结点:
https://learn.microsoft.com/api/mcp,然后选择“未经身份验证”。 单击“连接” - 提出与Microsoft Learn 内容相关的问题,例如:
How to create a Microsoft Foundry instance using az cli? - 允许代理使用 MCP 服务器
- 离开之前,请单击“保存”。
请注意,可以试验模型、说明和提示,以发现解决方案的最佳配置。
后续步骤
可以通过访问以下链接了解有关 Learn MCP 服务器的详细信息: