Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified examples/video-resource-server/grid-cell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions examples/video-resource-server/mcp-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="light dark">
<title>Video Resource Player</title>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
background: transparent;
}
</style>
</head>
<body>
<main class="main">
Expand Down
Binary file modified examples/video-resource-server/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions examples/video-resource-server/src/mcp-app.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.main {
width: 100%;
max-width: 640px;
height: 100%;
display: flex;
flex-direction: column;
}

.loading {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
Expand Down Expand Up @@ -40,11 +43,20 @@
margin: 0;
}

.player {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}

.player video {
width: 100%;
max-height: 480px;
flex: 1;
min-height: 0;
border-radius: 8px;
background-color: #000;
object-fit: contain;
}

.video-info {
Expand Down
12 changes: 11 additions & 1 deletion examples/video-resource-server/src/mcp-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ function showPlayer(dataUri: string, info: string) {
// MCP Apps SDK Integration
// =============================================================================

const app = new App({ name: "Video Resource Player", version: "1.0.0" });
/** Preferred height for inline mode - fills viewport but gives host a size hint */
const PREFERRED_INLINE_HEIGHT = 400;

// autoResize: false - we manually send size since video fills its container
const app = new App(
{ name: "Video Resource Player", version: "1.0.0" },
{},
{ autoResize: false },
);

// Handle tool result - Requests a resource via resources/read and converts the
// base64 blob to a data URI for use in the browser.
Expand Down Expand Up @@ -131,4 +139,6 @@ app.connect().then(() => {
if (ctx) {
handleHostContextChanged(ctx);
}
// Send preferred size for inline mode
app.sendSizeChanged({ height: PREFERRED_INLINE_HEIGHT });
});
4 changes: 2 additions & 2 deletions tests/e2e/generate-grid-screenshots.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const EXTRA_WAIT_MS: Record<string, number> = {
};

// Servers to skip (screenshots maintained manually)
const SKIP_SERVERS = new Set([
"video-resource", // Uses custom screenshot from PR comment
const SKIP_SERVERS = new Set<string>([
// Previously had video-resource, but now it auto-generates like other servers
]);

// Optional: filter to a single example via EXAMPLE env var (folder name)
Expand Down
Loading