m365-agents-py

Host Python-based Microsoft 365 agents with aiohttp, MSAL authentication, and streaming responses.

2.9k|323|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/microsoft/skills --skill m365-agents-py-microsoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: m365-agents-py
Source: https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-python/skills/m365-agents-py
Command: npx skills add https://github.com/microsoft/skills --skill m365-agents-py-microsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable Python-based Microsoft 365 agents that run with hosting, routing, streaming responses, and MSAL authentication across Teams, Copilot Studio, and M365 environments.

Core Features & Use Cases

  • aiohttp-hosted AgentApplication for scalable agent hosting.
  • OAuth / Auto Sign-In with MSAL for protected operations.
  • Streaming responses with Azure OpenAI for real-time interactions.
  • Copilot Studio client integration for direct-to-engine workflows.

Quick Start

Install the Python SDK packages and run the sample to start a Python-based Microsoft 365 agent.

Frequently Asked Questions about m365-agents-py

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Microsoft Teams agent with Python?▼

You can build a Teams agent with Python using an aiohttp-hosted AgentApplication that manages routing, environment configuration, and real-time streaming responses for enterprise M365 integrations.

What is MSAL authentication for M365 agents?▼

MSAL authentication for M365 agents provides OAuth and Auto Sign-In workflows to secure protected operations, ensuring valid identity tokens for enterprise applications interacting with Microsoft 365 environments.

Does aiohttp work with the M365 Agents SDK for Python?▼

Yes, aiohttp works with the M365 Agents SDK to provide scalable hosting for Python-based agents, managing asynchronous HTTP requests and routing for enterprise applications.

How do I stream responses from Azure OpenAI in a Teams bot?▼

Stream responses from Azure OpenAI in a Teams bot by configuring the Python agent application to process real-time interactions, enabling continuous data flow for direct-to-engine workflows.

Can I integrate Copilot Studio with a Python agent?▼

Yes, you can integrate Copilot Studio with a Python agent by configuring the client integration for direct-to-engine workflows, allowing the Python application to route and process interactions.

What are the limitations of using Python for M365 Copilot Studio integrations?▼

Limitations of using Python for M365 Copilot Studio integrations include managing asynchronous aiohttp hosting complexities and ensuring MSAL authentication workflows are correctly configured for protected enterprise operations.