本文將協助你開始使用 Microsoft Foundry 中的 Microsoft Learn 模型情境協定(MCP)伺服器。 Learn MCP Server 可以有多種使用方式。 一個常見的情境是將 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 伺服器: