Skip to content

Conversation

@antonpk1
Copy link
Collaborator

@antonpk1 antonpk1 commented Dec 17, 2025

Summary

Adds a video resource example that demonstrates serving binary content (video) via MCP resources using the base64 blob pattern.

How It Works

  1. Server fetches video from CDN and returns as base64 blob via videos://{id} resource template
  2. Widget fetches resource via resources/read
  3. Widget decodes blob and plays in <video> element

Available Videos

ID Size
bunny-1mb 1MB
bunny-5mb 5MB
bunny-10mb 10MB
bunny-20mb 20MB
bunny-30mb 30MB
bunny-50mb 50MB
bunny-150mb ~150MB

Test Plan

  • Build succeeds
  • Video plays correctly in basic-host
  • Video plays correctly in Claude.ai
  • [ ]
Screenshot 2025-12-17 at 15 02 24

🤖 Generated with Claude Code

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 17, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@175

commit: 3ced9b3

@antonpk1 antonpk1 marked this pull request as ready for review December 17, 2025 19:32
jonathanhefner
jonathanhefner previously approved these changes Dec 17, 2025
Copy link
Member

@jonathanhefner jonathanhefner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two nitpicks, but looks good.

description: "30MB",
},
"bunny-50mb": {
url: "https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_50mb.mp4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL isn't loading for me.

I also tried https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_50MB.mp4, but that's 404.


// Register video resource template
// This fetches video from CDN and returns as base64 blob
server.resource(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to use server.registerResource() here (resource() is deprecated).

antonpk1 and others added 2 commits January 6, 2026 16:43
Demonstrates serving binary content (video) via MCP resources using the
base64 blob pattern:

1. Server fetches video from CDN
2. Returns as base64 blob via `videos://{id}` resource template
3. Widget fetches resource and plays in `<video>` element

Includes multiple video sizes for testing (1MB to 150MB).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@antonpk1 antonpk1 force-pushed the antonp/video-resource-example branch from 3ced9b3 to ea7d2ee Compare January 6, 2026 16:43
@antonpk1 antonpk1 merged commit 299a442 into main Jan 6, 2026
16 of 18 checks passed
@antonpk1 antonpk1 deleted the antonp/video-resource-example branch January 6, 2026 16:44
@ochafik ochafik mentioned this pull request Jan 7, 2026
@ochafik
Copy link
Collaborator

ochafik commented Jan 7, 2026

@antonpk1 Looks like this may have broken e2e tests?

@antonpk1
Copy link
Collaborator Author

antonpk1 commented Jan 7, 2026

on it! fix PR: #205

the video-resource-server was importing from ../shared/server-utils.js which got deleted - added the local copy like other examples have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants