Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(examples): Add video-resource-server example #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
antonpk1 wants to merge 1 commit into main
base: main
Choose a base branch
Loading
from antonp/video-resource-example

Conversation

@antonpk1
Copy link
Collaborator

@antonpk1 antonpk1 commented Dec 17, 2025
edited
Loading

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

ochafik reacted with heart emoji
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>
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

@jonathanhefner jonathanhefner Dec 17, 2025

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

@jonathanhefner jonathanhefner Dec 17, 2025

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).

ochafik reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jonathanhefner jonathanhefner jonathanhefner approved these changes

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /