Microsoft Agent Framework: build a Python agent with MCP

Learn Python tool calling, inspect agents in DevUI, and connect an expense-tracking MCP server running on localhost:8000.

Player not loading? Watch on YouTube

This tutorial builds a Python AI agent with Microsoft Agent Framework, starting with tool calling and ending with a supervisor that delegates to specialist agents. The presenter first uses the OpenAI SDK to explain the underlying exchange: the model suggests a function and arguments, application code executes it, and the result goes back to the model.

The framework examples replace manual schema handling with decorated Python functions. Type annotations, parameter descriptions and docstrings describe the tools to the model. A weekend planner then combines date, weather and activity tools. These are demonstration functions, and the weather responses use fixed or randomized data rather than a live forecast.

DevUI provides a browser interface for testing prompts and inspecting tool calls, events and token usage. The MCP example connects an expense tracker built with FastMCP at localhost:8000. A separate example queries the remote Microsoft Learn server. The presenter warns that large tool schemas can exceed GitHub Models input limits.

The walkthrough uses hosted models through GitHub Models or Azure, so its local tools do not establish offline model inference. Dependencies are pinned to a Git commit during the framework's prerelease period. Later examples cover middleware for logging or blocking requests, then wrap meal and weekend planners as tools for a supervisor. The presenter limits that simple routing pattern to tasks with clear specialist boundaries.