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
+35-22Lines changed: 35 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,29 +6,33 @@ This repo contains the SDK and [specification](https://github.com/modelcontextpr
6
6
7
7
MCP Apps are a proposed standard inspired by [MCP-UI](https://mcpui.dev/) and [OpenAI's Apps SDK](https://developers.openai.com/apps-sdk/) to allow MCP Servers to display interactive UI elements in conversational MCP clients / chatbots.
8
8
9
+
## Why MCP Apps?
10
+
11
+
MCP tools return text and structured data. That works for many cases, but not when you need an interactive UI, like a chart, form, or video player.
12
+
13
+
MCP Apps provide a standardized way to deliver interactive UIs from MCP servers. Your UI renders inline in the conversation, in context, in any compliant host.
14
+
9
15
## How It Works
10
16
11
-
MCP Apps extend the Model Context Protocol to let servers deliver **interactive UIs** to MCP hosts. Here's how it works:
17
+
MCP Apps extend the Model Context Protocol by letting tools declare UI resources:
12
18
13
-
1.**Tool call** — The LLM calls a tool on your server
14
-
2.**UI Resource** — The tool's definition links to a predeclared `ui://` resource containing its HTML interface
19
+
1.**Tool definition** — Your tool declares a `ui://` resource containing its HTML interface
20
+
2.**Tool call** — The LLM calls the tool on your server
15
21
3.**Host renders** — The host fetches the resource and displays it in a sandboxed iframe
16
22
4.**Bidirectional communication** — The host passes tool data to the UI via notifications, and the UI can call other tools through the host
17
23
18
-
This enables dashboards, forms, visualizations, and other rich experiences inside chat interfaces.
19
-
20
-
## Overview
24
+
## Using the SDK
21
25
22
26
This SDK serves two audiences:
23
27
24
-
### App Developers
28
+
### For App Developers
25
29
26
30
Build interactive UIs that run inside MCP-enabled chat clients.
27
31
28
32
-**SDK for Apps**: `@modelcontextprotocol/ext-apps` — [API Docs](https://modelcontextprotocol.github.io/ext-apps/api/modules/app.html)
Embed and communicate with MCP Apps in your chat application.
34
38
@@ -57,6 +61,8 @@ For more information, including instructions for installing the skills in your f
57
61
58
62
## Examples
59
63
64
+
The [`examples/`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples) directory contains demo apps showcasing real-world use cases.
65
+
60
66
<!-- prettier-ignore-start -->
61
67
||||
62
68
|:---:|:---:|:---:|
@@ -78,12 +84,27 @@ For more information, including instructions for installing the skills in your f
78
84
|[](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-react)| The same app built with different frameworks — pick your favorite!<br><br>[React](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-react) · [Vue](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-vue) · [Svelte](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-svelte) · [Preact](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-preact) · [Solid](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-solid) · [Vanilla JS](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-vanillajs)|
79
85
<!-- prettier-ignore-end -->
80
86
81
-
The [`examples/`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples) directory contains additional demo apps showcasing real-world use cases.
87
+
### Running the Examples
82
88
83
-
<details>
84
-
<summary>MCP client configuration for all examples</summary>
89
+
#### With basic-host
90
+
91
+
To run all examples locally using [basic-host](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) (the reference host implementation included in this repo):
85
92
86
-
Add to your MCP client configuration (stdio transport):
To use these examples with MCP clients that support the stdio transport (such as Claude Desktop or VS Code), add this MCP server configuration to your client's settings:
105
+
106
+
<details>
107
+
<summary>MCP client configuration for all examples (using stdio)</summary>
87
108
88
109
```json
89
110
{
@@ -300,18 +321,10 @@ Add to your MCP client configuration (stdio transport):
300
321
}
301
322
```
302
323
303
-
> **Note:** The `qr` server requires cloning the repository first. See [qr-server README](examples/qr-server) for details.
304
-
305
324
</details>
306
325
307
-
To run all examples locally in dev mode:
308
-
309
-
```bash
310
-
npm install
311
-
npm start
312
-
```
313
-
314
-
Then open http://localhost:8080/.
326
+
> [!NOTE]
327
+
> The `qr` server requires cloning the repository first. See [qr-server README](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/qr-server) for details.
0 commit comments