Microsoft Learn MCP Server: Live Documentation Access for AI Assistants
Official Microsoft Learn MCP Server and CLI tool – powering LLMs and AI agents with real-time, trusted Microsoft docs & code samples.
At a glance
- What is it?
- The Microsoft Learn MCP Server is a free, authentication-free remote endpoint that gives AI assistants and coding agents direct access to Microsoft's official technical documentation and code samples. It exposes three tools over the Model Context Protocol and installs in Claude Code, Copilot, or Codex with a single command.
- Who is it for?
- The Microsoft Learn MCP Server is a practical addition for any developer who uses Claude Code, GitHub Copilot, or Codex to write code that targets Azure, .NET, or other Microsoft platforms. The endpoint is free and requires no authentication.
- Can I use it commercially?
- Yes, with credit. CC-BY-4.0 allows commercial use as long as you credit the authors and indicate what you changed. It is written for creative content, so check how it applies to any code.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The Problem: Outdated Training Data for Microsoft APIs
AI coding assistants trained on historical data will hallucinate Azure SDK methods, invent library packages, or generate code that does not compile when targeting Microsoft platforms. The Microsoft Learn MCP Server addresses this at the source: instead of relying on training data, the assistant queries the official documentation at query time and receives current, authoritative content.
The server covers Microsoft's full technical documentation catalog, which includes Azure services, .NET, Visual Studio, Microsoft 365, and related platforms. It is maintained by MicrosoftDocs, the same team that publishes the documentation itself. The homepage for the server is learn.microsoft.com.
The model context protocol (MCP) is an open standard for connecting AI assistants to data sources and tools. Any MCP-compatible client can connect to this server. It does not require a paid subscription, an API key, or a sign-in. The README describes it as free and designed for heavy coding sessions.
The Remote Endpoint and Standard Configuration
The MCP server runs as a remote HTTP endpoint. Any MCP-compatible client connects to this URL:
https://learn.microsoft.com/api/mcpThe standard JSON configuration that works in most clients is:
{
"servers": {
"microsoft-learn": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
}
}
}This URL does not work in a web browser. It is designed for use within a compliant MCP client via Streamable HTTP. A direct browser request will return a 405 Method Not Allowed error. The README warns developers building custom clients to follow the mandatory guidelines in the Building a Custom Client section to ensure the implementation is resilient and supported.
An experimental OpenAI-compatible endpoint is available at `https://learn.microsoft.com/api/mcp/openai-compatible` for applications that require OpenAI Deep Research model compatibility. An optional `maxTokenBudget` query parameter limits token count in search tool responses by truncating content. Both experimental features are subject to change.
The Three MCP Tools
The server exposes three tools. The `microsoft_docs_search` tool performs semantic search against Microsoft's official technical documentation and takes a single string query parameter. The `microsoft_docs_fetch` tool retrieves a documentation page and converts it to Markdown format; it takes a URL string pointing to a Microsoft documentation page. The `microsoft_code_sample_search` tool searches for official Microsoft and Azure code snippets; it takes a query string and an optional programming language filter.
These tools cover the three primary ways a developer reaches documentation during coding: searching by topic, fetching a specific known page, and finding code examples for a particular use case. A developer asking an AI assistant how to use `IHttpClientFactory` in .NET 8 can expect the assistant to query `microsoft_docs_search` for current guidance rather than generating from training data.
The README gives concrete prompt examples: asking for Azure CLI commands to create an Azure Container App with a managed identity, asking whether a specific model version is available in Azure EU regions, and verifying the correct implementation pattern for a .NET 8 minimal API.
Installing with the Microsoft Learn CLI
The `@microsoft/learn-cli` npm package provides terminal access to the same three tools and also installs agent discovery artifacts. To run it without installing:
npx @microsoft/learn-cli search "azure functions timeout"To install globally and use the `mslearn` command:
npm install -g @microsoft/learn-cli
mslearn search "azure functions timeout"To install CLI-first agent discovery for Claude Code:
mslearn setup --cli --claudeFor GitHub Copilot and Codex together:
mslearn setup --cli --copilot --codexThe setup command auto-detects installed agents from well-known directories if no explicit target is given. For Claude Code, the discovery artifact goes to `~/.claude/skills/` for user scope or `.claude/skills/` for project scope. To remove managed discovery content:
mslearn remove --cli --claudeThe README notes that when both the MCP integration and the CLI skill are installed, agents should prefer the MCP tools and fall back to the CLI skill only when the MCP server is unavailable.
Agent Skills and One-Click VS Code Install
The repository contains a `skills/` directory with agent skill packages for GitHub Copilot, Claude Code, and Codex. The README's header includes one-click VS Code install buttons that configure the MCP server in the VS Code MCP settings directly. These buttons work in both stable VS Code and VS Code Insiders and install the server configuration without requiring manual JSON editing.
The `.claude-plugin/` and `.codex-plugin/` directories in the repository root contain plugin definitions for those respective ecosystems. The `.agents/` directory contains a generic agent skill definition. This layout means the repository itself serves as a reference for how agent skill packages are structured for each ecosystem.
The structured JSON output flag `--json` is available on the CLI for programmatic processing:
mslearn search "azure openai" --json | jq '.results[].title'This is useful for scripts that need to pull documentation references into automated workflows without a full MCP client setup.
Limitations and What It Does Not Cover
The server covers only official Microsoft documentation. It provides no benefit for developers working with non-Microsoft APIs, open-source libraries outside the Microsoft ecosystem, or third-party Azure integrations that are not documented on learn.microsoft.com. A developer writing Python code that calls a non-Microsoft REST API gets no value from the server, even if they are running that code in an Azure Function.
The `mslearn setup` workflow targets three agent ecosystems: GitHub Copilot, Claude Code, and Codex. It does not configure Cursor, JetBrains AI, or other MCP-compatible tools without additional manual work. Developers using those tools need to add the server configuration manually using the standard JSON block described in the README, then verify MCP connectivity through each tool's settings interface.
The experimental `maxTokenBudget` parameter truncates content to stay within a token limit, which means a heavily truncated response may omit the specific answer the developer needs. For example, a page about a complex .NET API with many method signatures may be cut before the relevant overload appears. The README notes this feature is subject to change based on feedback.
The repository license is CC-BY-4.0 for documentation content and a separate license applies to code samples. The last push to the repository was on 2026-09-10. There are no GitHub releases; the server is deployed continuously from the main branch.
Editorial conclusion
The Microsoft Learn MCP Server is a practical addition for any developer who uses Claude Code, GitHub Copilot, or Codex to write code that targets Azure, .NET, or other Microsoft platforms. The endpoint is free and requires no authentication. The main constraint is that it covers only official Microsoft documentation; for non-Microsoft APIs it provides no benefit, and the `mslearn setup` CLI targets only the three listed agent ecosystems, not tools like Cursor without additional configuration. Developers who want terminal access without an MCP client can use the `@microsoft/learn-cli` npm package instead.
Frequently asked questions
What are the MCP docs tools provided by the Microsoft Learn server?
The server provides three tools: `microsoft_docs_search` for semantic search across Microsoft documentation, `microsoft_docs_fetch` to retrieve a specific documentation page as Markdown, and `microsoft_code_sample_search` to find official Microsoft and Azure code samples with an optional language filter.
Does the Microsoft Learn MCP Server require an API key or login?
No. The server is free and requires no API key, no login, and no sign-up. Any MCP-compatible client can connect to the endpoint at https://learn.microsoft.com/api/mcp without authentication.
How do I install the Microsoft Learn MCP Server in Claude Code?
Run `mslearn setup --cli --claude` after installing `@microsoft/learn-cli` globally, or add the standard MCP JSON configuration block with the server URL to your Claude Code settings manually.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/microsoftdocs-mcp)