Labsco
microsoftdocs logo

Microsoft Learn

β˜… 1,800

from microsoftdocs

Official Microsoft Learn MCP Server and CLI tool – powering LLMs and AI agents with real-time, trusted Microsoft docs & code samples.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

🌟 Microsoft Learn MCP Server

Install in VS Code Install in VS Code Insiders

Stop 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.

🌐 The Microsoft Learn MCP Server Endpoint

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:

Copy & paste β€” that's it
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 Allowed error 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:

Copy & paste β€” that's it
{
  "servers": {
    "microsoft-learn": {
      "type": "http",
      "url": "https://learn.microsoft.com/api/mcp"
    }
  }
}

For experimental features, see the Experimental Features section below.

πŸ§ͺ Experimental Features

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.

OpenAI-Compatible Endpoint

For applications that require OpenAI Deep Research model compatibility, you can use the OpenAI-compatible endpoint:

Copy & paste β€” that's it
https://learn.microsoft.com/api/mcp/openai-compatible

This endpoint supports OpenAI Deep Research models and follows the OpenAI MCP specification.

Token Budget Control

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.

Copy & paste β€” that's it
https://learn.microsoft.com/api/mcp?maxTokenBudget=2000

Note: These experimental features are subject to change. We welcome feedback through our GitHub Discussions.

πŸ› οΈ Currently Supported Tools

Tool NameDescriptionInput Parameters
microsoft_docs_searchPerforms semantic search against Microsoft official technical documentationquery (string): The search query for retrieval
microsoft_docs_fetchFetch and convert a Microsoft documentation page into markdown formaturl (string): URL of the documentation page to read
microsoft_code_sample_searchSearch for official Microsoft/Azure code snippets and examplesquery (string): Search query for Microsoft/Azure code snippets<br/>language (string, optional): Programming language filter.

πŸ’» Microsoft Learn CLI preview

npm version

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.

Copy & paste β€” that's it
# Run instantly (no install)
npx @microsoft/learn-cli search "azure functions timeout"

# Or install globally
npm install -g @microsoft/learn-cli
# then use `mslearn`
mslearn search "azure functions timeout"

Pass --json to get structured JSON output, useful for programmatic processing:

Copy & paste β€” that's it
mslearn search "azure openai" --json | jq '.results[].title'

See cli/README.md for the full command reference.

πŸ€– Agent Skills

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:

SkillPurposeBest For
microsoft-docsUnderstanding concepts, tutorials, architecture, limits"How does X work?", learning, configuration guides
microsoft-code-referenceAPI lookups, code samples, verification, error fixingImplementing code, finding correct methods, troubleshooting
microsoft-skill-creatorMeta-skill that generates custom agent skills for any Microsoft technologyCreating a skill to teach agents about a new Azure library, .NET feature, or other Microsoft tech

Quick Setup

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 command and restart Claude Code:

Copy & paste β€” that's it
/plugin install microsoft-docs@claude-plugins-official

Or if you use GitHub Copilot CLI, run this command:

Copy & paste β€” that's it
/plugin install microsoftdocs/mcp

Otherwise:

  1. Install the MCP Server first β€” See Installation below
  2. Copy the skill folders to your project's .github/skills/ or .claude/skills/ directory:

Supported Agents

Agent Skills work across multiple AI agents:

  • VS Code (Insiders) β€” enable chat.useAgentSkills setting
  • GitHub Copilot CLI & Copilot coding agent
  • Claude Code, Cursor, OpenAI Codex, and more

Which Skill Do I Need?

If you want to...Install
Cover all Microsoft docs scenariosAll 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 technologymicrosoft-skill-creator only

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.

Copy & paste β€” that's it

### ⚠️ Common Issues

| Issue | Possible Solution |
|-------|-------------------|
| Connection errors | Verify your network connection and that the server URL is correctly entered |
| No results returned | Try rephrasing your query with more specific technical terms |
| Tool not appearing in VS Code | Restart VS Code or check that the MCP extension is properly installed |
| HTTP status 405  | Method not allowed happens when a browser tries to connect to the endpoint. Try using the MCP Server through VS Code GitHub Copilot or [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) instead. |

### πŸ†˜ Getting Support

- [Ask questions, share ideas](https://github.com/MicrosoftDocs/mcp/discussions)
- [Create an issue](https://github.com/MicrosoftDocs/mcp/issues)

## πŸ“š Additional Resources

- [Microsoft Learn MCP Server product documentation](https://learn.microsoft.com/training/support/mcp)
- [Microsoft MCP Servers](https://github.com/microsoft/mcp)
- [Microsoft Learn](https://learn.microsoft.com)
- [Model Context Protocol Specification](https://modelcontextprotocol.io)
- [Microsoft Learn Terms of Use](https://learn.microsoft.com/legal/termsofuse)