The Microsoft Learn MCP server is a free, remote Model Context Protocol server at https://learn.microsoft.com/api/mcp that lets AI assistants search Microsoft's official documentation, fetch full articles and find code samples. To set up Microsoft Learn MCP, add that URL as an HTTP server in your MCP client (VS Code, Claude Code, Copilot CLI and others). No sign-in is needed.
This guide covers what the server does, the exact setup for the clients Microsoft documents, and how to make your assistant actually use it. Details are from Microsoft's own pages, opened in November 2026. They can change, so check the sources at the bottom if something differs.
What the Microsoft Learn MCP server does
Language models are trained on a snapshot of the web. For fast-moving products such as Azure, .NET and Microsoft 365, that snapshot goes stale, and the model may describe a command or API that has changed. The Learn MCP server gives the assistant a way to look things up in the live documentation instead of guessing. If you are new to the protocol itself, read What Is Model Context Protocol (MCP)? first.
Microsoft describes it as a remote server that uses Streamable HTTP. It is the interface to the same knowledge service that powers Ask Learn and Copilot for Azure. It exposes three tools:
| Tool | Use it for |
|---|---|
microsoft_docs_search | Searching the documentation |
microsoft_docs_fetch | Fetching a complete article |
microsoft_code_sample_search | Searching code samples |
Microsoft deliberately does not document the request and response formats. Its developer reference says the tool list and formats may change dynamically, and that clients should call the list-tools request each time they initialise the server. You do not need to know the parameters to use it from an assistant. The model reads the tool descriptions and decides how to call them.
Requirements, price and limits
- No authentication. Microsoft states that no authentication is required.
- No charge. The server is publicly available and free to use. Using it means you agree to the Microsoft Learn Terms of Use.
- Public documentation only. It does not contain training or user profile information, so it cannot see your Learn progress, certifications or private content.
- Daily refresh. The knowledge service refreshes incrementally after content updates and does a full refresh once a day.
How to set up Microsoft Learn MCP in VS Code
Microsoft's getting-started article uses GitHub Copilot in Visual Studio Code, so you need both installed. The article's easiest route is a one-click install button on that page. If you prefer to do it by hand:
- Open the Command Palette and run MCP: Add Server. This starts a guided flow.
- Choose the HTTP option and enter the endpoint
https://learn.microsoft.com/api/mcp. - Give the server an ID, for example
microsoftLearn, and choose whether it applies to your user profile (every VS Code session) or only the current workspace.
The common configuration entry that Microsoft publishes for IDEs looks like this. The exact wrapper object and file location depend on the client, so treat it as the entry, not a complete file:
{
"microsoft.docs.mcp": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
}
}
To use it, open Copilot Chat, select agent mode and ask a question about Microsoft technology. Microsoft's own example is How to create a Microsoft Foundry instance using az cli?. The agent asks permission to call the MCP tool; allow it and the answer comes back with the documentation as context. For general VS Code Copilot setup, see VS Code and GitHub Copilot setup.
How to add it to Claude Code
There are two routes. The first installs Microsoft's microsoft-docs plugin, which bundles the server with three agent skills (microsoft-docs, microsoft-code-reference and microsoft-skill-creator). Run these in Claude Code, then restart:
/plugin marketplace add microsoftdocs/mcp
/plugin install microsoft-docs@microsoft-docs-marketplace
The second route adds only the server, using Claude Code's generic command for remote HTTP servers (claude mcp add --transport http <name> <url>):
claude mcp add --transport http microsoft-learn https://learn.microsoft.com/api/mcp
The name microsoft-learn is my choice; any name works. By default the server is stored in local scope, meaning only you, in the current project. Add --scope user to make it available in all your projects, or --scope project to write it to a shared .mcp.json file. Check the connection with:
claude mcp list
Claude Code's documentation says each server shows a status such as ✔ Connected or ✘ Failed to connect. For more on the tool, see Claude Code CLI explained.
How to add it to GitHub Copilot CLI
Microsoft's article gives one command for Copilot CLI, which installs the same plugin:
/plugin install microsoftdocs/mcp
For other clients, such as Visual Studio, Copilot Studio agents, Foundry agents and other agentic IDEs, Microsoft points to the configuration options in its GitHub repository (linked from the get-started article). The process is the same in each: register the endpoint as an HTTP server, then let the agent call it.
Make the assistant use it
Having the server connected does not guarantee the model calls it. If your agent answers from memory instead, Microsoft recommends adding an instructions file. In VS Code, open chat, choose agent mode, click the settings wheel, select Instructions and pick where to create the file. Microsoft's suggested content names the three tools and tells the agent to use them for native Microsoft technologies:
---
applyTo: '**'
---
## Querying Microsoft Documentation
You have access to MCP tools called `microsoft_docs_search`, `microsoft_docs_fetch`, and `microsoft_code_sample_search` - these tools allow you to search through and fetch Microsoft's latest official documentation and code samples, and that information might be more detailed or newer than what's in your training data set.
When handling questions around how to work with native Microsoft technologies, such as C#, F#, ASP.NET Core, Microsoft.Extensions, NuGet, Entity Framework, the `dotnet` runtime - please use these tools for research purposes when dealing with specific / narrowly defined questions that may occur.
Adapt the second paragraph to your own stack, for instance Azure or PowerShell. Naming the tools and the topics is what steers the model. In other clients, put the same text in whatever file that client reads for standing instructions.
Control how much text comes back
Each search result consumes part of the model's context window, and in agent loops those calls add up. Microsoft's best-practices page describes a maxTokenBudget query parameter:
https://learn.microsoft.com/api/mcp?maxTokenBudget=2000
This truncates content in search results to stay within the budget. Use a low value if your agent makes many calls per turn and a higher one if you want richer single answers. It affects search only: the fetch tool always returns the full page. To see how tokens translate into cost, try the token counter.
If it does not work
- Browser shows 405 Method Not Allowed. Expected. The endpoint is for MCP clients, not browsers.
- Server shows as failed or never connects. Check the URL for typos and that it starts with
https://. If you are on a corporate network, a proxy may block the request; that is a guess about common causes, not something Microsoft documents. - Tools are connected but never called. Add the instructions file above, and phrase your question about a specific Microsoft product or API.
- Tool names differ from this article. Microsoft says tools can be added, renamed or updated. Clients that list tools at connection time pick up changes automatically.
One more caution: an MCP server sends text into your model's context. The Learn server serves Microsoft documentation, but the habit applies to every server you add. Install only ones you trust, and read what the agent asks permission to do. For where this fits in agent design, see What is an AI agent?.
Frequently asked questions
- Is the Microsoft Learn MCP server free?
- Yes. Microsoft's overview page says the server is publicly available and there is no charge to use it. It also says no authentication is required. Your AI client may still bill you for the model usage that processes the results.
- Why does opening the MCP URL in a browser show an error?
- The endpoint is built for MCP clients that speak Streamable HTTP, not for browsers. Microsoft's documentation says it does not support direct browser access and may return a 405 Method Not Allowed error if you open it manually. That error does not mean the server is down.
- Does the Microsoft Learn MCP server include my Learn training progress?
- No. Microsoft lists this as a limitation: the server contains publicly available documentation, not training or user profile information. It searches and returns documentation and code samples only.
- How fresh is the content the server returns?
- According to Microsoft, the underlying knowledge service refreshes incrementally after content updates and does a full refresh once a day. A page edited this morning may therefore not appear in search results until later.
- Can I limit how much text a search returns?
- Yes. Append the maxTokenBudget query parameter to the endpoint, for example https://learn.microsoft.com/api/mcp?maxTokenBudget=2000. Microsoft says it truncates search results to fit the budget. It does not affect the fetch tool, which always returns the full page.
Sources
- Microsoft Learn: Microsoft Learn MCP Server overview
- Microsoft Learn: Get started with the Microsoft Learn MCP Server
- Microsoft Learn: Microsoft Learn MCP Server developer reference
- Microsoft Learn: Best practices for using the Microsoft Learn MCP Server
- Claude Code docs: Connect Claude Code to tools via MCP
- Visual Studio Code docs: Use MCP servers