$npx -y skills add microsoft/power-platform-skills --skill configure-canvas-mcpConfigure the Canvas Authoring MCP server for the current coauthoring session. USE WHEN "configure MCP", "set up MCP server", "MCP not working", "connect Canvas Apps MCP", "canvas-authoring not available", "MCP not configured", "set up canvas apps".
| 1 | # Configure the Canvas Authoring MCP Server |
| 2 | |
| 3 | This skill configures the Canvas Authoring MCP server for the user's current Power Apps coauthoring session. The MCP server is auto-registered by the plugin — this skill connects it to a specific app session. |
| 4 | |
| 5 | ## Instructions |
| 6 | |
| 7 | ### 1. Ask for the studio URL |
| 8 | |
| 9 | Ask the user: |
| 10 | |
| 11 | > What is the URL of your canvas app studio session? |
| 12 | > |
| 13 | > Copy the URL from the browser address bar while your app is open in Power Apps Designer (it should look like `https://make.powerapps.com/e/Default-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/canvas/?action=edit&app-id=...`). |
| 14 | > |
| 15 | > Make sure coauthoring is enabled in the app (Settings → Updates → Coauthoring). |
| 16 | > |
| 17 | > **Keep this browser tab open for the entire session.** The MCP server communicates with Power Apps through the coauthoring session tied to that tab. Closing the tab ends the coauthoring session, which prevents `compile_canvas` and `sync_canvas` from working and means you can't see or save generated changes. |
| 18 | |
| 19 | ### 2. Extract parameters from the URL |
| 20 | |
| 21 | Parse the following from the studio URL: |
| 22 | |
| 23 | - **ENV_ID**: the path segment between `/e/` and the next `/` (e.g. `Default-91bee3d9-0c15-4f17-8624-c92bb8b36ead`). |
| 24 | - **APP_ID**: URL-decode the `app-id` query parameter value, then take the last segment after the final `/` (e.g. `6fc3e3d1-292b-4281-8826-577f78512e56`) |
| 25 | - **MAKER_HOSTNAME**: the hostname of the URL (e.g. `make.powerapps.com`) |
| 26 | - **CLUSTER_CATEGORY**: determined from MAKER_HOSTNAME (see table below) |
| 27 | |
| 28 | **Determine CLUSTER_CATEGORY from MAKER_HOSTNAME:** |
| 29 | |
| 30 | | MAKER_HOSTNAME | CLUSTER_CATEGORY | |
| 31 | | ---------------------------- | ---------------- | |
| 32 | | `make.powerapps.com` | `prod` | |
| 33 | | `make.preview.powerapps.com` | `prod` | |
| 34 | | `make.gov.powerapps.us` | `gov` | |
| 35 | | `make.high.powerapps.us` | `high` | |
| 36 | | `make.apps.appsplatform.us` | `dod` | |
| 37 | | `make.powerapps.cn` | `china` | |
| 38 | | Any other hostname | `test` | |
| 39 | |
| 40 | **Example:** |
| 41 | |
| 42 | Example URL: `https://make.powerapps.com/e/Default-91bee3d9-0c15-4f17-8624-c92bb8b36ead/canvas/?action=edit&app-id=%2Fproviders%2FMicrosoft.PowerApps%2Fapps%2F6fc3e3d1-292b-4281-8826-577f78512e56` |
| 43 | |
| 44 | - ENV_ID → `Default-91bee3d9-0c15-4f17-8624-c92bb8b36ead` |
| 45 | - APP_ID → `6fc3e3d1-292b-4281-8826-577f78512e56` |
| 46 | - MAKER_HOSTNAME → `make.powerapps.com` |
| 47 | - CLUSTER_CATEGORY → `prod` |
| 48 | |
| 49 | ### 3. Configure the MCP server |
| 50 | |
| 51 | Call the `connect` MCP tool to connect the server to the user's coauthoring session: |
| 52 | |
| 53 | ``` |
| 54 | mcp__canvas-authoring__connect( |
| 55 | environment_id: ENV_ID, |
| 56 | app_id: APP_ID, |
| 57 | cluster_category: CLUSTER_CATEGORY, |
| 58 | // Optional — include only if the user has expressed a preference or a prior sign-in failed (see below): |
| 59 | auth_flow: "broker" | "browser" | "devicecode", |
| 60 | login_hint: "user@contoso.com", |
| 61 | tenant_id: "00000000-0000-0000-0000-000000000000", |
| 62 | force_account_select: true |
| 63 | ) |
| 64 | ``` |
| 65 | |
| 66 | **Optional parameters — do NOT prompt the user for these.** Only include them if the user has already expressed a preference earlier in the conversation, or if a prior connect attempt failed: |
| 67 | |
| 68 | - `login_hint`: Pass the user's UPN or email **only if** they have indicated they want to connect as a specific/different user (e.g. "log in as alice@contoso.com"). These values cannot be derived from the maker portal URL — never guess. Omit otherwise to use the first signed-in user. When reconnecting to switch environment/app, reuse the same `login_hint` value as the previous successful connect (if known) so the same user is reused without re-prompting. |
| 69 | - `auth_flow`: Pass `"browser"`, `"broker"`, or `"devicecode"` **only if** the user has explicitly stated a preferred auth flow (e.g. "use browser sign-in"). Use `"devicecode"` on headless/SSH hosts where neither broker nor browser flow can pop a UI — the verification URL and user code are surfaced via an MCP elicitation request and require a client that supports elicitation. Omit otherwise to use the default. |
| 70 | - `tenant_id`: Pass a tenant GUID **only** for Entra B2B guest access — set it to the host/resource tenant where the user is a guest so the token is issued by that tenant rather than the user's home tenant. Combine with `login_hint` (the guest's home UPN) to pre-fill the account. Omit for normal same-tenant sign-in. |
| 71 | - `force_account_select`: Pass `true` **only** to force the account picker instead of silently reusing a cached account — set this when a previous connect failed with a 401/403 and no `login_hint` was given, so the user can pick the correct account. Omit otherwi |