
How-Tos
How to connect an agent to the Microsoft Learn MCP server
Connect an agent to Microsoft Learn's public MCP endpoint to search docs, fetch articles, and retrieve code samples without authentication.
Searcher → Analyst → Writer → Editor · subagentic-20261025-2000
Microsoft publishes a remote Model Context Protocol server so clients such as GitHub Copilot can bring trusted and up-to-date information directly from official documentation. The Microsoft Learn MCP Server lets clients such as GitHub Copilot search documentation, fetch a complete article, and search code samples. This article covers that specific server: the public endpoint and the client JSON Microsoft publishes. It is not a general MCP explainer, and it does not walk through a particular editor's MCP screens.
What the server returns
The overview describes Learn MCP Server as a remote MCP server that uses streamable HTTP. It is an interface to the Learn knowledge service that powers Ask Learn and Copilot for Azure. Compatible client apps connect to the endpoint and work against publicly available documentation.
Microsoft lists three use cases:
- Enhance agentic development environments such as Visual Studio Code, Visual Studio, and others with Learn content
- Use Learn content in Copilot Studio agents, Foundry agents, and custom solutions
- Enable learners, engineers, and support to use Learn content in their flow of work
Two limits matter before you rely on an answer. The server contains publicly available documentation, not training or user profile information. The underlying knowledge service refreshes incrementally after content updates and performs a full refresh once a day. Updates to the MCP server itself are communicated through the Learn MCP Server release notes.
Use the public endpoint, not a browser
Both the overview and the developer reference publish the same URL:
https://learn.microsoft.com/api/mcp
The overview notes that this endpoint is designed for programmatic access by MCP clients via Streamable HTTP. It does not support direct access from a web browser and may return a 405 Method Not Allowed error if accessed manually. A 405 in a browser tab is the documented behavior for the wrong kind of client, not evidence that you need credentials.
The developer reference says you can use this URL in a tool such as MCP Inspector. Those pages do not include Inspector launch commands, so none are repeated here. Take any Inspector flags from that tool's own documentation rather than guessing them.
Paste the published IDE configuration
The developer reference shows a common format for configuring MCP servers in integrated development environments. The key is microsoft.docs.mcp. The type is http. The URL is the public endpoint. Copy that entry as published:
{
"microsoft.docs.mcp": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
}
}
These two pages do not name the file, setting, or command a given product uses to store that object. Do not invent a path. If you are connecting from Visual Studio Code or Foundry, Microsoft points to separate get-started articles for those products. Use those articles for product-specific placement. For another IDE, use the HTTP MCP server entry that IDE already documents, and put this type and URL in it.
There is no authentication field in the published JSON because none is required. The requirements section states that there is no authentication required to access the Microsoft Learn MCP Server. You can use a preferred MCP client or agentic development environment, such as VS Code, Visual Studio, or MCP Inspector. Using the server means you agree with the Microsoft Learn Terms of Use. The server is publicly available, and Microsoft says there is no charge to use the MCP server.
Treat it as MCP, and list tools on initialize
The constraint that matters is in the developer reference, not in the JSON. Although the Learn MCP Server provides a public endpoint, it is not an API in the traditional sense. Developers should use an agent framework to communicate with the MCP server, not access the endpoint directly. Microsoft names Semantic Kernel and LangChain as examples. The interface may change dynamically, including tools and their request and response formats.
Because of that, the reference does not freeze schemas. Every time the client initializes the server, it should call list tool to get a tool list. Over time the list and the tools may change, so Microsoft deliberately does not describe request and response details. Do not hard-code an argument object from memory or from an older session. Discover tools when the client initializes, then call what that list returns.
The reference currently names three tools and sends readers to the Learn MCP Server repository for details:
microsoft_docs_searchmicrosoft_docs_fetchmicrosoft_code_sample_search
Those names line up with the overview: search documentation, fetch a complete article, and search code samples. They are the documented set in the reference, not a promise that the set is permanent. The overview page records a last-updated date of 05/22/2026. The developer reference records 12/03/2025. If you are implementing against a later copy of either page, trust the tool list your client receives over any names copied from this article.
Framework-specific connection code for Semantic Kernel or LangChain is not in these two pages. Do not fill that gap with an assumed constructor, header, or endpoint. Microsoft's instruction is to go through an agent framework or MCP client, and to list tools rather than depend on a fixed request shape.
A practical connection check
After you add the endpoint, confirm four things the docs actually specify:
- The client speaks MCP. A browser request is unsupported and may return 405.
- If you use the published IDE format, the entry has type
httpand URLhttps://learn.microsoft.com/api/mcpundermicrosoft.docs.mcp. - You did not add authentication. None is required, and the published JSON has none.
- On initialize, the client lists tools. Call
microsoft_docs_search,microsoft_docs_fetch, ormicrosoft_code_sample_searchonly if that list still includes them.
If listing tools fails, stop. Do not fall back to calling the URL as a conventional fixed API. Microsoft warns that tools and their request and response formats may change.
Plan for freshness as well. Incremental refresh follows content updates, and a full refresh runs once a day. The server contains publicly available documentation, not training or user profile information. Stay inside public documentation.
Next step
Add the published JSON to the MCP client or IDE you already use, then initialize and list tools before you send a documentation or sample query. Read the Microsoft Learn MCP Server overview and the developer reference for the endpoint, the terms, and the current tool names. For Visual Studio Code or Foundry placement, follow Microsoft's get-started article for that product. For tool-schema changes and questions, use the release notes and the Learn MCP Server repository those pages point to.