Skip to content

Commit f4d6f5b

Browse files
Add extendToM365 lifecycle guidance to m365-agent-developer skill
- Add 'Scaffold the Agent Project First' section to mcp-plugin.md with the 5 required lifecycle steps (especially teamsApp/extendToM365) - Add Step 0 to the MCP plugin workflow checklist - Add M365_TITLE_ID / extendToM365 warning to deployment.md Co-authored-by: Copilot <[email protected]>
1 parent 396d50b commit f4d6f5b

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

plugins/m365-agents-toolkit/skills/m365-agent-developer/references/deployment.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ atk provision --env custom
6666
- Generates `M365_TITLE_ID` and adds to env file
6767
- Sets up authentication and permissions
6868

69+
> **⚠️ `M365_TITLE_ID` requires `teamsApp/extendToM365`:** The `M365_TITLE_ID` environment variable is generated by the `teamsApp/extendToM365` lifecycle step during provisioning. Without this step, the Teams app registers but the agent will **not** appear in Copilot Chat. If you scaffolded the project with `atk new`, this step is included automatically. If you set up the project manually, verify that your `m365agents.yml` includes the `teamsApp/extendToM365` lifecycle action — see the [mcp-plugin.md scaffold section](mcp-plugin.md#scaffold-the-agent-project-first) for the required lifecycle steps.
70+
6971
**⚠️ CRITICAL: ALWAYS RENDER THIS AFTER ANY PROVISION OPERATION ⚠️**
7072

7173
After EVERY provisioning command (regardless of environment or whether it's first-time or re-provisioning), you MUST render this output:

plugins/m365-agents-toolkit/skills/m365-agent-developer/references/mcp-plugin.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,33 @@ MCP servers expose tools that can be consumed by your agent. Unlike OpenAPI-base
1717

1818
---
1919

20+
## Scaffold the Agent Project First
21+
22+
Before adding an MCP plugin, you **must** have a scaffolded agent project. Run `atk new` if you haven't already:
23+
24+
```bash
25+
npx -p @microsoft/m365agentstoolkit-cli@latest atk new \
26+
-n my-agent \
27+
-c declarative-agent \
28+
-i false
29+
```
30+
31+
This creates `m365agents.yml` (and `m365agents.local.yml`) with the **5 required lifecycle steps**:
32+
33+
| Step | Lifecycle Action | What it does |
34+
|------|-----------------|--------------|
35+
| 1 | `teamsApp/create` | Registers the Teams app |
36+
| 2 | `teamsApp/zipAppPackage` | Packages manifest + icons into a zip |
37+
| 3 | `teamsApp/validateAppPackage` | Validates the package (icons, schema, etc.) |
38+
| 4 | `teamsApp/update` | Uploads the package to Teams |
39+
| 5 | `teamsApp/extendToM365` | **Extends the app to M365 Copilot** — generates `M365_TITLE_ID` |
40+
41+
**What breaks without `extendToM365`:** If this step is missing, `atk provision` will register the Teams app and generate `TEAMS_APP_ID`, but the agent will **never appear in Copilot Chat** because no `M365_TITLE_ID` is generated. This is the most common reason for "provision succeeded but agent not found" failures.
42+
43+
> **If you already have a project** but are missing `teamsApp/extendToM365`, add it to the `provision` lifecycle in `m365agents.yml` after `teamsApp/update`. See [deployment.md](deployment.md) for the full provisioning reference.
44+
45+
---
46+
2047
## Step-by-Step Integration
2148

2249
### Step 1: Get MCP Server URL
@@ -193,6 +220,7 @@ Add the plugin to your `declarative-agent.json`:
193220
## Complete Workflow Checklist
194221

195222
```
223+
□ Step 0: Scaffold agent project with `atk new` (if not already scaffolded) ← MANDATORY
196224
□ Step 1: Get MCP server URL from user
197225
□ Step 2: Run MCP Inspector to discover tools ← MANDATORY
198226
□ Step 3: Create {name}-plugin.json with basic structure

0 commit comments

Comments
 (0)