Share via


Get started with the Microsoft Learn MCP Server

This article assists you in getting started using the Microsoft Learn Model Context Protocol (MCP) Server with GitHub Copilot in Visual Studio (VS) Code. If you are new to the MCP server, we recommend that you review the Learn MCP Server overview article first. Note that although VS Code is a common client for Learn MCP Server, MCP is an open protocol and as such is supported by many clients including agents in Copilot Studio, in Foundry, and many other agentic IDEs.

The high-level process we walk through is:

  1. Configure your editor
  2. Use the MCP server
  3. Set instructions

When you use another agentic development environment, the details may vary but the process should be comparable. See configuration options for other client apps in the GitHub repository.

Prerequisites

In order to follow the steps in this article, you need Visual Studio Code and GitHub Copilot.

Configure your editor

The easiest way to configure Learn MCP Server is using these buttons.

Install in VS Code Install in Visual Studio

MCP Servers can be configured at the user level and the workspace level. User settings are applied to every VS Code session, which is convenient when you mostly work with Microsoft technologies. You can also configure MCP settings for workspaces that use Microsoft technologies, and configure other MCP Servers for workspaces that don't.

For more details, see Learn MCP - Installation and getting started

Use MCP Server

  1. Open chat
  2. Select agent mode
  3. Ask a question relevant to Microsoft Learn content, for instance: How to create a Microsoft Foundry instance using az cli?
  4. Allow the agent to use the MCP server
  5. Get the response

When the AI agent doesn't use the MCP tool when expected, it may be useful to configure specific instructions for the tool:

  1. Open a chat window in VS Code with GitHub Copilot
  2. Select agent mode
  3. At the top of the window, click the settings wheel and select Instructions
  4. Select a location to create the instructions file
  5. Provide instructions like:
---
applyTo: '**'
---
## 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.

Next steps

You can learn more about the Learn MCP Server by visiting the following links: