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

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 <[email protected]>
@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: da95f0c

@antonpk1 antonpk1 marked this pull request as ready for review December 17, 2025 19:32
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).

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.

3 participants