m365-agents-py
Skill by kursku
Guides developers through building Microsoft 365, Teams and Copilot Studio agents in Python with the Microsoft 365 Agents SDK. It covers aiohttp hosting, AgentApplication routing, streaming replies and MSAL-based auth.
Install m365-agents-py
Built from the published package, never by AI.
git clone --depth 1 https://github.com/kursku/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/packs/global-skillshare-import/wave-008/m365-agents-py ~/.claude/skills/m365-agents-pyRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/kursku/skills /tmp/skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills/packs/global-skillshare-import/wave-008/m365-agents-py ~/.gemini/antigravity-cli/skills/m365-agents-pyAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The m365-agents-py skill gives an AI assistant guidance for building agents for Microsoft 365, Microsoft Teams and Copilot Studio with the Microsoft 365 Agents SDK for Python. It covers installing the microsoft-agents packages, loading configuration from environment variables, and hosting an AgentApplication with aiohttp. The code samples show message, regex and conversation update routing, streaming replies from Azure OpenAI, and OAuth sign-in for Microsoft Graph.
Authentication uses MSAL through a connection manager and a JWT authorization middleware. The skill also includes a Copilot Studio client sample that connects directly to the agent engine. It is aimed at developers who build enterprise agents in Python. The source notes a breaking change from microsoft.agents to microsoft_agents imports and recommends checking current API signatures before implementing.
Written from the project's SKILL.md and checked against it.
What it can do
- AgentApplication routingRoutes incoming activities to handlers for messages, conversation updates, invokes and errors.
- aiohttp hostingHosts the agent on an aiohttp server with a /api/messages endpoint and JWT middleware.
- Streaming responsesStreams Azure OpenAI chunks to the user with feedback, AI label and sensitivity settings.
- MSAL authenticationSets up an MSAL connection manager for the agent's service connection.
- OAuth sign-inGets and signs out Microsoft Graph tokens for auth-protected message handlers.
- Copilot Studio clientStarts conversations and sends questions to a Copilot Studio agent directly.
What you need
- Python with pip
- Microsoft Entra app client ID, client secret and tenant ID
- Azure OpenAI endpoint and key for the streaming sample
- Copilot Studio environment ID and agent schema name for the client sample
Try asking
- Create a Teams agent in Python with AgentApplication routing and aiohttp
- Add streaming Azure OpenAI replies to my Microsoft 365 agent
- Set up OAuth sign-in for Microsoft Graph in my agent's /me command
Good to know
- The source notes a breaking change in Python import paths from microsoft.agents to microsoft_agents.
- The best practices say to use MemoryStorage only for development.
- The skill recommends verifying current API signatures and package versions before use.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: packs/global-skillshare-import/wave-008/m365-agents-py/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to m365-agents-py
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
m365-agents-py: common questions
Which Python import path should I use?
The source says to use the microsoft_agents prefix with underscores, not the older microsoft.agents with dots.
Is MemoryStorage fine for production?
No. The source says to use MemoryStorage only for development and BlobStorage or CosmosDB in production.
Can this skill connect to Copilot Studio?
Yes. It includes a Copilot Studio client sample that talks directly to the agent, using an environment ID, schema name and app ID from environment variables.
How do I install m365-agents-py?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is m365-agents-py free?
The code is public, but no licence file was found, so check the repository before commercial use.
Is m365-agents-py safe to use?
It scores 52 of 100. Grades: maintenance D, licence F, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to m365-agents-py?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
