| name | m365-copilot-chat |
| description | Automate Microsoft 365 Copilot Chat via Playwright browser automation.
Open M365 Chat, select agents (Cowork, Researcher, Analyst, Sales), send prompts, read responses.
USE FOR: m365 chat, copilot chat, cowork agent, summarize emails, draft standup, organize inbox, meeting prep.
DO NOT USE FOR: non-browser tasks, Azure resource management, local file operations.
|
M365 Copilot Chat Automation
Interact with Microsoft 365 Copilot Chat through Playwright MCP browser automation.
Prerequisites
- Playwright MCP Bridge browser extension installed in Edge
PLAYWRIGHT_MCP_EXTENSION_TOKEN configured in MCP server env
- MCP server running with
--extension flag
- User already signed into M365 in Edge
Core Workflow
1. Open M365 Chat
browser_navigate to https://m365.cloud.microsoft/chat
Wait for the page to load. Take a snapshot to verify the "Message Copilot" input is visible.
2. Select an Agent
Available agents appear in the left sidebar under "Agents":
| Agent | Purpose |
|---|
| Cowork | Daily productivity — emails, calendar, standups, inbox triage |
| Researcher | Deep research and analysis across web and work data |
| Analyst | Data analysis, charts, spreadsheet insights |
| Sales | CRM, pipeline, customer intelligence |
Click the agent name in the sidebar. Wait for the agent's UI to load (header changes to agent name).
3. Send a Prompt
- Snapshot the page to get the current input field ref
- Click the input field (labeled "Message Copilot" or "How can I help you today?")
- Fill the input with your prompt text
- Press Enter to send
4. Wait and Read Response
Copilot responses take 20-50 seconds to complete. After sending:
- Wait at least 25 seconds before taking a snapshot
- Take a snapshot and check if the response is fully rendered
- If the response shows "Generating..." or a spinner, wait another 15 seconds and snapshot again
- The response appears below the sent message in the chat thread
5. Follow-up Messages
For subsequent messages in the same conversation:
- Snapshot the page to get the LATEST input field ref (it changes between interactions)
- Click the new input field
- Fill and Press Enter as before
Timing Guidelines
| Action | Wait Time |
|---|
| Page load after navigate | 5 seconds |
| Agent selection | 3 seconds |
| Simple response (email summary) | 25 seconds |
| Complex response (multi-step task) | 45 seconds |
| Follow-up in same conversation | 25 seconds |
Example Prompts by Agent
Cowork
- "Summarize my unread emails from today"
- "What meetings do I have for the rest of this week?"
- "Draft a 5-sentence standup update based on my recent activity"
- "Organize my inbox by priority"
Researcher
- "Research the latest trends in AI agent frameworks"
- "Find information about [topic] from my work documents"
Analyst
- "Analyze the data in [spreadsheet name]"
- "Create a chart from my recent sales numbers"
Important Notes
- Always use
--extension mode to reuse the logged-in browser session
- The chat input ref changes between messages — always snapshot before filling
- M365 uses Content Security Policy (CSP) restrictions; the
playwright-config.json includes Edge flags to bypass these
- If a response shows "Error" status for some API calls, Copilot may still produce useful output by retrying with different approaches