fix(examples): add missing server-utils.ts to video-resource-server (#205)

The server was importing from ../shared/server-utils.js which doesn't exist.
Added the standard server-utils.ts file (matching other examples) and updated
the import path to ./src/server-utils.js.
This commit is contained in:
Anton Pidkuiko 2026-01-07 14:08:15 +00:00 • committed by GitHub
commit 7837a8ccc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,7 +8,6 @@ import {
McpServer,
ResourceTemplate,
} from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import type {
CallToolResult,
ReadResourceResult,
@ -22,7 +21,7 @@ import {
RESOURCE_MIME_TYPE,
RESOURCE_URI_META_KEY,
} from "@modelcontextprotocol/ext-apps/server";
import { startServer } from "../shared/server-utils.js";
import { startServer } from "./src/server-utils.js";
const DIST_DIR = path.join(import.meta.dirname, "dist");
const RESOURCE_URI = "ui://video-player/mcp-app.html";
@ -169,12 +168,7 @@ ${Object.entries(VIDEO_LIBRARY)
}
async function main() {
if (process.argv.includes("--stdio")) {
await createServer().connect(new StdioServerTransport());
} else {
const port = parseInt(process.env.PORT ?? "3105", 10);
await startServer(createServer, { port, name: "Video Resource Server" });
}
await startServer(createServer);
}
main().catch((e) => {