Skip to main content
Microsoft’s official Learn MCP server provides tools to search and fetch current content from Microsoft Learn — Azure, .NET, C#, and the rest. Free, no authentication. The reason to use it is not convenience. Cloud APIs move faster than model training runs, so an ungrounded answer about Azure authentication is a guess with a citation-shaped confidence. This server replaces the guess with the current page.

Prerequisites

  • Python 3.10+
  • A Groq API key (free tier available at console.groq.com). Any tool-calling model works.
This tutorial deliberately uses an open-weight model on Groq to make a point: the value here comes from the retrieved documentation, not from the model’s parametric knowledge. A smaller model with the right page in front of it beats a larger one working from memory.

Build it

1

Install and set your key

2

Create the agent

3

Ask a question whose answer has changed recently

Authentication guidance is a good test case precisely because it is the kind of thing models get confidently wrong from stale training data.
4

Verify it actually searched

Set verbose=True on the agent while you are developing. You will see the tool calls in the log — if there are none, the model answered from memory and the grounding did not happen.

The complete script

Making grounding stick

Three prompt-level habits, in the order they pay off:
  1. Say what to do when the search fails. “If the docs do not cover it, say so” prevents the most common failure — a plausible answer assembled from training data after an empty search.
  2. Ask for the URL, not just the claim. A cited answer is checkable; an uncited one is not.
  3. Give it two loops. Search results often need a follow-up fetch before the answer is complete.

Next