Skip to content

Commit 749de45

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/add-fullscreen-button-x6T7O
2 parents 465cd63 + 8cad9f0 commit 749de45

15 files changed

Lines changed: 714 additions & 39 deletions

File tree

README.md

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,59 @@
1-
# @modelcontextprotocol/ext-apps
2-
3-
[![npm version](https://img.shields.io/npm/v/@modelcontextprotocol/ext-apps.svg)](https://www.npmjs.com/package/@modelcontextprotocol/ext-apps) [![API Documentation](https://img.shields.io/badge/docs-API%20Reference-blue)](https://modelcontextprotocol.github.io/ext-apps/api/)
4-
5-
This repo contains the SDK and specification for MCP Apps Extension ([SEP-1865](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1865)).
1+
<!-- LOGO -->
2+
<div align="center">
3+
<img src="media/mcp.svg#gh-light-mode-only" alt="MCP Apps" width="128">
4+
<img src="media/mcp-white.svg#gh-dark-mode-only" alt="MCP Apps" width="128">
5+
<h1>MCP Apps</h1>
6+
<p>
7+
Build interactive UIs for MCP tools — charts, forms, dashboards — that render inline in any compliant chat client.
8+
<br /><br />
9+
<a href="#why-mcp-apps">Why</a>
10+
·
11+
<a href="https://modelcontextprotocol.github.io/ext-apps/api/documents/Quickstart.html">Quickstart</a>
12+
·
13+
<a href="https://modelcontextprotocol.github.io/ext-apps/api/">API Docs</a>
14+
·
15+
<a href="https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx">Spec</a>
16+
·
17+
<a href="CONTRIBUTING.md">Contributing</a>
18+
</p>
19+
</div>
20+
21+
<p align="center">
22+
<a href="https://github.com/modelcontextprotocol/ext-apps/actions/workflows/ci.yml"><img src="https://github.com/modelcontextprotocol/ext-apps/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
23+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License: Apache 2.0"></a>
24+
<a href="https://www.npmjs.com/package/@modelcontextprotocol/ext-apps"><img src="https://img.shields.io/npm/v/@modelcontextprotocol/ext-apps.svg" alt="npm version"></a>
25+
<a href="https://www.npmjs.com/package/@modelcontextprotocol/ext-apps"><img src="https://img.shields.io/npm/dm/@modelcontextprotocol/ext-apps.svg" alt="npm downloads"></a>
26+
<a href="https://github.com/modelcontextprotocol/ext-apps"><img src="https://img.shields.io/github/stars/modelcontextprotocol/ext-apps" alt="GitHub stars"></a>
27+
<a href="https://modelcontextprotocol.github.io/ext-apps/api/"><img src="https://img.shields.io/badge/docs-API%20Reference-blue" alt="API Documentation"></a>
28+
</p>
29+
30+
<p align="center">
31+
<img src="media/claude-colorpicker-apps.gif" alt="MCP Apps demo" width="600">
32+
<br><em>Color picker built with MCP Apps, running in Claude</em>
33+
</p>
34+
35+
## Table of Contents
36+
37+
- [Specification](#specification)
38+
- [Why MCP Apps?](#why-mcp-apps)
39+
- [How It Works](#how-it-works)
40+
- [Getting Started](#getting-started)
41+
- [Using the SDK](#using-the-sdk)
42+
- [Agent Skills](#agent-skills)
43+
- [Examples](#examples)
44+
- [Resources](#resources)
45+
- [Contributing](#contributing)
646

747
## Specification
848

49+
<div align="center">
50+
951
| Version | Status | Link |
1052
| -------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
1153
| **2026-01-26** | Stable | [specification/2026-01-26/apps.mdx](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx) |
12-
| draft | Development | [specification/draft/apps.mdx](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx) |
54+
| **draft** | Development | [specification/draft/apps.mdx](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx) |
55+
56+
</div>
1357

1458
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.
1559

@@ -28,34 +72,30 @@ MCP Apps extend the Model Context Protocol by letting tools declare UI resources
2872
3. **Host renders** — The host fetches the resource and displays it in a sandboxed iframe
2973
4. **Bidirectional communication** — The host passes tool data to the UI via notifications, and the UI can call other tools through the host
3074

31-
## Using the SDK
75+
## Getting Started
3276

33-
This SDK serves two audiences:
34-
35-
### For App Developers
36-
37-
Build interactive UIs that run inside MCP-enabled chat clients.
77+
```bash
78+
npm install -S @modelcontextprotocol/ext-apps
79+
```
3880

39-
- **SDK for Apps**: `@modelcontextprotocol/ext-apps`[API Docs](https://modelcontextprotocol.github.io/ext-apps/api/modules/app.html)
40-
- **React hooks**: `@modelcontextprotocol/ext-apps/react`[API Docs](https://modelcontextprotocol.github.io/ext-apps/api/modules/_modelcontextprotocol_ext-apps_react.html)
81+
**New here?** Start with the [Quickstart Guide](https://modelcontextprotocol.github.io/ext-apps/api/documents/Quickstart.html) to build your first MCP App.
4182

42-
### For Host Developers
83+
## Using the SDK
4384

44-
Embed and communicate with MCP Apps in your chat application.
85+
The SDK serves three roles: app developers building interactive Views, host developers embedding those Views, and MCP server authors registering tools with UI metadata.
4586

46-
- **SDK for Hosts**: `@modelcontextprotocol/ext-apps/app-bridge`[API Docs](https://modelcontextprotocol.github.io/ext-apps/api/modules/app-bridge.html)
87+
| Package | Purpose | Docs |
88+
| ------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
89+
| `@modelcontextprotocol/ext-apps` | Build interactive Views (App class, PostMessageTransport) | [API Docs →](https://modelcontextprotocol.github.io/ext-apps/api/modules/app.html) |
90+
| `@modelcontextprotocol/ext-apps/react` | React hooks for Views (useApp, useHostStyles, etc.) | [API Docs →](https://modelcontextprotocol.github.io/ext-apps/api/modules/_modelcontextprotocol_ext-apps_react.html) |
91+
| `@modelcontextprotocol/ext-apps/app-bridge` | Embed and communicate with Views in your chat client | [API Docs →](https://modelcontextprotocol.github.io/ext-apps/api/modules/app-bridge.html) |
92+
| `@modelcontextprotocol/ext-apps/server` | Register tools and resources on your MCP server | [API Docs →](https://modelcontextprotocol.github.io/ext-apps/api/modules/server.html) |
4793

4894
There's no _supported_ host implementation in this repo (beyond the [examples/basic-host](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) example).
4995

5096
The [MCP-UI](https://github.com/idosal/mcp-ui) client SDK offers a fully-featured MCP Apps framework used by a few hosts. Clients may choose to use it or roll their own implementation.
5197

52-
## Installation
53-
54-
```bash
55-
npm install -S @modelcontextprotocol/ext-apps
56-
```
57-
58-
### Install Agent Skills
98+
## Agent Skills
5999

60100
This repository provides two [Agent Skills](https://agentskills.io/) for building MCP Apps. You can install the skills as a Claude Code plugin:
61101

@@ -512,3 +552,7 @@ This configuration rebuilds each server on launch, ensuring your local changes a
512552
- [API Documentation](https://modelcontextprotocol.github.io/ext-apps/api/)
513553
- [Specification (2026-01-26)](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx) ([Draft](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx))
514554
- [SEP-1865 Discussion](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1865)
555+
556+
## Contributing
557+
558+
Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to get started, submit pull requests, and report issues.

examples/pdf-server/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ On some host platforms, tool calls have size limits, so large PDFs cannot be sen
6363
```typescript
6464
// Load in chunks with progress
6565
while (hasMore) {
66-
const chunk = await app.callServerTool("read_pdf_bytes", { url, offset });
66+
const chunk = await app.callServerTool({
67+
name: "read_pdf_bytes",
68+
arguments: { url, offset },
69+
});
6770
chunks.push(base64ToBytes(chunk.bytes));
6871
offset += chunk.byteCount;
6972
hasMore = chunk.hasMore;

examples/pdf-server/mcp-app.html

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
<div id="loading" class="loading">
1212
<div class="spinner"></div>
1313
<p id="loading-text">Loading PDF...</p>
14-
<div id="progress-container" class="progress-container" style="display: none">
14+
<div
15+
id="progress-container"
16+
class="progress-container"
17+
style="display: none"
18+
>
1519
<div id="progress-bar" class="progress-bar"></div>
1620
</div>
1721
<p id="progress-text" class="progress-text"></p>
@@ -57,16 +61,58 @@
5761
<button id="zoom-in-btn" class="zoom-btn" title="Zoom in (+)">
5862
+
5963
</button>
60-
<button id="fullscreen-btn" class="fullscreen-btn" title="Toggle fullscreen">
64+
<button
65+
id="search-btn"
66+
class="search-btn"
67+
title="Search (Ctrl+F)"
68+
></button>
69+
<button
70+
id="fullscreen-btn"
71+
class="fullscreen-btn"
72+
title="Toggle fullscreen"
73+
>
6174
6275
</button>
6376
</div>
6477
</div>
78+
<!-- Search bar below toolbar, right-aligned -->
79+
<div id="search-bar" class="search-bar" style="display: none">
80+
<input
81+
id="search-input"
82+
class="search-input"
83+
type="text"
84+
placeholder="Search..."
85+
autocomplete="off"
86+
/>
87+
<span id="search-match-count" class="search-match-count"></span>
88+
<button
89+
id="search-prev-btn"
90+
class="search-nav-btn"
91+
title="Previous (Shift+Enter)"
92+
>
93+
&#x25B2;
94+
</button>
95+
<button
96+
id="search-next-btn"
97+
class="search-nav-btn"
98+
title="Next (Enter)"
99+
>
100+
&#x25BC;
101+
</button>
102+
<button
103+
id="search-close-btn"
104+
class="search-nav-btn"
105+
title="Close (Esc)"
106+
>
107+
&#x2715;
108+
</button>
109+
</div>
65110

66111
<!-- Single Page Canvas Container -->
67112
<div class="canvas-container">
68113
<div class="page-wrapper">
69114
<canvas id="pdf-canvas"></canvas>
115+
<div id="highlight-layer" class="highlight-layer"></div>
70116
<div id="text-layer" class="text-layer"></div>
71117
</div>
72118
</div>

0 commit comments

Comments
 (0)