查詢官方 Microsoft 文件,尋找 Azure、.NET、Agent Framework、Aspire、VS Code、GitHub 等技術的概念、教學與程式碼範例。預設使用 Microsoft Learn MCP,對於不在 learn.microsoft.com 上的內容則使用 Context7 與 Aspire MCP。
Microsoft Docs
Microsoft 技術生態系的研究技能。涵蓋 learn.microsoft.com 以及外部文件(VS Code、GitHub、Aspire、Agent Framework 儲存庫)。
預設:Microsoft Learn MCP
使用這些工具處理 learn.microsoft.com 上的所有內容 — Azure、.NET、M365、Power Platform、Agent Framework、Semantic Kernel、Windows 等。這是處理絕大多數 Microsoft 文件查詢的主要工具。
| 工具 | 用途 |
|---|---|
microsoft_docs_search |
搜尋 learn.microsoft.com — 概念、指南、教學、設定 |
microsoft_code_sample_search |
從 Learn 文件中尋找可用的程式碼片段。傳入 language(python、csharp 等)以獲得最佳結果 |
microsoft_docs_fetch |
從特定 URL 取得完整頁面內容(當搜尋摘要不足時使用) |
當你需要完整的教學、所有設定選項,或搜尋摘要被截斷時,請在搜尋後使用 microsoft_docs_fetch。
CLI 替代方案
如果 Learn MCP 伺服器不可用,請改用終端機或 Shell(例如 Bash、PowerShell 或 cmd)中的 mslearn CLI:
# 直接執行(無需安裝)
npx @microsoft/learn-cli search "BlobClient UploadAsync Azure.Storage.Blobs"
# 或全域安裝後執行
npm install -g @microsoft/learn-cli
mslearn search "BlobClient UploadAsync Azure.Storage.Blobs"
| MCP 工具 | CLI 指令 |
|---|---|
microsoft_docs_search(query: "...") |
mslearn search "..." |
microsoft_code_sample_search(query: "...", language: "...") |
mslearn code-search "..." --language ... |
microsoft_docs_fetch(url: "...") |
mslearn fetch "..." |
對 search 或 code-search 傳入 --json 可取得原始 JSON 輸出以便進一步處理。
例外情況:何時使用其他工具
以下類別位於 learn.microsoft.com 之外。請改用指定的工具。
.NET Aspire — 使用 Aspire MCP 伺服器(建議)或 Context7
Aspire 文件位於 aspire.dev,而非 Learn。最佳工具取決於你的 Aspire CLI 版本:
CLI 13.2+(建議)— Aspire MCP 伺服器包含內建的文件搜尋工具:
| MCP 工具 | 說明 |
|---|---|
list_docs |
列出 aspire.dev 上所有可用的文件 |
search_docs |
對 aspire.dev 內容進行加權詞彙搜尋 |
get_doc |
根據 slug 擷取特定文件 |
這些功能隨 Aspire CLI 13.2 提供(PR #14028)。更新方式:aspire update --self --channel daily。參考:https://davidpine.dev/posts/aspire-docs-mcp-tools/
CLI 13.1 — MCP 伺服器提供整合查詢(list_integrations、get_integration_docs),但不包含文件搜尋。請改用 Context7:
| 函式庫 ID | 用途 |
|---|---|
/microsoft/aspire.dev |
主要 — 指南、整合、CLI 參考、部署 |
/dotnet/aspire |
執行時期原始碼 — API 內部、實作細節 |
/communitytoolkit/aspire |
社群整合 — Go、Java、Node.js、Ollama |
VS Code — 使用 Context7
VS Code 文件位於 code.visualstudio.com,而非 Learn。
| 函式庫 ID | 用途 |
|---|---|
/websites/code_visualstudio |
使用者文件 — 設定、功能、偵錯、遠端開發 |
/websites/code_visualstudio_api |
擴充功能 API — WebView、TreeView、指令、貢獻點 |
GitHub — 使用 Context7
GitHub 文件位於 docs.github.com 與 cli.github.com。
| 函式庫 ID | 用途 |
|---|---|
/websites/github_en |
Actions、API、儲存庫、安全性、管理、Copilot |
/websites/cli_github |
GitHub CLI(gh)指令與旗標 |
Agent Framework — 使用 Learn MCP + Context7
Agent Framework 教學位於 learn.microsoft.com(使用 microsoft_docs_search),但 GitHub 儲存庫 包含 API 層級的細節,通常比已發佈的文件更新 — 特別是 DevUI REST API 參考、CLI 選項與 .NET 整合。
| 函式庫 ID | 用途 |
|---|---|
/websites/learn_microsoft_en-us_agent-framework |
教學 — DevUI 指南、追蹤、工作流程編排 |
/microsoft/agent-framework |
API 細節 — DevUI REST 端點、CLI 旗標、驗證、.NET AddDevUI/MapDevUI |
DevUI 提示: 先查詢 Learn 網站來源以取得操作指南,再查詢儲存庫來源以取得 API 層級細節(端點結構、代理設定、驗證權杖)。
Context7 設定
對於任何 Context7 查詢,請先解析函式庫 ID(每個工作階段一次):
- 使用技術名稱呼叫
mcp_context7_resolve-library-id - 使用回傳的函式庫 ID 與特定查詢呼叫
mcp_context7_query-docs
撰寫有效的查詢
請具體說明 — 包含版本、意圖與語言:
# ❌ 太廣泛
"Azure Functions"
"agent framework"
# ✅ 具體
"Azure Functions Python v2 programming model"
"Cosmos DB partition key design best practices"
"GitHub Actions workflow_dispatch inputs matrix strategy"
"Aspire AddUvicornApp Python FastAPI integration"
"DevUI serve agents tracing OpenTelemetry directory discovery"
"Agent Framework workflow conditional edges branching handoff"
包含上下文:
- 版本(如相關:
.NET 8、Aspire 13、VS Code 1.96) - 任務意圖(
quickstart、tutorial、overview、limits、API reference) - 語言(適用於多語言文件:
Python、TypeScript、C#)






