Official Microsoft Learn MCP Server – powering LLMs and AI agents with real-time, trusted Microsoft docs & code samples.
# Add to your Claude Code skills
git clone https://github.com/MicrosoftDocs/mcpStop AI Hallucinations. Give your AI assistant (Claude, Cursor, Copilot, Codex, ...) direct access to the latest official Microsoft documentation.
✨ Free. One-click install. No key needed.
Stop relying on outdated training data or risky web searches. Learn MCP server provides secure, direct access to Microsoft official docs.
🧠 Eliminate Hallucinations. Stop your AI from inventing non-existent Azure SDK methods or hallucinating library packages. Get code that actually compiles.
🔌 Plug & Play (No Auth). No API keys, no logins, no sign-ups required. Just one-click install and start coding immediately.
🛡️ 100% Trusted & Safe. Protect your supply chain. Unlike generic web searches that may scrape insecure blogs or malicious sites, this tool only accesses official 1st-party Microsoft documentation.
💸 Completely Free. High search capacity tailored for seamless, heavy coding sessions.
No comments yet. Be the first to share your thoughts!
Your AI assistant should automatically use these tools for Microsoft-related topics. With both search and fetch capabilities, you can get quick answers or comprehensive deep dives. To ensure that it always consults the official documentation, you can add phrases like search Microsoft Learn, deep dive, fetch full doc.
"Give me the Azure CLI commands to create an Azure Container App with a managed identity. search Microsoft Learn"
"Is gpt-4.1-mini available in EU regions? fetch full doc"
"Are you sure this is the right way to implement
IHttpClientFactoryin a .NET 8 minimal API? search Microsoft Learn and fetch full doc"
"Show me the complete guide for implementing authentication in ASP.NET Core. fetch full doc"
"show me detailed, runnable python code sample to do harms eval using azure ai foundry evaluation sdk"
"I need to understand Azure Functions end-to-end. search Microsoft Learn and deep dive"
"Get me the full step-by-step tutorial for deploying a .NET application to Azure App Service. search Microsoft Learn and deep dive"
The Microsoft Learn MCP Server is accessible to any IDE, agent, or tool that supports the Model Context Protocol (MCP). Any compatible client can connect to the following remote MCP endpoint:
https://learn.microsoft.com/api/mcp
Note: This URL is intended for use within a compliant MCP client via Streamable HTTP, such as the recommended clients listed in our Getting Started section. It does not support direct access from a web browser and may return a
405 Method Not Allowederror if accessed manually. For developers who need to build their own solution, please follow the mandatory guidelines in the Building a Custom Client section to ensure your implementation is resilient and supported.
Standard config works in most clients:
{
"servers": {
"microsoft-learn": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
}
}
}
For experimental features, see the Experimental Features section below.
The Microsoft Learn MCP Server offers experimental features that are under active development. These features may change or be refined based on user feedback and usage patterns.
For applications that require OpenAI Deep Research model compatibility, you can use the OpenAI-compatible endpoint:
https://learn.microsoft.com/api/mcp/openai-compatible
This endpoint supports OpenAI Deep Research models and follows the OpenAI MCP specification.
To manage token usage and control costs, you can append the maxTokenBudget query parameter to the MCP endpoint URL. This parameter limits the token count in search tool responses by truncating the content to meet your specified budget.
https://learn.microsoft.com/api/mcp?maxTokenBudget=2000
Note: These experimental features are subject to change. We welcome feedback through our GitHub Discussions.
| Tool Name | Description | Input Parameters |
|-----------|-------------|------------------|
| microsoft_docs_search | Performs semantic search against Microsoft official technical documentation | query (string): The search query for retrieval |
| microsoft_docs_fetch | Fetch and convert a Microsoft documentation page into markdown format | url (string): URL of the documentation page to read |
| microsoft_code_sample_search | Search for official Microsoft/Azure code snippets and examples | query (string): Search query for Microsoft/Azure code snippetslanguage (string, optional): Programming language filter.|
The @microsoft/learn-cli package gives you terminal access to the same tools — search docs, fetch pages, and find code samples — without an MCP client.
# Run instantly (no install)
npx @microsoft/learn-cli search "azure functions timeout"
# Or install globally
npm install -g @microsoft/learn-cli
mslearn search "azure functions timeout"
mslearn code-search "BlobServiceClient" --language python
mslearn fetch "https://learn.microsoft.com/azure/azure-functions/functions-versions"
Pass --json to get raw JSON output for piping to other tools:
mslearn search "azure openai" --json | jq '.results[].title'
See cli/README.md for the full command reference.
Agent Skills are portable instruction packages that help AI agents use tools more effectively. We provide three skills that guide agents on when and how to use the Microsoft Learn MCP tools:
| Skill | Purpose | Best For |
|-------|---------|----------|
| microsoft-docs | Understanding concepts, tutorials, architecture, limits | "How does X work?", learning, configuration guides |
| microsoft-code-reference | API lookups, code samples, verification, error fixing | Implementing code, finding correct methods, troubleshooting |
| microsoft-skill-creator | Meta-skill that generates custom agent skills for any Microsoft technology | Creating a skill to teach agents about a new Azure library, .NET feature, or other Microsoft tech |
These agent skills are packed in a microsoft-docs plugin together with the Learn MCP server itself. If you use Claude Code, run the following commands and restart Claude Code:
/plugin marketplace add microsoftdocs/mcp
/plugin install microsoft-docs@microsoft-docs-marketplace
Or if you use GitHub Copilot CLI, run this command:
/plugin install microsoftdocs/mcp
Otherwise:
.github/skills/ or .claude/skills/ directory:
microsoft-docs — for concepts, tutorials, and factual lookupsmicrosoft-code-reference — for API lookups, code samples, and troubleshootingmicrosoft-skill-creator — meta-skill for generating custom skills about Microsoft technologiesAgent Skills work across multiple AI agents:
chat.useAgentSkills setting| If you want to... | Install |
|-------------------|---------|
| Cover all Microsoft docs scenarios | All three skills |
| Focus on coding (APIs, samples, errors) | microsoft-code-reference only |
| Focus on facts & concepts (limits, config, tutorials) | microsoft-docs only |
| Generate a custom skill for a specific Microsoft technology | microsoft-skill-creator only |
The Microsoft Learn MCP Server supports quick installation across multiple development environments. Choose your preferred client below for streamlined setup:
| Client | One-click Installation | MCP Guide | |--------|----------------------|-------------------| | VS Code | [![Install in VS Code](https://img.shields.io/b