Add Learn CLI option to microsoft-docs skills (#1003)

* Add Learn CLI option to microsoft-docs skills

* avoid context fork

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Tianqi Zhang
2026-03-16 08:53:03 +08:00
committed by GitHub
parent 39a1a0ce04
commit 822d0407de
4 changed files with 89 additions and 2 deletions

View File

@@ -21,6 +21,27 @@ Use these tools for **everything on learn.microsoft.com** — Azure, .NET, M365,
Use `microsoft_docs_fetch` after search when you need complete tutorials, all config options, or when search excerpts are truncated.
### CLI Alternative
If the Learn MCP server is not available, use the `mslearn` CLI from your terminal or shell (for example, Bash, PowerShell, or cmd) instead:
```bash
# 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 Tool | CLI Command |
|----------|-------------|
| `microsoft_docs_search(query: "...")` | `mslearn search "..."` |
| `microsoft_code_sample_search(query: "...", language: "...")` | `mslearn code-search "..." --language ...` |
| `microsoft_docs_fetch(url: "...")` | `mslearn fetch "..."` |
Pass `--json` to `search` or `code-search` to get raw JSON output for further processing.
---
## Exceptions: When to Use Other Tools