Microsoft Learn

Microsoft Learn MCP Server connects AI coding assistants and agents to Microsoft Learn documentation through a remote Model Context Protocol endpoint.

You can use it to search technical documentation, fetch complete Learn pages, and find Microsoft and Azure code samples without running a local MCP server.

The public endpoint works with MCP clients such as Cursor, VS Code, Claude Code, Codex, and other tools that support Streamable HTTP.

It requires no API key or Microsoft account, and Microsoft provides the service at no charge.

Quick Setup

Endpointhttps://learn.microsoft.com/api/mcp
TransportStreamable HTTP
AuthenticationNone
CostFree public service
Current statusGenerally available
Current toolsDocs Search, Docs Fetch, Code Sample Search

For most MCP clients, the only value you need is the endpoint URL. The client connects to Microsoft Learn over HTTP and requests the available tool definitions when the connection starts.

https://learn.microsoft.com/api/mcp

What the Microsoft Learn MCP Server Can Do

The MCP server currently exposes three tools for documentation tasks. MCP clients should request the current tool definitions at connection time. Names, parameters, and schemas can change as the service evolves.

ToolPurposeUseful For
microsoft_docs_searchSearches Microsoft technical documentation by meaning and query contextConcepts, configuration, limits, commands, and troubleshooting
microsoft_docs_fetchFetches a Microsoft Learn page and converts it to MarkdownReading a complete page after search finds the relevant document
microsoft_code_sample_searchSearches Microsoft and Azure code samplesSDK examples, API usage, and language-specific implementation examples

Use Cases

  • Azure development: Look up Azure CLI commands, service configuration, SDK methods, deployment options, and current product documentation while you work in an AI coding client.
  • .NET and C# development: Check ASP.NET Core, Entity Framework, NuGet, Microsoft.Extensions, runtime behavior, and API examples against Microsoft Learn content.
  • Microsoft 365 development: Find technical documentation for Microsoft Graph, Teams apps, SharePoint development, and other Microsoft 365 APIs.
  • Troubleshooting: Search current Microsoft documentation when a model’s built-in knowledge is incomplete, old, or uncertain.

How to Set Up Microsoft Learn MCP in Cursor

Cursor supports remote MCP servers through mcp.json. Use a project configuration when you only want Microsoft Learn tools in one repository, or a global configuration when you want them available across your Cursor projects.

1. Open Cursor’s MCP settings, or create .cursor/mcp.json in a project. For a global configuration, use ~/.cursor/mcp.json.

2. Configure the Microsoft Learn endpoint as a remote MCP server:

{
  "mcpServers": {
    "microsoft-learn": {
      "url": "https://learn.microsoft.com/api/mcp"
    }
  }
}

3. Save the file and confirm that microsoft-learn appears in Cursor’s MCP tools.

4. Open Agent and ask a Microsoft-specific question. Cursor can call the documentation tools when they are relevant to the request.

5. If the connection is active but Cursor does not call the MCP tools, use a Cursor rule that tells the agent to consult Microsoft Learn MCP for Microsoft-specific technical questions. Tool availability alone does not force every model to call the server.

Setup in VS Code, Claude Code, and Codex

ClientSetup
VS Code / GitHub CopilotInstall Microsoft Learn MCP from the MCP server experience, then use it in Copilot Agent mode.
Claude CodeMicrosoft provides a plugin that bundles the Learn MCP connection with Microsoft documentation skills.
CodexRun codex mcp add "microsoft-learn" --url "https://learn.microsoft.com/api/mcp".
Other MCP clientsConfigure https://learn.microsoft.com/api/mcp as a remote Streamable HTTP server when the client supports that transport.

Quick Test After Installation

After the MCP server appears in your client’s tool list, use a prompt that clearly asks for Microsoft Learn information.

A successful connection should expose the Microsoft Learn tools to the client and return Microsoft Learn content when the agent chooses the server for the task.

  • Use Microsoft Learn MCP to find the current Azure CLI commands for creating an Azure Container App with a managed identity.
  • Search Microsoft Learn for the current guidance on IHttpClientFactory in a .NET application and fetch the most relevant page.
  • Use the Microsoft code sample search tool to find a C# example for uploading a blob with Azure.Storage.Blobs.

Key Limits and Behavior

  • Public documentation only: The MCP server retrieves publicly available Microsoft Learn content. It does not connect to your Microsoft 365 account, OneDrive files, Outlook mail, Teams messages, contacts, or other private tenant data.
  • Rate limits apply: Microsoft uses throttling on the free public endpoint for fair usage.
  • Documentation updates are not instantaneous: The underlying knowledge service refreshes incrementally after content changes and performs a full refresh once per day.
  • No pre-filter option: The MCP server does not provide a dedicated content filter before search. Put the product, technology, version, or scope directly in your question when you want narrower results.
  • The endpoint is not a normal browser API: Opening https://learn.microsoft.com/api/mcp directly in a browser can return 405 Method Not Allowed. MCP clients communicate with it through Streamable HTTP.
  • Tool definitions can change: Custom MCP integrations should request the current tool list and schemas at runtime instead of hardcoding request formats.

Token Budget Control

Microsoft currently provides an experimental maxTokenBudget query parameter for controlling the size of search responses. This can help when an agent makes repeated documentation searches inside a limited context window.

https://learn.microsoft.com/api/mcp?maxTokenBudget=2000

The parameter applies to search results. The Docs Fetch tool returns the complete page, so a token budget on the endpoint does not truncate fetched pages.

Related Resources

FAQs

Q: Is Microsoft Learn MCP Server free?
A: Yes. Microsoft provides the public Learn MCP endpoint at no charge, and the service does not require authentication.

Q: Why do I get a 405 Method Not Allowed error from the MCP URL?
A: The endpoint expects MCP communication over Streamable HTTP rather than normal browser navigation. A 405 response can appear when you paste the endpoint into a web browser. Configure the URL inside an MCP client instead.

Q: Does Microsoft Learn MCP access my Microsoft 365 account or OneDrive files?
A: No. It retrieves public Microsoft Learn documentation. It does not provide access to your private Microsoft 365 tenant, email, files, contacts, calendar, or Teams data.

Q: Why is the server connected but my AI assistant does not use it?
A: A model decides when to call available MCP tools. If Microsoft Learn MCP rarely triggers, give the agent an instruction to use the server for Microsoft-specific technical questions, API lookups, code samples, and documentation checks.

Latest MCP Servers

Codebase Memory

Use local codebase memory for AI coding agents. Search symbols, map architecture, trace dependencies, and review change impact.

Microsoft Learn

Connect your AI assistant directly to official Microsoft documentation for accurate, real-time answers inside your MCP client.

Paper Search

Search across academic databases, retrieve lawful open-access PDFs, and bring paper text into Claude Code or another MCP client.

View More MCP Servers >>

Featured MCP Servers

Codebase Memory

Use local codebase memory for AI coding agents. Search symbols, map architecture, trace dependencies, and review change impact.

Microsoft Learn

Connect your AI assistant directly to official Microsoft documentation for accurate, real-time answers inside your MCP client.

Notion

Notion's official MCP Server allows you to interact with Notion workspaces through the Notion API.

More Featured MCP Servers >>

FAQs

Q: What exactly is the Model Context Protocol (MCP)?

A: MCP is an open standard, like a common language, that lets AI applications (clients) and external data sources or tools (servers) talk to each other. It helps AI models get the context (data, instructions, tools) they need from outside systems to give more accurate and relevant responses. Think of it as a universal adapter for AI connections.

Q: How is MCP different from OpenAI's function calling or plugins?

A: While OpenAI's tools allow models to use specific external functions, MCP is a broader, open standard. It covers not just tool use, but also providing structured data (Resources) and instruction templates (Prompts) as context. Being an open standard means it's not tied to one company's models or platform. OpenAI has even started adopting MCP in its Agents SDK.

Q: Can I use MCP with frameworks like LangChain?

A: Yes, MCP is designed to complement frameworks like LangChain or LlamaIndex. Instead of relying solely on custom connectors within these frameworks, you can use MCP as a standardized bridge to connect to various tools and data sources. There's potential for interoperability, like converting MCP tools into LangChain tools.

Q: Why was MCP created? What problem does it solve?

A: It was created because large language models often lack real-time information and connecting them to external data/tools required custom, complex integrations for each pair. MCP solves this by providing a standard way to connect, reducing development time, complexity, and cost, and enabling better interoperability between different AI models and tools.

Q: Is MCP secure? What are the main risks?

A: Security is a major consideration. While MCP includes principles like user consent and control, risks exist. These include potential server compromises leading to token theft, indirect prompt injection attacks, excessive permissions, context data leakage, session hijacking, and vulnerabilities in server implementations. Implementing robust security measures like OAuth 2.1, TLS, strict permissions, and monitoring is crucial.

Q: Who is behind MCP?

A: MCP was initially developed and open-sourced by Anthropic. However, it's an open standard with active contributions from the community, including companies like Microsoft and VMware Tanzu who maintain official SDKs.

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!