Agent skill · software engineering · aiskillstore

m365-agents-py

Microsoft 365 Agents SDK for Python. Build multichannel agents for Teams/M365/Copilot Studio with aiohttp hosting, AgentApplication routing, streaming responses, and MSAL-based auth. Triggers: "Microsoft 365 Agents SDK", "microsoft_agents", "AgentApplication", "start_agent_process", "TurnContext", "Copilot Studio client", "CloudAdapter".

Why this skill is useful

Provides specific integration patterns and commands for building Microsoft 365 agents that the AI wouldn't reliably generate on its own.

What it needs

Requires aiohttp, microsoft-agents-activity, microsoft-agents-authentication-msal, microsoft-agents-copilotstudio-client, microsoft-agents-hosting-aiohttp, microsoft-agents-hosting-core, python-dotenv installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Microsoft 365 Agents SDK (Python) Build enterprise agents for Microsoft 365, Teams, and Copilot Studio using the Microsoft Agents SDK with aiohttp hosting, AgentApplication routing, streaming responses, and MSAL-based authentication. Before implementation Use the microsoft-docs MCP to verify the latest API signatures for AgentApplication, startagentprocess, and authentication options. Confirm package versions on PyPI for the microsoft-agents- packages you plan to use. Important Notice - Import Changes ⚠️ Breaking Change: Recent updates have changed the Python import structure from microsoft.agents to microsoftagents (using underscores instead of dots). Installation Environment Variables (.env) Core Workflow: aiohttp-hosted AgentApplication AgentApplication Routing Streaming Responses with Azure OpenAI OAuth / Auto Sign-In Copilot Studio Client (Direct to Engine) Best Practices 1. Use microsoftagents import prefix (underscores, not dots). 2. Use MemoryStorage only for development; use BlobStorage or CosmosDB in production. 3. Always use loadconfigurationfromenv(environ) to load SDK configuration. 4. Include jwtauthorizationmiddleware in aiohttp Application middlewares. 5. Use MsalConnectionManager for MSAL-based authentication. 6. Call endstream() in finally blocks when using streaming responses. 7. Use authhandlers parameter on message decorators for OAuth-protected routes. 8. Keep secrets in environment variables, not in source code. Reference Files File Contents --- --- references/acceptance-criteria.md Import paths, hosting pipeline, streaming, OAuth, and Copilot Studio patterns Reference Links Resource URL --- --- Microsoft 365 Agents SDK https://learn.microsoft.com/en-us/microsoft-365/agents-sdk/ GitHub samples (Python) https://github.com/microsoft/Agents-for-python PyPI packages https://pypi.org/search/?q=microsoft-agents Integrate with Copilot Studio https://learn.microsoft.com/en-us/microsoft-365/agents-sdk/integrate-with-mcs

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/m365-agents-py

View the source on GitHub

Browse the @skills marketplace