/mcp-apps-studio:m365-copilot-packagingfrom mcp-apps-studio
Guides prerequisites, CORS allowlist, OAuth 2.1/Entra SSO redirect URIs, sideloading, and capability gaps when deploying an MCP app as a declarative agent in Microsoft 365 Copilot.
Ships in mcp-apps-studio. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Copilot renders MCP apps as interactive widgets inside declarative agents.
You attach an MCP server-based plugin whose tools return UI. Copilot supports
both MCP Apps and the OpenAI Apps SDK, with the coverage documented in
host-capability-matrix.
Both your MCP server and your identity provider must allowlist these.
Copilot renders widget UI under a server-specific host:
{hashed-mcp-domain}.widget-renderer.usercontent.microsoft.com
where {hashed-mcp-domain} is the SHA-256 hash of your MCP server's domain.
Generate it with the Widget Host URL Generator at https://aka.ms/mcpwidgeturlgenerator,
then add the result to your server's CORS allowlist.
Skip this and the symptom is a widget that works perfectly in the basic-host and renders blank in Copilot with no useful error.
https://teams.microsoft.com/api/platform/v1.0/oAuthRedirect ← Copilot
https://vscode.dev/redirect ← VS Code / Agents Toolkit tool fetch
https://teams.microsoft.com/api/platform/v1.0/oAuthConsentRedirect
VS Code does not currently support SSO for fetching tools — use OAuth 2.1 or anonymous during development, then switch.
| Mode | Use |
|---|---|
| None (anonymous) | Development only. Select it in Agents Toolkit while iterating. |
| OAuth 2.1 | Standard production path. |
| Microsoft Entra SSO | Production, when the agent should act as the signed-in user. |
Anonymous must be removed before deployment. It is a development affordance, not a shipping configuration.
Creating a declarative agent from an MCP server, configuring auth, and sideloading are identical whether or not the server returns UI. Follow the standard "build a plugin for a declarative agent from an MCP server" flow, with three MCP-apps-specific notes:
https://m365.cloud.microsoft/chat.From the support matrix, the constraints that change design rather than just code:
| Gap | Consequence | Work around it by |
|---|---|---|
frameDomains unsupported | No nested iframes at all | Inline maps/players, or degrade to openLink |
| Only fullscreen alternate mode | No PiP, no carousel-specific mode | Design inline + fullscreen only |
onteardown unsupported | No flush signal at unmount | Persist on every meaningful change |
onhostcontextchanged unsupported | Theme changes do not reach you | Read theme at init; back it with prefers-color-scheme |
ontoolinputpartial unsupported | No streaming skeleton | Build the loading state from ontoolinput only |
sendLog unsupported | No host-side logging | ?debug flag with an on-screen log pane |
availableDisplayModes unsupported | Cannot enumerate modes | Default to ["inline"] and feature-detect requestDisplayMode |
prefersBorder, widgetDescription, widgetDomain unsupported | Ignored silently | Do not depend on them visually |
toolInvocation/invoking and invoked unsupported | No custom progress text | Put status in the widget itself |
destructiveHint / idempotentHint / openWorldHint ignored | No host confirmation prompt | Build confirmation into your UI |
uploadFile / getFileDownloadUrl unsupported | No file round-trip | Server-side upload endpoint + openLink |
requestModal unsupported | No host modal | In-widget overlay |
setWidgetState is supported, so remount survival works. getHostCapabilities()
is supported, so probe it at startup rather than assuming this table is current.
if (window.openai.callTool) {
const result = await window.openai.callTool({ name: "myTool", params: {} });
} else {
// Show fallback UI, skip the feature, etc.
}
function FullScreenButton() {
if (!window.openai.requestDisplayMode) return null; // don't render what won't work
return (
<button onClick={() => window.openai.requestDisplayMode({ mode: "fullscreen" })}>
Enter Fullscreen
</button>
);
}
Startup probe:
interface PlatformCapabilities {
canCallTools: boolean;
canChangeDisplayMode: boolean;
canSendMessages: boolean;
}
function detectCapabilities(): PlatformCapabilities {
return {
canCallTools: !!window.openai.callTool,
canChangeDisplayMode: !!window.openai.requestDisplayMode,
canSendMessages: !!window.openai.sendMessage,
};
}
Microsoft publishes microsoft/mcp-interactiveUI-samples — pattern-focused
samples in mcp-apps/ (Node.js and Python) and oai-apps-sdk/ (Node.js),
covering expense submission with Graph + Entra SSO, field service dispatch with
maps, bulk approvals, HR consultant dashboards in Fluent UI v9, insurance
claims, training recommendations with embedded video, and Python LOB
integrations for Salesforce, ServiceNow, and HubSpot. Fluent UI v9, FastMCP, and
Azure Container Apps deployment are the recurring stack.
❌ row abovem365.cloud.microsoft/chathost-capability-matrix — the full support tables.mcp-apps-protocol — the standard being implemented.ui-testing-harness — the local loop before you reach Copilot.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mcp-apps, microsoft-365, copilot-packaging, declarative-agent, entra-sso
16 skills in this plugin
/a2ui-protocolThis skill should be used when building A2UI (Agent to UI) interfaces — the six streamed message types, surfaces, the flat adjacency-list component model, component catalogs, JSON Pointer data binding and two-way input binding, actions vs functionCalls, CheckRule validation, and progressive streaming./ag-ui-protocolThis skill should be used when integrating AG-UI — the full event taxonomy (lifecycle, text message, tool call, state, activity, reasoning, custom), RunAgentInput, SSE and binary transports, AbstractAgent/HttpAgent, STATE_DELTA JSON Patch, generative UI, human-in-the-loop interrupts, and CopilotKit frontends./host-capability-matrixThis skill should be used when deciding which MCP Apps or window.openai APIs are safe to depend on for a given host — the verified M365 Copilot support matrix for the component bridge, tool descriptor _meta, annotations, resource _meta, CSP properties, and client _meta, plus the feature-detection patterns that keep a widget portable./mcp-apps-protocolThis skill should be used when implementing or debugging the MCP Apps extension — ui:// resource URIs, the text/html;profile=mcp-app mimeType, every _meta.ui field, the full ui/* JSON-RPC bridge over postMessage, tool visibility, host context, display modes, and the five lifecycle phases./mcp-apps-sdkThis skill should be used when writing code against @modelcontextprotocol/ext-apps — registerAppTool, registerAppResource, RESOURCE_MIME_TYPE, the App class and its handlers, the React useApp hook, the app-bridge entry point, and the Vite single-file build that MCP Apps expect./mcp-ui-sdkThis skill should be used when working with mcp-ui — createUIResource and its rawHtml/externalUrl/remoteDom content types, the five UI action types (tool, prompt, link, intent, notify), the messageId async response flow, iframe lifecycle events, and the client-side UIResourceRenderer/AppRenderer components.npx claudepluginhub thelobbi/claude --plugin mcp-apps-studioOther plugins' skills for the same job