# Microsoft Learn MCP server

> Gives AI clients semantic search over official Microsoft docs, page fetching as markdown, and Azure code sample lookup.

- Repository: https://github.com/MicrosoftDocs/mcp
- Page: https://hostedmcp.org/servers/microsoftdocs/mcp
- Official: yes
- Transport: stdio, remote
- Stars: 1986
- License: CC-BY-4.0
- Latest version: 1.0.0

## Install

### Claude Code

```sh
claude mcp add mcp -- npx -y @microsoft/learn-cli
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@microsoft/learn-cli"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@microsoft/learn-cli"
      ]
    }
  }
}
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@microsoft/learn-cli"
      ]
    }
  }
}
```

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp]
command = "npx"
args = ["-y", "@microsoft/learn-cli"]
```

### Gemini CLI (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@microsoft/learn-cli"
      ]
    }
  }
}
```

## Tools (3)

- `microsoft_docs_search`
- `microsoft_docs_fetch`
- `microsoft_code_sample_search`

## FAQ

### Do I need an API key or login to use the Microsoft Learn MCP server?

No. The server requires no API keys, logins, or sign-ups; you just add the remote endpoint to your client.

### What tools does the Microsoft Learn MCP server provide?

It exposes microsoft_docs_search for semantic doc search, microsoft_docs_fetch to convert a docs page to markdown, and microsoft_code_sample_search for official Microsoft/Azure code snippets.

### Can I limit token usage in search results?

Yes, append the maxTokenBudget query parameter to the endpoint URL to truncate response content to a token budget.

### Which clients support installing the Microsoft Learn MCP server?

It supports VS Code, GitHub Copilot CLI, Claude Desktop, Claude Code, Visual Studio, and Cursor, among other MCP clients.
