SuperAPI AI 工具集

microsoft-docs

写作与研究

查看项目

更新于 10-16 10:56

技能介绍

用途

Microsoft Docs 是一个面向微软技术生态的研究型技能,用于查询官方 Microsoft 文档,查找概念、教程和代码示例,覆盖 Azure、.NET、Agent Framework、Aspire、VS Code、GitHub 等主题。它既覆盖 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:

# Run directly (no install needed)
npx @microsoft/learn-cli search "BlobClient UploadAsync Azure.Storage.Blobs"

# Or install globally, then run
npm install -g @microsoft/learn-cli
mslearn search "BlobClient UploadAsync Azure.Storage.Blobs"

MCP 工具与 CLI 命令对应关系:

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 Server(首选)或 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——webviews、TreeViews、命令、贡献点

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(每个会话一次):

  1. 使用技术名称调用 mcp_context7_resolve-library-id
  2. 使用返回的库 ID 和具体查询调用 mcp_context7_query-docs

编写有效的查询

要具体——包含版本、意图和语言:

# ❌ Too broad
"Azure Functions"
"agent framework"

# ✅ Specific
"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#)

适用场景

  • 查询 Azure、.NET、M365、Power Platform、Semantic Kernel、Windows 等 learn.microsoft.com 上的官方文档
  • 查找官方代码示例
  • 查询 .NET Aspire、VS Code、GitHub、Agent Framework 的文档与 API 细节

限制

  • 技能本身不提供文档内容,需依赖 Microsoft Learn MCP、Aspire MCP Server、Context7 或 mslearn CLI 等外部工具
  • 不同工具覆盖范围不同,非 Learn 内容需切换工具
  • Aspire 文档搜索能力依赖 Aspire CLI 版本(13.2 及以上内置,13.1 需回退 Context7)
  • 关于收费、价格、平台支持范围等信息暂未提供