Microsoft Learn MCP server
Free, keyless MCP server: search official Microsoft and Azure docs, find code samples and fetch pages as markdown.
Developer toolsGuided#mcp#documentation#azure#microsoft#code-samples#ai-agents
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
The Microsoft Learn MCP server gives an AI assistant first-party access to the official Microsoft and Azure documentation on learn.microsoft.com. It can search the docs, find code samples in many languages, and fetch a whole documentation page as markdown, so answers about Azure, .NET, Microsoft 365, Windows or Power Platform are grounded in current, official text instead of model memory. It is hosted by Microsoft, free, and needs no account, key or sign-in.
- Endpoint (Streamable HTTP):
https://learn.microsoft.com/api/mcp - Protocol (checked live 2026-11-18): answers the
initializehandshake with protocol version 2025-06-18 (server name "Microsoft Learn MCP Server", version 1.0.0). It also accepts tools/list and tools/call without a prior handshake. It does not support the newerserver/discovercall (error -32601). Replies arrive as a one-event SSE stream (event: messagethendata: {...}), and only POST is allowed (a GET returns 405). - Opening the URL in a browser is not useful: it is an API endpoint for MCP clients.
Credentials
None. There is nothing to sign up for. No variables need a secret.
Tools (checked live with tools/list on 2026-11-18)
| Tool | What it does | Arguments |
|---|---|---|
microsoft_docs_search | Searches official docs and returns up to 10 content chunks (about 500 tokens each) with title, URL and excerpt | query |
microsoft_code_sample_search | Finds official code snippets and examples | query (required), language (optional filter such as csharp, python, powershell, azurecli, javascript, typescript, java, go, rust, sql, kusto) |
microsoft_docs_fetch | Fetches one Learn page and converts it to markdown | url (required) |
All three are annotated read-only and idempotent by the server. The server publishes no prompts and no resources.
Typical flow for an assistant: search first, then fetch the best page for the full procedure when the excerpt is cut off, and use the code-sample search when it is about to write code.
Add it to your AI client
Claude Code (add --scope user for every project):
claude mcp add --transport http microsoft-learn https://learn.microsoft.com/api/mcpClaude Desktop / claude.ai: Settings > Connectors > Add custom connector, name it Microsoft Learn and use the URL above.
Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"microsoft-learn": {
"url": "https://learn.microsoft.com/api/mcp"
}
}
}VS Code (.vscode/mcp.json):
{
"servers": {
"microsoft-learn": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
}
}
}Safety
Everything here is read-only, so nothing in your tenant, subscription or files can change. The one thing to watch is content: search and fetch return text from public web pages that Microsoft hosts, which can include community-contributed pages, and that text enters your assistant's context. Treat commands and scripts in results like any other copied snippet: read them before running, especially anything that deletes resources or changes permissions. The fetch tool takes a URL, so it is meant for learn.microsoft.com pages.
Run order
- Start here: search, a code sample, then fetch a page.
- More examples: other products and languages.
- Plain HTTP: initialize, tools/list and tools/call as raw JSON-RPC.
Variables: mcpUrl (already set). Edit the tool arguments directly in each request.
Limits
No key means no published quota; Microsoft does not document numeric limits for this server, so use it politely and cache results in your own tools. Excerpts are capped at roughly 500 tokens per chunk, which is why the fetch tool exists. Content is English-first and mirrors the public site.
Common errors
| What you see | Meaning | What to do |
|---|---|---|
| HTTP 405 on GET | Only POST is accepted | Use an MCP client or POST JSON-RPC |
JSON-RPC -32601 for server/discover | Server speaks the older handshake | Use initialize (protocol 2025-06-18) |
| HTTP 400 "Parse error" | Body is not valid JSON-RPC | Send a JSON object with jsonrpc, id, method |
| Search returns few or no chunks | Query too narrow | Use product and feature names; add the language for code |
isError on fetch | URL is not a Learn page | Pass a full learn.microsoft.com URL from a search result |
Links
- Overview and setup: https://github.com/MicrosoftDocs/mcp
- Source and README: https://github.com/MicrosoftDocs/mcp
- Microsoft Learn: https://learn.microsoft.com
- MCP specification: https://modelcontextprotocol.io/specification
Endpoints 10
1. Start here
- MCPSearch the docs (microsoft_docs_search)
{{mcpUrl}}Searches official Microsoft and Azure documentation and returns up to 10 excerpts, each with a title, the page URL and a self-contained chunk of text. Phrase… - MCPFind code samples (microsoft_code_sample_search)
{{mcpUrl}}Looks for official code snippets. Pass language to improve relevance; the server lists csharp, javascript, typescript, python, powershell, azurecli, al, sql,… - MCPFetch a full page (microsoft_docs_fetch)
{{mcpUrl}}Downloads a Microsoft Learn page and returns it as markdown, which gives the full tutorial, prerequisites and troubleshooting that a search excerpt cuts off.…
2. More examples
- MCPMicrosoft 365 and Graph question
{{mcpUrl}}Searches documentation outside Azure: here the Microsoft Graph permissions needed to read a user's calendar. Shows that the same search tool covers Microsoft… - MCP.NET code sample (C#)
{{mcpUrl}}Searches for a C# sample about dependency injection in ASP.NET Core minimal APIs. Setting language to csharp filters out results in other languages and… - MCPAzure CLI sample
{{mcpUrl}}Asks for Azure CLI commands that create a resource group and a storage account. The azurecli language value returns command-line samples rather than SDK code,… - MCPFetch a reference page
{{mcpUrl}}Fetches a REST API reference page to read it in full. Pages with long tables are large, so an assistant should fetch only when the search excerpt is not enough.
3. The same calls as plain HTTP
- POSTinitialize (plain HTTP)
{{mcpUrl}}Starts a session with protocol 2025-06-18 and returns the server name, capabilities and a usage guide for the three tools. The response may carry an… - POSTtools/list (plain HTTP)
{{mcpUrl}}Lists the three tools with their input schemas and read-only annotations. Use it to confirm the tool names before wiring them into your own code. - POSTtools/call microsoft_docs_search (plain HTTP)
{{mcpUrl}}Runs a search as a bare JSON-RPC call. The text field of the result is itself a JSON string with a results array of title, content and contentUrl, so parse it…
API details
- Base URL
https://learn.microsoft.com/api/mcp- Authentication
- None declared in the description
- Operations
- 10 operations on 10 pathsPOST 10
- Main resources
- 1. Start here 32. More examples 43. The same calls as plain HTTP 3
- Description format
- Swastik Codes guided collection, API version
checked against the docs on 2026-11-18 - Links
- Documentation
How to test the Microsoft Learn MCP server in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Microsoft Learn MCP server collection, without the publisher's secrets.
- Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
- Send a requestPick an endpoint, for example “Search the docs (microsoft_docs_search)” (POST {{mcpUrl}}), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Microsoft Learn MCP server?
Free, keyless MCP server: search official Microsoft and Azure docs, find code samples and fetch pages as markdown. It is listed under Developer tools and has 10 endpoints.
Who publishes the Microsoft Learn MCP server?
It is listed from Microsoft's public API description (an OpenAPI document), not published by Microsoft on Swastik Codes. Anyone who controls microsoft.com can claim the profile by adding a DNS TXT record.
What is the base URL of the Microsoft Learn MCP server?
Requests go to https://learn.microsoft.com/api/mcp. Endpoint paths are added to this base URL.
How do I authenticate with the Microsoft Learn MCP server?
Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.
How many endpoints does the Microsoft Learn MCP server have?
10 operations on 10 paths (10 POST). The largest groups are 1. Start here, 2. More examples, 3. The same calls as plain HTTP.
Is forking the Microsoft Learn MCP server free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.