MS Learn MCP skill
Calls the public Microsoft Learn MCP server at https://learn.microsoft.com/api/mcp over JSON-RPC 2.0. No auth required. Use this to ground customer-facing answers in live, first-party Microsoft documentation.
Three tools available
| Tool | Purpose | Args |
|---|---|---|
| microsoft_docs_search | Top-10 doc chunks (<=500 tokens each). Always start here. | query (string) |
| microsoft_code_sample_search | Official code snippets. Use when generating any MS/Azure code. | query (string), language (optional: csharp, javascript, typescript, python, powershell, azurecli, al, sql, java, kusto, cpp, go, rust, ruby, php) |
| microsoft_docs_fetch | Full page -> markdown. Use AFTER search when a result looks high-value or is truncated. | url (must be microsoft.com HTML page) |
How to call (PowerShell)
$body = @{
jsonrpc = "2.0"
id = 1
method = "tools/call"
params = @{
name = "microsoft_docs_search"
arguments = @{ query = "YOUR QUERY HERE" }
}
} | ConvertTo-Json -Compress -Depth 6
curl.exe -s -X POST "https://learn.microsoft.com/api/mcp" `
-H "Content-Type: application/json" `
-H "Accept: application/json, text/event-stream" `
-d $body
Response is SSE-framed: skip the event: message\ndata: prefix, then JSON-parse. The result.content[0].text field is itself JSON - parse it again to get results[].
Quick parser:
$raw = curl.exe ... # as above
$json = ($raw -join "`n") -replace '^event:.*\ndata: ',''
$outer = $json | ConvertFrom-Json
$inner = $outer.result.content[0].text | ConvertFrom-Json
$inner.results | ForEach-Object { "[$($_.title)]($($_.contentUrl))`n$($_.content)`n" }
Workflow for a customer answer
- Search with
microsoft_docs_searchusing the user's question verbatim or refined keywords. - Skim top results. If they fully answer the question, synthesize and cite.
- If a result is truncated, ambiguous, or canonical, fetch it with
microsoft_docs_fetch. - If the user wants code, also call
microsoft_code_sample_searchwith the right language. - Compose response with inline citations: every claim from Learn must link to source
contentUrl.
Output style for customer-facing answers
- Lead with a one-paragraph plain-English answer.
- Follow with bullet points of key facts, each citing
[Source title](url). - If quoting code, fence it with the right language and cite the sample link.
- End with a Sources section listing every URL used.
- Never paraphrase beyond the docs. If Learn doesn't cover it, say so explicitly.
When NOT to use
- Internal Microsoft content (Seismic, MSX, Learn Pathways gated content): use other skills.
- Non-Microsoft topics.
- Time-sensitive pricing/SLAs: confirm on official pricing pages after Learn points to them.