Microsoft Learn MCP Server
Give your AI agent real-time, trusted Microsoft documentation and code samples via the official Microsoft Learn MCP serv
Updated
What is Microsoft Learn MCP?
The Microsoft Learn MCP server is a Model Context Protocol server that gives AI agents real-time access to trusted, up-to-date Microsoft documentation and official code samples. It is hosted by Microsoft as a remote server at https://learn.microsoft.com/api/mcp and communicates over streamable HTTP.
The server is an interface to the Learn knowledge service that powers Ask Learn and Copilot for Azure. Instead of relying on a model's training data — which can be stale or hallucinated — agents can semantically search the Microsoft Learn corpus, fetch a full article as markdown, and look up language-specific code snippets directly from Microsoft's official docs.
There is no authentication: the endpoint is public and requires no API key, token, or account. Note that the URL is for programmatic MCP clients over streamable HTTP only — opening it in a browser returns 405 Method Not Allowed. By using it you agree to the Microsoft Learn Terms of Use.
Tools the Microsoft Learn MCP server exposes
| Tool | What it does |
|---|---|
| microsoft_docs_search | Performs a semantic search against the official Microsoft technical documentation for a given query. |
| microsoft_docs_fetch | Fetches a specific Microsoft documentation page by URL and converts it to markdown. |
| microsoft_code_sample_search | Searches official Microsoft/Azure code snippets and examples, with optional language filtering. |
Connect the Microsoft Learn MCP server
Claude Code
- 1
Add the remote server
Run: claude mcp add --transport http microsoft-learn https://learn.microsoft.com/api/mcp
- 2
No auth needed
The endpoint is public — there is no API key or login step.
- 3
Verify
Run /mcp inside Claude Code and confirm microsoft-learn is connected and its tools (microsoft_docs_search, microsoft_docs_fetch, microsoft_code_sample_search) are listed.
Cursor
- 1
Open MCP settings
Go to Cursor Settings -> MCP -> Add new MCP server (or edit ~/.cursor/mcp.json).
- 2
Add the HTTP server entry
Add: { "mcpServers": { "microsoft-learn": { "url": "https://learn.microsoft.com/api/mcp" } } }
- 3
Reload and use
Save and reload; no authentication is required. The Microsoft Learn tools become available to the agent.
Sample use cases
An agent answers a developer question about Azure or .NET
It grounds the answer in current Microsoft docs and cites official sources instead of relying on stale training data.
A coding agent needs an idiomatic, up-to-date code sample
It pulls official Microsoft/Azure snippets via microsoft_code_sample_search, filtered to the right language.
A scheduled docs-review agent audits internal guides
It fetches the latest Learn articles and flags where internal content has drifted from Microsoft's current guidance.
An SDK migration agent helps a team move from an older Azure SDK to the latest version
It uses microsoft_docs_search and microsoft_docs_fetch to compare old and new API surfaces, then generates a migration checklist with code examples.
A security review agent checks Azure best practices for a new infrastructure setup
It searches for security baseline docs and compliance guides, fetches the relevant pages, and flags any deviations from Microsoft's recommendations.
A training agent builds developer onboarding materials for a Microsoft-stack team
It pulls relevant Learn articles and code samples via microsoft_code_sample_search, then assembles a curated reading path with hands-on exercises.
A troubleshooting agent helps debug a .NET or Azure error
It searches Microsoft Learn for the error message or code, fetches the troubleshooting guide, and returns step-by-step resolution instructions.
A compliance agent audits internal documentation against Microsoft's latest guidance
It fetches current Learn articles for each technology in the stack and diffs them against internal docs to flag outdated instructions.
Security & permissions
The Microsoft Learn MCP server requires no authentication — there is no API key, OAuth flow, or account. The agent gets read-only access to publicly available Microsoft Learn documentation and code samples; it cannot access training data, user profiles, or any private information. Because no credentials are exchanged, the connection carries no secret to leak, but treat any documentation content the agent retrieves as untrusted external input. Use of the server is governed by the Microsoft Learn Terms of Use.
Using Microsoft Learn MCP with Gamut
In a Gamut workflow, the Microsoft Learn MCP server acts as a read-only documentation lookup tool that an agent can call when a run is triggered on a schedule or by an event. For example, a scheduled agent could check internal docs or code against the latest Microsoft guidance, or an event-triggered support agent could pull authoritative Azure/.NET answers and code samples before drafting a reply. Gamut manages the connection to the public endpoint (no credentials needed), so the agent simply invokes the search and fetch tools as part of its reasoning. The server only returns public documentation, so it is best used for grounding and citation rather than as a system of record.
Frequently asked questions
What is the Microsoft Learn MCP server?
It is Microsoft's official Model Context Protocol server that lets AI agents semantically search Microsoft documentation, fetch full articles as markdown, and look up official code samples in real time. It runs as a remote server at https://learn.microsoft.com/api/mcp over streamable HTTP.
Is the Microsoft Learn MCP server free?
Yes. Microsoft hosts it publicly and there is no charge to use it. No API key, token, or account is required — authentication is none.
How do I connect the Microsoft Learn MCP server to Claude or Cursor?
In Claude Code, run: claude mcp add --transport http microsoft-learn https://learn.microsoft.com/api/mcp. In Cursor, add an mcpServers entry pointing url to https://learn.microsoft.com/api/mcp. No auth is needed in either client.
Is the Microsoft Learn MCP server hosted or self-hosted?
It is officially hosted by Microsoft as a remote server. You connect to https://learn.microsoft.com/api/mcp directly — there is nothing to deploy or self-host. The endpoint is for programmatic MCP clients only and returns 405 if opened in a browser.
What Microsoft documentation does the MCP server cover?
The server covers the full Microsoft Learn library — Azure, .NET, Microsoft 365, Windows, Power Platform, Dynamics 365, SQL Server, Visual Studio, and all other Microsoft technologies hosted on learn.microsoft.com.
Can Microsoft Learn MCP return code samples?
Yes. The microsoft_code_sample_search tool searches official Microsoft and Azure code snippets and examples. You can filter results by programming language to get idiomatic samples in C#, Python, JavaScript, Java, and more.
Does the Microsoft Learn MCP server require a Microsoft account?
No. The server is publicly hosted by Microsoft at learn.microsoft.com/api/mcp with no authentication required. Any MCP client can connect without an API key, token, or Microsoft account.