@modelcontextprotocol/ext-apps 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/src/app-bridge.d.ts +44 -1
- package/dist/src/app-bridge.js +10 -10
- package/dist/src/app-with-deps.js +10 -10
- package/dist/src/app.d.ts +68 -1
- package/dist/src/app.js +11 -11
- package/dist/src/generated/schema.d.ts +72 -0
- package/dist/src/generated/schema.test.d.ts +2 -0
- package/dist/src/react/index.js +10 -10
- package/dist/src/react/react-with-deps.js +10 -10
- package/dist/src/server/index.js +10 -10
- package/dist/src/spec.types.d.ts +34 -1
- package/dist/src/types.d.ts +5 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<img src="media/mcp-white.svg#gh-dark-mode-only" alt="MCP Apps" width="128">
|
|
5
5
|
<h1>MCP Apps</h1>
|
|
6
6
|
<p>
|
|
7
|
-
Build interactive UIs for MCP tools — charts, forms, dashboards — that render inline in any compliant chat client.
|
|
7
|
+
Build interactive UIs for MCP tools — charts, forms, dashboards — that render inline in Claude, ChatGPT and any other compliant chat client.
|
|
8
8
|
<br /><br />
|
|
9
9
|
<a href="#why-mcp-apps">Why</a>
|
|
10
10
|
·
|
|
@@ -80,12 +80,12 @@ it will guide you through the rest.
|
|
|
80
80
|
## Supported Clients
|
|
81
81
|
|
|
82
82
|
<p align="center">
|
|
83
|
-
<a href="https://
|
|
84
|
-
<a href="https://claude.
|
|
85
|
-
<a href="https://code.visualstudio.com/
|
|
86
|
-
<a href="https://block.github.io/goose/"><img src="https://img.shields.io/badge/Goose-
|
|
87
|
-
<a href="https://postman.com"><img src="https://img.shields.io/badge/Postman-
|
|
88
|
-
<a href="https://www.mcpjam.com/"><img src="https://img.shields.io/badge/MCPJam-
|
|
83
|
+
<a href="https://developers.openai.com/apps-sdk/mcp-apps-in-chatgpt/"><img src="https://img.shields.io/badge/ChatGPT-docs-74aa9c?logo=openai&logoColor=white" alt="ChatGPT"></a>
|
|
84
|
+
<a href="https://claude.com/docs/connectors/building/mcp-apps/getting-started"><img src="https://img.shields.io/badge/Claude-docs-d97706?logo=claude&logoColor=white" alt="Claude"></a>
|
|
85
|
+
<a href="https://code.visualstudio.com/blogs/2026/01/26/mcp-apps-support"><img src="https://img.shields.io/badge/VS_Code-docs-007ACC?logo=visualstudiocode&logoColor=white" alt="VS Code"></a>
|
|
86
|
+
<a href="https://block.github.io/goose/docs/tutorials/building-mcp-apps/"><img src="https://img.shields.io/badge/Goose-docs-000000?logo=goose&logoColor=white" alt="Goose"></a>
|
|
87
|
+
<a href="https://learning.postman.com/docs/postman-ai/mcp-requests/interact"><img src="https://img.shields.io/badge/Postman-docs-FF6C37?logo=postman&logoColor=white" alt="Postman"></a>
|
|
88
|
+
<a href="https://www.mcpjam.com/blog/mcp-apps-example"><img src="https://img.shields.io/badge/MCPJam-docs-8B5CF6" alt="MCPJam"></a>
|
|
89
89
|
</p>
|
|
90
90
|
|
|
91
91
|
> [!NOTE]
|
|
@@ -97,7 +97,7 @@ it will guide you through the rest.
|
|
|
97
97
|
## Why MCP Apps?
|
|
98
98
|
|
|
99
99
|
MCP tools return text and structured data. That works for many cases, but not
|
|
100
|
-
when you need an interactive UI, like a chart, form, or video player.
|
|
100
|
+
when you need an interactive UI, like a chart, form, design canvas or video player.
|
|
101
101
|
|
|
102
102
|
MCP Apps provide a standardized way to deliver interactive UIs from MCP servers.
|
|
103
103
|
Your UI renders inline in the conversation, in context, in any compliant host.
|
package/dist/src/app-bridge.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
|
2
2
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
3
3
|
import { CallToolRequest, CallToolResult, EmptyResult, Implementation, ListPromptsRequest, ListPromptsResult, ListResourcesRequest, ListResourcesResult, ListResourceTemplatesRequest, ListResourceTemplatesResult, LoggingMessageNotification, PingRequest, PromptListChangedNotification, ReadResourceRequest, ReadResourceResult, ResourceListChangedNotification, Tool, ToolListChangedNotification } from "@modelcontextprotocol/sdk/types.js";
|
|
4
4
|
import { Protocol, ProtocolOptions, RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
5
|
-
import { type AppNotification, type AppRequest, type AppResult, type McpUiSandboxResourceReadyNotification, type McpUiSizeChangedNotification, type McpUiToolCancelledNotification, type McpUiToolInputNotification, type McpUiToolInputPartialNotification, type McpUiToolResultNotification, McpUiAppCapabilities, McpUiUpdateModelContextRequest, McpUiHostCapabilities, McpUiHostContext, McpUiHostContextChangedNotification, McpUiInitializedNotification, McpUiMessageRequest, McpUiMessageResult, McpUiOpenLinkRequest, McpUiOpenLinkResult, McpUiResourceTeardownRequest, McpUiSandboxProxyReadyNotification, McpUiRequestDisplayModeRequest, McpUiRequestDisplayModeResult, McpUiResourcePermissions } from "./types";
|
|
5
|
+
import { type AppNotification, type AppRequest, type AppResult, type McpUiSandboxResourceReadyNotification, type McpUiSizeChangedNotification, type McpUiToolCancelledNotification, type McpUiToolInputNotification, type McpUiToolInputPartialNotification, type McpUiToolResultNotification, McpUiAppCapabilities, McpUiUpdateModelContextRequest, McpUiHostCapabilities, McpUiHostContext, McpUiHostContextChangedNotification, McpUiInitializedNotification, McpUiMessageRequest, McpUiMessageResult, McpUiOpenLinkRequest, McpUiOpenLinkResult, McpUiDownloadFileRequest, McpUiDownloadFileResult, McpUiResourceTeardownRequest, McpUiSandboxProxyReadyNotification, McpUiRequestDisplayModeRequest, McpUiRequestDisplayModeResult, McpUiResourcePermissions } from "./types";
|
|
6
6
|
export * from "./types";
|
|
7
7
|
export { RESOURCE_URI_META_KEY, RESOURCE_MIME_TYPE } from "./app";
|
|
8
8
|
export { PostMessageTransport } from "./message-transport";
|
|
@@ -404,6 +404,49 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
|
|
|
404
404
|
* @see {@link McpUiOpenLinkResult `McpUiOpenLinkResult`} for the result type
|
|
405
405
|
*/
|
|
406
406
|
set onopenlink(callback: (params: McpUiOpenLinkRequest["params"], extra: RequestHandlerExtra) => Promise<McpUiOpenLinkResult>);
|
|
407
|
+
/**
|
|
408
|
+
* Register a handler for file download requests from the View.
|
|
409
|
+
*
|
|
410
|
+
* The View sends `ui/download-file` requests when the user wants to
|
|
411
|
+
* download a file. The params contain an array of MCP resource content
|
|
412
|
+
* items — either `EmbeddedResource` (inline data) or `ResourceLink`
|
|
413
|
+
* (URI the host can fetch). The host should show a confirmation dialog
|
|
414
|
+
* and then trigger the download.
|
|
415
|
+
*
|
|
416
|
+
* @param callback - Handler that receives download params and returns a result
|
|
417
|
+
* - `params.contents` - Array of `EmbeddedResource` or `ResourceLink` items
|
|
418
|
+
* - `extra` - Request metadata (abort signal, session info)
|
|
419
|
+
* - Returns: `Promise<McpUiDownloadFileResult>` with optional `isError` flag
|
|
420
|
+
*
|
|
421
|
+
* @example
|
|
422
|
+
* ```ts
|
|
423
|
+
* bridge.ondownloadfile = async ({ contents }, extra) => {
|
|
424
|
+
* for (const item of contents) {
|
|
425
|
+
* if (item.type === "resource") {
|
|
426
|
+
* // EmbeddedResource — inline content
|
|
427
|
+
* const res = item.resource;
|
|
428
|
+
* const blob = res.blob
|
|
429
|
+
* ? new Blob([Uint8Array.from(atob(res.blob), c => c.charCodeAt(0))], { type: res.mimeType })
|
|
430
|
+
* : new Blob([res.text ?? ""], { type: res.mimeType });
|
|
431
|
+
* const url = URL.createObjectURL(blob);
|
|
432
|
+
* const link = document.createElement("a");
|
|
433
|
+
* link.href = url;
|
|
434
|
+
* link.download = res.uri.split("/").pop() ?? "download";
|
|
435
|
+
* link.click();
|
|
436
|
+
* URL.revokeObjectURL(url);
|
|
437
|
+
* } else if (item.type === "resource_link") {
|
|
438
|
+
* // ResourceLink — host fetches or opens directly
|
|
439
|
+
* window.open(item.uri, "_blank");
|
|
440
|
+
* }
|
|
441
|
+
* }
|
|
442
|
+
* return {};
|
|
443
|
+
* };
|
|
444
|
+
* ```
|
|
445
|
+
*
|
|
446
|
+
* @see {@link McpUiDownloadFileRequest `McpUiDownloadFileRequest`} for the request type
|
|
447
|
+
* @see {@link McpUiDownloadFileResult `McpUiDownloadFileResult`} for the result type
|
|
448
|
+
*/
|
|
449
|
+
set ondownloadfile(callback: (params: McpUiDownloadFileRequest["params"], extra: RequestHandlerExtra) => Promise<McpUiDownloadFileResult>);
|
|
407
450
|
/**
|
|
408
451
|
* Register a handler for display mode change requests from the view.
|
|
409
452
|
*
|