MCP Apps
How Fabric Agents shows MCP Apps, the interactive views MCP servers attach to their tools, and what a view may do.
An MCP App is an interactive view that an MCP server attaches to a tool: a chart, a form, a preview, a dashboard. Fabric Agents supports the MCP Apps extension (io.modelcontextprotocol/ui, stable revision 2026-01-26). When the agent calls a tool that has a view, the view appears in the chat under the turn's steps, while the tool runs and after it finishes. It stays there when you reopen the chat.
Nothing needs turning on. Fabric tells every MCP server it connects to that it can show apps, and servers that check for that offer their app tools.
What you can do with a view
- Use it. It gets the tool's input and result, follows Fabric's light or dark theme, and sizes itself to its content.
- Full screen. Use the button in the view's header, or let the view ask for it. Press Esc to return.
- Reload or collapse it from its header. Collapsing closes the view; expanding starts it again.
What a view may ask Fabric to do
| Request | What happens |
|---|---|
| Call a tool on its own server | Only tools the server marks as callable by apps, never on another server, and only from your own workspace's chats. A read-only tool runs. A tool that may change data follows the chat's permission mode: run in Execute, and in Ask or Guarded Fabric asks you first (Allow once, Allow in this chat, or Deny). In Explore it doesn't run: the card says what the view tried and offers Switch to Ask, Switch to Execute (then it runs again) or Keep Explore. The view itself can never answer these prompts. |
| Read a resource on its own server | Allowed. |
| Send a message into the chat | Sent as your message, at most six a minute. |
| Tell the agent what it shows | Added to your next message as context, labelled as coming from the app. Only each view's latest update is sent. |
| Open a link | Web and mail links open in your browser. |
Tools only apps can call
A server can mark a tool as visible to apps only (_meta.ui.visibility: ["app"]), for example a refresh button. Fabric never lists such a tool to the agent.
Security
- Isolated. On the desktop each view runs in a sandbox on its own origin (
fabric-mcp-app://, one per workspace and server), never Fabric's. Views of one server share storage only with each other. In the Web UI a view runs in a fully isolated frame without storage. - Can't leave. A view can't navigate itself anywhere its server didn't declare: the navigation is refused before any request is made, so it can't carry data out in a URL either.
- No undeclared network access. A view may load scripts, styles and images, connect, or embed frames only from the domains its server declared for it. By default it may reach nothing. Fabric checks every declared domain and drops keywords, paths and wildcards that are too broad.
- No devices. Views can't use your camera, microphone, location or clipboard; Fabric doesn't grant those permissions to apps yet.
- Logged. Fabric logs each view's declared domains when it loads, and every call a view makes, without its arguments.
For server authors
A tool names its view in _meta.ui.resourceUri (a ui:// resource). The resource returns HTML with the MIME type text/html;profile=mcp-app, and declares in _meta.ui the domains it needs (csp.connectDomains, resourceDomains, frameDomains, baseUriDomains). Fabric doesn't grant the device permissions a view may ask for (camera, microphone, geolocation, clipboardWrite); the host context says so (hostCapabilities.sandbox.permissions is empty). Build views with the official SDK, @modelcontextprotocol/ext-apps, or speak the protocol directly. Views built with either major version of the SDK work: 2.x (on the MCP TypeScript SDK v2) and 1.x (on v1), which most published apps still ship. Fabric passes the standard style variables (--color-background-primary, --color-text-primary, --font-sans and the rest) and supports the inline and fullscreen display modes.
Fabric also tells a view the chat's permission mode, in its host context under fabric.pro/permissionMode (explore, ask, guarded or execute), and again when it changes: a view can disable buttons that change data while the chat is in Explore. Other hosts don't send it, so treat it as optional. A view's tool calls can ask the user questions (MCP elicitation): Fabric shows them in the chat and the call waits, keeping the view's request alive with progress notifications. A question asked while a view loads itself or reads a resource is declined, because those reads can't wait for a person. When the user keeps Explore, the view's call fails with JSON-RPC error -32010, a message that starts with Explore mode:, and data: { "reason": "permission_mode", "mode": "explore", "tool": "<name>" }.
Make your app look like part of Fabric
Fabric sends its theme in the host context: theme (light or dark) and styles.variables, the standard style variables filled from Fabric's current theme. These include background, text and border colours, the focus ring, fonts and corner radii. Apply them when the app starts and whenever they change. A change notification carries only what changed:
import { App, applyDocumentTheme, applyHostStyleVariables } from "@modelcontextprotocol/ext-apps";
const app = new App({ name: "my-app", version: "1.0.0" });
const applyContext = (ctx) => {
if (ctx?.theme) applyDocumentTheme(ctx.theme);
if (ctx?.styles?.variables) applyHostStyleVariables(ctx.styles.variables);
};
app.onhostcontextchanged = applyContext;
await app.connect();
applyContext(app.getHostContext());Then use the variables in your CSS, with your own colours as the fallback:
body {
background: var(--color-background-primary, #fff);
color: var(--color-text-primary, #111);
font-family: var(--font-sans, system-ui, sans-serif);
}
button { border: 1px solid var(--color-border-primary, #ddd); border-radius: var(--border-radius-md, 8px); }Fill the screen in full screen
Inline, a view sizes itself to its content, up to 640 pixels. In full screen, Fabric gives it the whole window below a slim title bar, and says how much room that is in containerDimensions (width and height) with displayMode: "fullscreen". Lay the app out to fill that height, with your main content scrolling inside it, instead of leaving the rest of the screen empty.
Reduced motion
When the user sets Settings → Appearance → Motion to Reduced (or leaves it on System and the operating system asks for reduced motion), the host context carries "fabric.pro/reducedMotion": true. Turn off slides, bounces and parallax, and keep fades short. Set to Full, it's false from the start: the user chose full motion in Fabric, even if the operating system asks for less. If the setting changes while the view is open, Fabric sends the key again, true or false. A missing key means no preference (and other hosts don't send it), so fall back to prefers-reduced-motion.
Keep your place when the card comes back
A card's view is unloaded when it scrolls far away, is collapsed or reloaded, or the app restarts. To come back where the user left off, send the fabric.pro/view-state notification with your state whenever it changes, such as the current step or selection:
app.notification({ method: "fabric.pro/view-state", params: { state: { step: 3, choice: "b" } } });The next time the same tool call's view mounts in the same chat, its host context has "fabric.pro/viewState" with the last state you sent. The key is there only when you saved something, so restore from it only when it's present. The state is any JSON up to 16 KB; null clears it. Fabric keeps it in the chat's folder, deletes it with the chat, and never shows it to the model (use ui/update-model-context for that). Other hosts ignore the notification.
Showing the same thing again
When a later tool call shows the same view again, Fabric collapses the earlier cards to one line and stops them. Only the newest one runs.
- A card the user is using stays open: one in full screen, one with focus inside it, or one with an approval or an action in progress.
- If one view can show different things (two drafts, say), name what each result is about: put
"fabric.dev/subject": "<an id>"in the tool result's_meta. Results with different subjects stay separate cards.
Asking for approval
In Ask mode, Fabric asks the user before a view runs a tool that may change data. It decides that from the tool's annotations (readOnlyHint, destructiveHint) and its name. A name containing a write word (delete, publish, send…) always counts as a change.
- Give tools that only read
readOnlyHint: true, and names without write words. - An app that refreshes itself with a read-only tool then runs silently.
MCP Authentication
Authentication for MCP sources in Fabric Agents — bearer tokens, OAuth with dynamic client registration, token refresh, and credential storage.
REST APIs
Connect Fabric Agents to any REST API — authentication options, raw body support, query presets, and token refresh via renewEndpoint.