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:
parent
299a4423fb
commit
7837a8ccc2
1 changed files with 112 additions and 8 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue