feat(examples): Add video-resource-server example
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>
This commit is contained in:
parent
d925af5257
commit
ba45157d55
1 changed files with 554 additions and 0 deletions
28
examples/video-resource-server/mcp-app.html
Normal file
28
examples/video-resource-server/mcp-app.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<title>Video Resource Player</title>
|
||||
</head>
|
||||
<body>
|
||||
<main class="main">
|
||||
<div id="loading" class="loading">
|
||||
<div class="spinner"></div>
|
||||
<p id="loading-text">Waiting for video...</p>
|
||||
</div>
|
||||
|
||||
<div id="error" class="error" style="display: none;">
|
||||
<p class="error-title">Error loading video</p>
|
||||
<p id="error-message"></p>
|
||||
</div>
|
||||
|
||||
<div id="player" class="player" style="display: none;">
|
||||
<video id="video" controls></video>
|
||||
<p id="video-info" class="video-info"></p>
|
||||
</div>
|
||||
</main>
|
||||
<script type="module" src="/src/mcp-app.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue