Microsoft Docs logo

Microsoft Docs

OrganizationPopular
MicrosoftDocs

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

PublisherMicrosoftDocs
Repositorymcp
LanguageTypeScript
Forks
190
Stars
1.6K
Available tools
3
Transport typestreamable-http
Categories
LicenseCC-BY-4.0
Links
  • Connect tools to AI workflows

    Microsoft Docs exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 3 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    1.6K stars and 190 forks from the linked repository.

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

🎯 Why install this?

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.

✨ Example Prompts

"Give me the Azure CLI commands to create an Azure Container App with a managed identity."

"Is gpt-5.4 available in Azure EU regions?"

"Are you sure this is the right way to implement IHttpClientFactory in a .NET 8 minimal API?"

"Show me runnable Python code to do harms eval using the Azure AI Foundry evaluation SDK."

🌐 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:

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:

json
{
  "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:

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.

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 snippetslanguage (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.

sh
# 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:

sh
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:

/plugin install microsoft-docs@claude-plugins-official

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

/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

🔌 Installation & Getting Started

The Microsoft Learn MCP Server supports quick installation across multiple development environments. Choose your preferred client below for streamlined setup:

ClientOne-click InstallationMCP Guide
VS CodeInstall in VS Code or search "@mcp learn" in Extensions to show "Microsoft Learn" MCPVS Code MCP Official Guide
GitHub Copilot CLI/plugin install microsoftdocs/mcp
Claude DesktopFollow "Add custom connector" instructions in official guide.Claude Desktop Remote MCP Guide
Claude Code/plugin install microsoft-docs@claude-plugins-official (includes MCP server + skills)Claude Code Remote MCP Guide
Visual StudioUpgrade to latest VS 2022 or 2026, "Microsoft Learn" MCP is already built-inVisual Studio MCP Official Guide
Cursor IDEInstall in CursorCursor MCP Official Guide
Codexcodex mcp add "microsoft-learn" --url "https://learn.microsoft.com/api/mcp"Codex MCP documentation
Roo CodeOpen Roo Code Marketplace, search for Microsoft Learn, and click InstallRoo Code MCP Official Guide
ClineManual configuration requiredUse "type": "streamableHttp"Cline MCP Official Guide
Gemini CLIManual configuration required View ConfigNote: Add an mcpServer object to .gemini/settings.json file{ "Microsoft Learn MCP Server": { "httpUrl": "https://learn.microsoft.com/api/mcp" }}How to set up your MCP server
Qwen CodeManual configuration required View ConfigNote: Add an mcpServer object to .qwen/settings.json file{ "Microsoft Learn MCP Server": { "httpUrl": "https://learn.microsoft.com/api/mcp" }}Configure the MCP server in settings.json
GitHubManual configuration required View ConfigNote: Navigate to Settings → Coding agent{ "mslearn": { "type": "http", "url": "https://learn.microsoft.com/api/mcp", "tools": [ "*" ] }}
ChatGPTManual configuration required View Instructions1. Open ChatGPT in the browser2. Go to Settings → Connectors → Advanced settings → Turn Developer mode on3. Go back to connectors and click create4. Give the connector a name, enter URL https://learn.microsoft.com/api/mcp, set authentication to No authentication and trust the application5. Click create ChatGPT Official Guide
WindsurfManual configuration required View Config{ "mcpServers": { "microsoft-learn": { "serverUrl": "https://learn.microsoft.com/api/mcp" } }}Windsurf MCP Guide
KiroView Config{ "microsoft-learn": { "url": "https://learn.microsoft.com/api/mcp" }} Kiro MCP Guide

⚠️ Building a Custom Client

If your use case requires a direct, programmatic integration, it is essential to understand that MCP is a dynamic protocol, not a static API. The available tools and their schemas will evolve.

To build a resilient client that will not break as the service is updated, you should adhere to the following principles:

  1. Discover Tools Dynamically: Your client should fetch current tool definitions from the server at runtime (e.g., using tools/list). Do not hard-code tool names or parameters.
  2. Refresh on Failure: Your client should handle errors during tool/invoke calls. If a tool call fails with an error indicating it is missing or its schema has changed (e.g., an HTTP 404 or 400 error), your client should assume its cache is stale and automatically trigger a refresh by calling tools/list.
  3. Handle Live Updates: Your client should listen for server notifications (e.g., listChanged) and refresh its tool cache accordingly.

❓ Troubleshooting

💻 System Prompt

Even tool-friendly models like Claude Sonnet 4 sometimes fail to call MCP tools by default; use system prompts to encourage usage.

Here's an example of a Cursor rule (a system prompt) that will cause the LLM to utilize microsoft-learn more frequently:

md
## 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.

⚠️ Common Issues

IssuePossible Solution
Connection errorsVerify your network connection and that the server URL is correctly entered
No results returnedTry rephrasing your query with more specific technical terms
Tool not appearing in VS CodeRestart VS Code or check that the MCP extension is properly installed
HTTP status 405Method 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 instead.

🆘 Getting Support

📚 Additional Resources

Installation

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

Available Tools

  • microsoft_docs_search

    Search official Microsoft/Azure documentation to find the most relevant and trustworthy content for a user's query. This tool returns up to 10 high-quality content chunks (each max 500 tokens), extracted from Microsoft Learn and other official sources. Each result includes the article title, URL, and a self-contained content excerpt optimized for fast retrieval and reasoning. Always use this tool to quickly ground your answers in accurate, first-party Microsoft/Azure knowledge.

    The question parameter is no longer used, use query instead.

    Follow-up Pattern

    To ensure completeness, use microsoft_docs_fetch when high-value pages are identified by search. The fetch tool complements search by providing the full detail. This is a required step for comprehensive results.

  • microsoft_code_sample_search

    Search for code snippets and examples in official Microsoft Learn documentation. This tool retrieves relevant code samples from Microsoft documentation pages providing developers with practical implementation examples and best practices for Microsoft/Azure products and services related coding tasks. This tool will help you use the LATEST OFFICIAL code snippets to empower coding capabilities.

    When to Use This Tool

    • When you are going to provide sample Microsoft/Azure related code snippets in your answers.
    • When you are generating any Microsoft/Azure related code.

    Usage Pattern

    Input a descriptive query, or SDK/class/method name to retrieve related code samples. The optional parameter language can help to filter results.

    Eligible values for language parameter include: csharp javascript typescript python powershell azurecli al sql java kusto cpp go rust ruby php

  • microsoft_docs_fetch

    Fetch and convert a Microsoft Learn documentation page to markdown format. This tool retrieves the latest complete content of Microsoft documentation pages including Azure, .NET, Microsoft 365, and other Microsoft technologies.

    When to Use This Tool

    • When search results provide incomplete information or truncated content
    • When you need complete step-by-step procedures or tutorials
    • When you need troubleshooting sections, prerequisites, or detailed explanations
    • When search results reference a specific page that seems highly relevant
    • For comprehensive guides that require full context

    Usage Pattern

    Use this tool AFTER microsoft_docs_search when you identify specific high-value pages that need complete content. The search tool gives you an overview; this tool gives you the complete picture.

    URL Requirements

    • The URL must be a valid link from the microsoft.com domain.

    Output Format

    markdown with headings, code blocks, tables, and links preserved.

Use Microsoft Docs MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Microsoft Docs is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP connects through a hosted MCP server URL in TypingMind.

Add an MCP server URL

Use this when Microsoft Docs is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter https://learn.microsoft.com/api/mcp in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste https://learn.microsoft.com/api/mcp into the Server URL field.
  2. Enter a connection name for Microsoft Docs.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Microsoft Docs connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Microsoft Docs tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Microsoft Docs tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Microsoft Docs to help me with this task?
Microsoft Docs
Sure. I read it.
Here is what I found using Microsoft Docs.

Frequently asked questions

What is the Microsoft Docs MCP server used for?

Microsoft Docs is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Microsoft Docs MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Microsoft Docs with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Microsoft Docs MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Microsoft Docs connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Microsoft Docs MCP to TypingMind?

Microsoft Docs can be connected in TypingMind by adding its hosted MCP server URL. This is useful when you want a remote MCP connection that is available from your TypingMind workspace.

What tools does Microsoft Docs MCP provide in TypingMind?

Microsoft Docs exposes 3 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Microsoft Docs MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Microsoft Docs requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇