Get the FREE Ultimate OpenClaw Setup Guide →

mcp

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

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio microsoftdocs-mcp npx -y microsoft-learn-mcp

How to use

This MCP server provides access to Microsoft Learn documentation through the MCP protocol. It exposes tools that let clients perform semantic searches against official Microsoft documentation, fetch specific docs in Markdown, and locate relevant code samples from Microsoft sources. Clients can connect to the remote endpoint https://learn.microsoft.com/api/mcp and issue requests using the standard MCP schema. The included tools include: microsoft_docs_search for semantic retrieval of official docs based on a query, microsoft_docs_fetch to fetch a specific documentation page and render it in Markdown, and microsoft_code_sample_search to discover official code snippets and examples across Microsoft/Azure documentation. Use these tools to obtain accurate, up-to-date Microsoft Learn content and verified code samples, reducing hallucinations and ensuring sources come from official docs.

How to install

Prerequisites:

  • Node.js and npm/yarn (for running MCP via npx or npm packages)
  • A compliant MCP client or IDE integration that supports the MCP protocol

Installation steps:

  1. Ensure Node.js is installed. Verify with: node -v npm -v

  2. Install and run the MCP server package via npx (as recommended in the repository): npx -y microsoft-learn-mcp

    This will launch or set up the MCP server configuration to connect to the Microsoft Learn MCP endpoint at https://learn.microsoft.com/api/mcp.

  3. If you prefer a global install (alternative): npm install -g microsoft-learn-mcp microsoft-learn-mcp

  4. Configure your MCP client to point to the remote endpoint: servers: microsoft-learn: { "type": "http", "url": "https://learn.microsoft.com/api/mcp" }

  5. Validate by issuing a basic query via your MCP client, for example requesting a search or a fetch operation to ensure connectivity.

Optional: If your workflow uses VS Code or another IDE plugin, follow the plugin’s setup flow to register the MCP endpoint above as the active remote server.

Additional notes

Tips and notes:

  • The endpoint https://learn.microsoft.com/api/mcp is designed for compliant MCP clients; attempting to access it directly in a browser may yield a 405 error.
  • Experimental features may change. If you enable maxTokenBudget in the query, content will be truncated to respect the specified token limit.
  • Use the provided tools (microsoft_docs_search, microsoft_docs_fetch, microsoft_code_sample_search) to maximize accuracy and minimize hallucinations by pulling data directly from official Microsoft Learn sources.
  • This configuration uses an MCP server alias microsoft-learn-mcp; adapt the alias as needed for your environment or client configuration.
  • If you run into connectivity issues, ensure that network egress to learn.microsoft.com is allowed and that your MCP client is compliant with the model context protocol.

Related MCP Servers

Sponsor this space

Reach thousands of developers