You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,29 @@
1
1
# @modelcontextprotocol/ext-apps
2
2
3
-
This repo contains the SDK and [specification](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx) for MCP Apps Extension ([SEP-1865](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1865)).
4
-
5
-
MCP Apps are a standard inspired by [OpenAI's Apps SDK](https://developers.openai.com/apps-sdk/) and [MCP-UI](https://mcpui.dev/) to allow MCP Servers to display interactive UI elements in conversational MCP clients / chatbots.
3
+
This repo contains the SDK and [specification](./main/specification/draft/apps.mdx) for MCP Apps Extension ([SEP-1865](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1865)).
4
+
5
+
MCP Apps are proposed standard inspired by [OpenAI's Apps SDK](https://developers.openai.com/apps-sdk/) and [MCP-UI](https://mcpui.dev/) to allow MCP Servers to display interactive UI elements in conversational MCP clients / chatbots.
6
+
7
+
This repo provides:
8
+
-[types.ts](./src/types.ts): Types of JSON-RPC messages used to communicate between Apps & their host
9
+
- Note that MCP Apps also use some standard MCP messages (e.g. `tools/call` for the App to trigger actions on its originating Server - these calls are proxied through the Host), but these types are the additional messages defined by the extension
-[server.ts](./examples/simple-server/server.ts): MCP server with two tools that declare UI resources of Apps to be show in the chat when called
12
+
-[ui-react.tsx](./examples/simple-server/src/ui-react.tsx): React App returned by the `create-ui-react` tool shows how to use the `useApp` hook to register MCP callbacks
13
+
-[ui-vanilla.tsx](./examples/simple-server/src/ui-vanilla.ts): vanilla App returned by the `create-ui-vanilla`
14
+
-[main/specification/draft/apps.mdx](./main/specification/draft/apps.mdx): The Draft Extension Specification. It's still... in flux! Feedback welcome! (also see discussions in [SEP-1865](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1865)).
15
+
-[message-transport](./src/message-transport.ts): `PostMessageTransport` class that uses `postMessage` to exchange JSON-RPC messages between windows / iframes
16
+
-[app.ts](./src/app.ts): `App` class used by an App to talk to its host
17
+
-[app-bridge.ts](./src/app-bridge.ts): `AppBridge` class used by the host to talk to a single App
18
+
19
+
What this repo does NOT provide:
20
+
- There's no host implementation here (beyond the `AppBridge` just used for communications).
21
+
- We have contributed a tentative implementation of hosting / iframing / sandboxing logic to the [MCP-UI](https://github.com/idosal/mcp-ui) repository, and expect OSS clients may use it, while other clients might roll their own hosting logic.
22
+
- A prior iteration of an e2e prototype w/ client, server and hosting parts is available [in this gist](https://gist.github.com/ochafik/a9603ba2d6757d6038ce066eded4c354)
6
23
7
24
## Installation
8
25
9
-
This repo is in flux and isn't published to npm (when it is, we'll probably use the `@modelcontextprotocol/ext-apps` package). Please install it from git for now:
26
+
This repo is in flux and isn't published to npm (when it is, it will use the `@modelcontextprotocol/ext-apps` package). Please install it from git for now:
Copy file name to clipboardExpand all lines: specification/draft/apps.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ MCP Apps extends the Model Context Protocol to enable servers to deliver interac
43
43
-**Bidirectional Communication:** UI iframes communicate with hosts using standard MCP JSON-RPC protocol
44
44
-**Security Model:** Mandatory iframe sandboxing with auditable communication
45
45
46
-
This specification focuses on HTML content (`text/html`) as the initial content type, with extensibility for future formats.
46
+
This specification focuses on HTML content (`text/vnd.mcp.ui+html`) as the initial content type, with extensibility for future formats.
47
47
48
48
As an extension, MCP Apps is optional and must be explicitly negotiated between clients and servers through the extension capabilities mechanism (see Capability Negotiation section).
49
49
@@ -56,7 +56,7 @@ interface UIResource {
56
56
uri:string; // MUST start with 'ui://'
57
57
name:string; // Human-readable identifier
58
58
description?:string; // Description of the UI resource
59
-
mimeType:string; // SHOULD be 'text/html' in MVP
59
+
mimeType:string; // SHOULD be 'text/vnd.mcp.ui+html' in MVP
60
60
}
61
61
```
62
62
@@ -67,7 +67,7 @@ The resource content is returned via `resources/read`:
67
67
{
68
68
contents: [{
69
69
uri: string; // Matching UI resource URI
70
-
mimeType: "text/html"; // MUST be "text/html"
70
+
mimeType: "text/vnd.mcp.ui+html"; // MUST be "text/vnd.mcp.ui+html"
71
71
text?:string; // HTML content as string
72
72
blob?:string; // OR base64-encoded HTML
73
73
_meta?: {
@@ -85,7 +85,7 @@ The resource content is returned via `resources/read`:
85
85
#### Content Requirements:
86
86
87
87
- URI MUST start with `ui://` scheme
88
-
-`mimeType` MUST be `text/html` (other types reserved for future extensions)
88
+
-`mimeType` MUST be `text/vnd.mcp.ui+html` (other types reserved for future extensions)
89
89
- Content MUST be provided via either `text` (string) or `blob` (base64-encoded)
0 commit comments