Blog Post

Microsoft Developer Community Blog
3 MIN READ

Use Copilot and MCP to query Microsoft Learn Docs

carlottacaste's avatar
carlottacaste
Icon for Microsoft rankMicrosoft
Sep 23, 2025

Are you ready to take your Azure development workflow to the next level? In this post, we’ll walk through how to use GitHub Copilot in Agent Mode—paired with MCP (Model Context Protocol)—to get trusted, grounded answers from Microsoft Learn Docs, right inside your coding workspace.

Are you ready to take your Azure development workflow to the next level? In this post, we’ll walk through how to use GitHub Copilot in Agent Mode—paired with MCP (Model Context Protocol) servers—to get trusted, grounded answers from Microsoft Learn Docs, right inside your coding workspace.

Whether you’re tired of switching tabs to search documentation or want to ensure your AI assistant’s answers are always accurate, this guide will show you how to streamline your workflow and boost your productivity.

TL;DR

Watch the video tutorial:

🚀 Why Use Copilot with MCP Servers?

Have you ever asked your AI assistant about Microsoft technologies and wondered if the answer was truly reliable? With MCP, you can connect Copilot directly to official Microsoft documentation—no more second-guessing or uploading your own grounding data.

🔌 What is MCP (Model Context Protocol)?

MCP is a standardized protocol that allows AI tools to connect seamlessly with external data, tools, and resources—without custom integrations. Here’s how it works:

  • Hosts: AI tools or environments (like VS Code or Copilot Studio) that initiate data access.
  • Clients: Protocol clients (like GitHub Copilot) that manage connections with servers.
  • Servers: Lightweight programs that expose specific capabilities (tools, resources, prompts) through MCP.

You can browse available MCP servers—including the Microsoft Docs MCP Server—at https://code.visualstudio.com/mcp.

🛠️ Installing and Using the Microsoft Docs MCP Server in VS Code

  1. Find the Server: Visit the MCP server list and locate the Microsoft Docs MCP Server.
  2. Install: Click the blue 'Install' button to add it to VS Code.
  3. Activate Agent Mode: In VS Code, open GitHub Copilot chat, switch to Agent Mode, and select your preferred model (e.g., GPT-5).
  4. Enable the Server: Expand the tools to ensure the MCP server is installed and enabled.
  5. Ask Away: Try a question like, “Does Azure AI Foundry offer a Python SDK?” Copilot will route your query to the MCP server and return grounded answers from Microsoft Learn Docs—so you know you’re getting the real deal. You'll see that Copilot will ask permission to use the 'microsoft_docs_search' tool offered by the MCP server. Click on 'Allow' to let it proceed.  

📂 Grounding Azure Queries with Prompt Files

To make sure your Azure and Microsoft tech-related queries always use the Microsoft Docs MCP Server, leverage the Prompt Files feature in Copilot Agent Mode:

  • Click the settings icon, then 'Prompt Files', and define a new markdown file (e.g., msdocs-assistant.prompt.md).
  • Add your guidelines or instructions, including the ask to always use the Microsoft Docs MCP server when answering Microsoft tools-related questions.
  • You can set prompt files at the user profile (default option) or workspace level for maximum flexibility.

🐍 Going Further: Build a Custom Python Client

Want even more control? You can build a custom Python client to invoke the Microsoft Docs MCP server directly via streamable http. This approach gives you maximum flexibility and lets you overcome product-specific constraints.

  • Create a new chat in Copilot and configure your model.
  • Provide instructions to create a Python client that queries the MCP server - to explore tools and resources - and performs a test call.
  • Review Copilot code and make adjustments if needed
  • Create a virtual environment and install the required packages to execute the Python MCP client - pip install "mcp[cli]"
  • Test the client 
  • Optionally, commit your code to a GitHub repo for version control. TIP: GitHub Copilot can help with this task as well!

🎬 Useful Resources

  1. Watch the whole step-by-step video tutorial: Use Copilot and MCP to query Microsoft Learn Docs - YouTube
  2. Review my instruction files and MCP client code in this repo (DISCLAIMER: all the files in the repo have been created by using GitHub Copilot)
  3. Check the whole video series, for more tips and tricks about using GitHub Copilot in VS Code to boost your developer workflow: https://aka.ms/Prompt-DrivenDevelopment/Playlist
  4. New to MCP? Complete the MCP for Beginners course at https://aka.ms/mcp-for-beginners 

 

 

Updated Sep 26, 2025
Version 3.0
No CommentsBe the first to comment