diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70ee9333..e8bf7add 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,10 @@ jobs: shell: bash run: '! grep -E "\"resolved\": \"https?://" package-lock.json | grep -v registry.npmjs.org' + - name: Verify example dependency versions + shell: bash + run: node scripts/check-versions.mjs + - uses: actions/setup-node@v4 with: node-version: "20" diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index c30a9656..325a838e 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -83,3 +83,47 @@ jobs: - run: npm publish --provenance --access public ${{ steps.npm-tag.outputs.tag }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} + + publish-examples: + runs-on: ubuntu-latest + if: github.event_name == 'release' + environment: Release + needs: [publish] + + permissions: + contents: read + id-token: write + + strategy: + fail-fast: false + matrix: + example: + - basic-server-react + - basic-server-vanillajs + - budget-allocator-server + - cohort-heatmap-server + - customer-segmentation-server + - scenario-modeler-server + - system-monitor-server + - threejs-server + - wiki-explorer-server + + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + registry-url: "https://registry.npmjs.org" + - run: npm ci + + - name: Build example + run: npm run build --workspace examples/${{ matrix.example }} + + - name: Publish example + run: npm publish --workspace examples/${{ matrix.example }} --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d1614b15..4174e6fe 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,4 +20,16 @@ jobs: cache: npm - run: npm ci - run: npm run build - - run: npx pkg-pr-new publish + - run: npm run examples:build + - run: | + npx pkg-pr-new publish \ + . \ + ./examples/basic-server-react \ + ./examples/basic-server-vanillajs \ + ./examples/budget-allocator-server \ + ./examples/cohort-heatmap-server \ + ./examples/customer-segmentation-server \ + ./examples/scenario-modeler-server \ + ./examples/system-monitor-server \ + ./examples/threejs-server \ + ./examples/wiki-explorer-server diff --git a/examples/basic-server-react/package.json b/examples/basic-server-react/package.json index 5927040c..09185554 100644 --- a/examples/basic-server-react/package.json +++ b/examples/basic-server-react/package.json @@ -1,17 +1,30 @@ { - "name": "basic-server-react", - "version": "1.0.0", - "private": true, + "name": "@modelcontextprotocol/server-basic-react", + "version": "0.1.0", "type": "module", + "description": "Basic MCP App Server example using React", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps", + "directory": "examples/basic-server-react" + }, + "license": "MIT", + "main": "server.ts", + "files": [ + "server.ts", + "server-utils.ts", + "dist" + ], "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build", "watch": "cross-env INPUT=mcp-app.html vite build --watch", "serve": "bun server.ts", "start": "cross-env NODE_ENV=development npm run build && npm run serve", - "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve'" + "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve'", + "prepublishOnly": "npm run build" }, "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -26,6 +39,7 @@ "@vitejs/plugin-react": "^4.3.4", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", diff --git a/examples/basic-server-react/server-utils.ts b/examples/basic-server-react/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/basic-server-react/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/basic-server-react/server.ts b/examples/basic-server-react/server.ts index 6d048dac..b28ad3b0 100644 --- a/examples/basic-server-react/server.ts +++ b/examples/basic-server-react/server.ts @@ -1,16 +1,17 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { CallToolResult, ReadResourceResult } from "@modelcontextprotocol/sdk/types.js"; import fs from "node:fs/promises"; import path from "node:path"; import { registerAppTool, registerAppResource, RESOURCE_MIME_TYPE, RESOURCE_URI_META_KEY } from "@modelcontextprotocol/ext-apps/server"; -import { startServer } from "./src/server-utils.js"; +import { startServer } from "./server-utils.js"; const DIST_DIR = path.join(import.meta.dirname, "dist"); /** * Creates a new MCP server instance with tools and resources registered. */ -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "Basic MCP App Server (React)", version: "1.0.0", @@ -26,13 +27,12 @@ function createServer(): McpServer { "get-time", { title: "Get Time", - description: "Returns the current server time as an ISO 8601 string.", + description: "Returns the current server time.", inputSchema: {}, _meta: { [RESOURCE_URI_META_KEY]: resourceUri }, }, async (): Promise => { - const time = new Date().toISOString(); - return { content: [{ type: "text", text: time }] }; + return { content: [{ type: "text", text: new Date().toISOString() }] }; }, ); @@ -43,11 +43,8 @@ function createServer(): McpServer { { mimeType: RESOURCE_MIME_TYPE }, async (): Promise => { const html = await fs.readFile(path.join(DIST_DIR, "mcp-app.html"), "utf-8"); - return { - contents: [ - { uri: resourceUri, mimeType: RESOURCE_MIME_TYPE, text: html }, - ], + contents: [{ uri: resourceUri, mimeType: RESOURCE_MIME_TYPE, text: html }], }; }, ); @@ -55,4 +52,16 @@ function createServer(): McpServer { return server; } -startServer(createServer); +async function main() { + if (process.argv.includes("--stdio")) { + await createServer().connect(new StdioServerTransport()); + } else { + const port = parseInt(process.env.PORT ?? "3001", 10); + await startServer(createServer, { port, name: "Basic MCP App Server (React)" }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/basic-server-react/src/server-utils.ts b/examples/basic-server-react/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/basic-server-react/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/examples/basic-server-vanillajs/package.json b/examples/basic-server-vanillajs/package.json index 5bc5a71c..aba360fc 100644 --- a/examples/basic-server-vanillajs/package.json +++ b/examples/basic-server-vanillajs/package.json @@ -1,17 +1,30 @@ { - "name": "basic-server-vanillajs", - "version": "1.0.0", - "private": true, + "name": "@modelcontextprotocol/server-basic-vanillajs", + "version": "0.1.0", "type": "module", + "description": "Basic MCP App Server example using vanilla JavaScript", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps", + "directory": "examples/basic-server-vanillajs" + }, + "license": "MIT", + "main": "server.ts", + "files": [ + "server.ts", + "server-utils.ts", + "dist" + ], "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build", "watch": "cross-env INPUT=mcp-app.html vite build --watch", "serve": "bun server.ts", "start": "cross-env NODE_ENV=development npm run build && npm run serve", - "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve'" + "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve'", + "prepublishOnly": "npm run build" }, "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "zod": "^4.1.13" }, @@ -21,6 +34,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", diff --git a/examples/basic-server-vanillajs/server-utils.ts b/examples/basic-server-vanillajs/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/basic-server-vanillajs/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/basic-server-vanillajs/server.ts b/examples/basic-server-vanillajs/server.ts index a756b29a..9e39355b 100644 --- a/examples/basic-server-vanillajs/server.ts +++ b/examples/basic-server-vanillajs/server.ts @@ -1,52 +1,56 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { CallToolResult, ReadResourceResult } from "@modelcontextprotocol/sdk/types.js"; import fs from "node:fs/promises"; import path from "node:path"; import { registerAppTool, registerAppResource, RESOURCE_MIME_TYPE, RESOURCE_URI_META_KEY } from "@modelcontextprotocol/ext-apps/server"; -import { startServer } from "./src/server-utils.js"; +import { startServer } from "./server-utils.js"; const DIST_DIR = path.join(import.meta.dirname, "dist"); +const RESOURCE_URI = "ui://get-time/mcp-app.html"; /** * Creates a new MCP server instance with tools and resources registered. + * Each HTTP session needs its own server instance because McpServer only supports one transport. */ -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "Basic MCP App Server (Vanilla JS)", version: "1.0.0", }); - // Two-part registration: tool + resource, tied together by the resource URI. - const resourceUri = "ui://get-time/mcp-app.html"; - - // Register a tool with UI metadata. When the host calls this tool, it reads - // `_meta[RESOURCE_URI_META_KEY]` to know which resource to fetch and render - // as an interactive UI. + // MCP Apps require two-part registration: a tool (what the LLM calls) and a + // resource (the UI it renders). The `_meta` field on the tool links to the + // resource URI, telling hosts which UI to display when the tool executes. registerAppTool(server, "get-time", { title: "Get Time", description: "Returns the current server time as an ISO 8601 string.", inputSchema: {}, - _meta: { [RESOURCE_URI_META_KEY]: resourceUri }, + _meta: { [RESOURCE_URI_META_KEY]: RESOURCE_URI }, }, async (): Promise => { const time = new Date().toISOString(); - return { content: [{ type: "text", text: time }] }; + return { + content: [{ type: "text", text: JSON.stringify({ time }) }], + }; }, ); // Register the resource, which returns the bundled HTML/JavaScript for the UI. registerAppResource(server, - resourceUri, - resourceUri, + RESOURCE_URI, + RESOURCE_URI, { mimeType: RESOURCE_MIME_TYPE }, async (): Promise => { const html = await fs.readFile(path.join(DIST_DIR, "mcp-app.html"), "utf-8"); return { contents: [ - { uri: resourceUri, mimeType: RESOURCE_MIME_TYPE, text: html }, + // Per the MCP App specification, "text/html;profile=mcp-app" signals + // to the Host that this resource is indeed for an MCP App UI. + { uri: RESOURCE_URI, mimeType: RESOURCE_MIME_TYPE, text: html }, ], }; }, @@ -55,4 +59,16 @@ function createServer(): McpServer { return server; } -startServer(createServer); +async function main() { + if (process.argv.includes("--stdio")) { + await createServer().connect(new StdioServerTransport()); + } else { + const port = parseInt(process.env.PORT ?? "3102", 10); + await startServer(createServer, { port, name: "Basic MCP App Server (Vanilla JS)" }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/basic-server-vanillajs/src/server-utils.ts b/examples/basic-server-vanillajs/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/basic-server-vanillajs/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/examples/budget-allocator-server/package.json b/examples/budget-allocator-server/package.json index 86a95100..b353042c 100644 --- a/examples/budget-allocator-server/package.json +++ b/examples/budget-allocator-server/package.json @@ -1,8 +1,20 @@ { - "name": "budget-allocator-server", - "version": "1.0.0", - "private": true, + "name": "@modelcontextprotocol/server-budget-allocator", + "version": "0.1.0", "type": "module", + "description": "Budget allocator MCP App Server with interactive visualization", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps", + "directory": "examples/budget-allocator-server" + }, + "license": "MIT", + "main": "server.ts", + "files": [ + "server.ts", + "server-utils.ts", + "dist" + ], "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build", "watch": "cross-env INPUT=mcp-app.html vite build --watch", @@ -11,10 +23,11 @@ "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", "start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio", - "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'" + "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'", + "prepublishOnly": "npm run build" }, "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "chart.js": "^4.4.0", "zod": "^4.1.13" @@ -25,6 +38,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", diff --git a/examples/budget-allocator-server/server-utils.ts b/examples/budget-allocator-server/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/budget-allocator-server/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/budget-allocator-server/server.ts b/examples/budget-allocator-server/server.ts index 2796fa78..3b780d16 100755 --- a/examples/budget-allocator-server/server.ts +++ b/examples/budget-allocator-server/server.ts @@ -5,6 +5,7 @@ * and industry benchmarks by company stage. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { CallToolResult, ReadResourceResult, @@ -18,7 +19,7 @@ import { registerAppResource, registerAppTool, } from "@modelcontextprotocol/ext-apps/server"; -import { startServer } from "./src/server-utils.js"; +import { startServer } from "./server-utils.js"; const DIST_DIR = path.join(import.meta.dirname, "dist"); @@ -231,8 +232,9 @@ const resourceUri = "ui://budget-allocator/mcp-app.html"; /** * Creates a new MCP server instance with tools and resources registered. + * Each HTTP session needs its own server instance because McpServer only supports one transport. */ -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "Budget Allocator Server", version: "1.0.0", @@ -305,4 +307,20 @@ function createServer(): McpServer { return server; } -startServer(createServer); +// --------------------------------------------------------------------------- +// Server Startup +// --------------------------------------------------------------------------- + +async function main() { + if (process.argv.includes("--stdio")) { + await createServer().connect(new StdioServerTransport()); + } else { + const port = parseInt(process.env.PORT ?? "3103", 10); + await startServer(createServer, { port, name: "Budget Allocator Server" }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/budget-allocator-server/src/server-utils.ts b/examples/budget-allocator-server/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/budget-allocator-server/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/examples/cohort-heatmap-server/package.json b/examples/cohort-heatmap-server/package.json index aff80002..ebe5dfdf 100644 --- a/examples/cohort-heatmap-server/package.json +++ b/examples/cohort-heatmap-server/package.json @@ -1,8 +1,20 @@ { - "name": "cohort-heatmap-server", - "version": "1.0.0", - "private": true, + "name": "@modelcontextprotocol/server-cohort-heatmap", + "version": "0.1.0", "type": "module", + "description": "Cohort heatmap MCP App Server for retention analysis", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps", + "directory": "examples/cohort-heatmap-server" + }, + "license": "MIT", + "main": "server.ts", + "files": [ + "server.ts", + "server-utils.ts", + "dist" + ], "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build", "watch": "cross-env INPUT=mcp-app.html vite build --watch", @@ -11,10 +23,11 @@ "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", "start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio", - "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'" + "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'", + "prepublishOnly": "npm run build" }, "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -29,6 +42,7 @@ "@vitejs/plugin-react": "^4.3.4", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", diff --git a/examples/cohort-heatmap-server/server-utils.ts b/examples/cohort-heatmap-server/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/cohort-heatmap-server/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/cohort-heatmap-server/server.ts b/examples/cohort-heatmap-server/server.ts index 4c26243c..ccbe408f 100644 --- a/examples/cohort-heatmap-server/server.ts +++ b/examples/cohort-heatmap-server/server.ts @@ -1,4 +1,5 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { ReadResourceResult } from "@modelcontextprotocol/sdk/types.js"; import fs from "node:fs/promises"; import path from "node:path"; @@ -9,7 +10,7 @@ import { registerAppResource, registerAppTool, } from "@modelcontextprotocol/ext-apps/server"; -import { startServer } from "./src/server-utils.js"; +import { startServer } from "./server-utils.js"; const DIST_DIR = path.join(import.meta.dirname, "dist"); @@ -151,7 +152,7 @@ function generateCohortData( }; } -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "Cohort Heatmap Server", version: "1.0.0", @@ -210,4 +211,16 @@ function createServer(): McpServer { return server; } -startServer(createServer); +async function main() { + if (process.argv.includes("--stdio")) { + await createServer().connect(new StdioServerTransport()); + } else { + const port = parseInt(process.env.PORT ?? "3104", 10); + await startServer(createServer, { port, name: "Cohort Heatmap Server" }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/cohort-heatmap-server/src/server-utils.ts b/examples/cohort-heatmap-server/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/cohort-heatmap-server/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/examples/customer-segmentation-server/package.json b/examples/customer-segmentation-server/package.json index b8b7f197..ec9551ba 100644 --- a/examples/customer-segmentation-server/package.json +++ b/examples/customer-segmentation-server/package.json @@ -1,8 +1,20 @@ { - "name": "customer-segmentation-server", - "version": "1.0.0", - "private": true, + "name": "@modelcontextprotocol/server-customer-segmentation", + "version": "0.1.0", "type": "module", + "description": "Customer segmentation MCP App Server with filtering", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps", + "directory": "examples/customer-segmentation-server" + }, + "license": "MIT", + "main": "server.ts", + "files": [ + "server.ts", + "server-utils.ts", + "dist" + ], "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build", "watch": "cross-env INPUT=mcp-app.html vite build --watch", @@ -11,10 +23,11 @@ "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", "start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio", - "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'" + "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'", + "prepublishOnly": "npm run build" }, "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "chart.js": "^4.4.0", "zod": "^4.1.13" @@ -25,6 +38,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", diff --git a/examples/customer-segmentation-server/server-utils.ts b/examples/customer-segmentation-server/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/customer-segmentation-server/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/customer-segmentation-server/server.ts b/examples/customer-segmentation-server/server.ts index b91ccc6d..4736f61a 100644 --- a/examples/customer-segmentation-server/server.ts +++ b/examples/customer-segmentation-server/server.ts @@ -1,4 +1,5 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { CallToolResult, ReadResourceResult, @@ -12,7 +13,7 @@ import { registerAppResource, registerAppTool, } from "@modelcontextprotocol/ext-apps/server"; -import { startServer } from "./src/server-utils.js"; +import { startServer } from "./server-utils.js"; import { generateCustomers, generateSegmentSummaries, @@ -29,7 +30,7 @@ const GetCustomerDataInputSchema = z.object({ .describe("Filter by segment (default: All)"), }); -// Cache generated data for consistency across requests +// Cache generated data for session consistency let cachedCustomers: Customer[] | null = null; let cachedSegments: SegmentSummary[] | null = null; @@ -57,8 +58,9 @@ function getCustomerData(segmentFilter?: string): { /** * Creates a new MCP server instance with tools and resources registered. + * Each HTTP session needs its own server instance because McpServer only supports one transport. */ -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "Customer Segmentation Server", version: "1.0.0", @@ -117,4 +119,19 @@ function createServer(): McpServer { return server; } -startServer(createServer); +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: "Customer Segmentation Server", + }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/customer-segmentation-server/src/server-utils.ts b/examples/customer-segmentation-server/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/customer-segmentation-server/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/examples/integration-server/server-utils.ts b/examples/integration-server/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/integration-server/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/integration-server/server.ts b/examples/integration-server/server.ts index b9ebd3b5..d2edd23f 100644 --- a/examples/integration-server/server.ts +++ b/examples/integration-server/server.ts @@ -1,17 +1,18 @@ -import { - registerAppResource, - registerAppTool, - RESOURCE_MIME_TYPE, - RESOURCE_URI_META_KEY, -} from "@modelcontextprotocol/ext-apps/server"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { CallToolResult, ReadResourceResult, } from "@modelcontextprotocol/sdk/types.js"; import fs from "node:fs/promises"; import path from "node:path"; -import { startServer } from "./src/server-utils.js"; +import { + registerAppTool, + registerAppResource, + RESOURCE_MIME_TYPE, + RESOURCE_URI_META_KEY, +} from "@modelcontextprotocol/ext-apps/server"; +import { startServer } from "./server-utils.js"; const DIST_DIR = path.join(import.meta.dirname, "dist"); const RESOURCE_URI = "ui://get-time/mcp-app.html"; @@ -19,7 +20,7 @@ const RESOURCE_URI = "ui://get-time/mcp-app.html"; /** * Creates a new MCP server instance with tools and resources registered. */ -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "Integration Test Server", version: "1.0.0", @@ -30,14 +31,18 @@ function createServer(): McpServer { "get-time", { title: "Get Time", - description: "Returns the current server time as an ISO 8601 string.", + description: "Returns the current server time.", inputSchema: {}, _meta: { [RESOURCE_URI_META_KEY]: RESOURCE_URI }, }, async (): Promise => { - const time = new Date().toISOString(); return { - content: [{ type: "text", text: JSON.stringify({ time }) }], + content: [ + { + type: "text", + text: JSON.stringify({ time: new Date().toISOString() }), + }, + ], }; }, ); @@ -52,7 +57,6 @@ function createServer(): McpServer { path.join(DIST_DIR, "mcp-app.html"), "utf-8", ); - return { contents: [ { uri: RESOURCE_URI, mimeType: RESOURCE_MIME_TYPE, text: html }, @@ -64,4 +68,16 @@ function createServer(): McpServer { return server; } -startServer(createServer); +async function main() { + if (process.argv.includes("--stdio")) { + await createServer().connect(new StdioServerTransport()); + } else { + const port = parseInt(process.env.PORT ?? "3001", 10); + await startServer(createServer, { port, name: "Integration Test Server" }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/integration-server/src/server-utils.ts b/examples/integration-server/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/integration-server/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/examples/scenario-modeler-server/package.json b/examples/scenario-modeler-server/package.json index 95c13fc1..d13875c9 100644 --- a/examples/scenario-modeler-server/package.json +++ b/examples/scenario-modeler-server/package.json @@ -1,8 +1,20 @@ { - "name": "scenario-modeler-server", - "version": "1.0.0", - "private": true, + "name": "@modelcontextprotocol/server-scenario-modeler", + "version": "0.1.0", "type": "module", + "description": "Financial scenario modeling MCP App Server", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps", + "directory": "examples/scenario-modeler-server" + }, + "license": "MIT", + "main": "server.ts", + "files": [ + "server.ts", + "server-utils.ts", + "dist" + ], "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build", "watch": "cross-env INPUT=mcp-app.html vite build --watch", @@ -11,10 +23,11 @@ "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", "start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio", - "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'" + "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'", + "prepublishOnly": "npm run build" }, "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "chart.js": "^4.4.0", "react": "^19.2.0", @@ -30,6 +43,7 @@ "@vitejs/plugin-react": "^4.3.4", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", diff --git a/examples/scenario-modeler-server/server-utils.ts b/examples/scenario-modeler-server/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/scenario-modeler-server/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/scenario-modeler-server/server.ts b/examples/scenario-modeler-server/server.ts index fc8b7f52..3ce2066f 100644 --- a/examples/scenario-modeler-server/server.ts +++ b/examples/scenario-modeler-server/server.ts @@ -1,4 +1,5 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { CallToolResult, ReadResourceResult, @@ -12,7 +13,7 @@ import { registerAppResource, registerAppTool, } from "@modelcontextprotocol/ext-apps/server"; -import { startServer } from "./src/server-utils.js"; +import { startServer } from "./server-utils.js"; const DIST_DIR = path.join(import.meta.dirname, "dist"); @@ -248,8 +249,9 @@ const DEFAULT_INPUTS: ScenarioInputs = { /** * Creates a new MCP server instance with tools and resources registered. + * Each HTTP session needs its own server instance because McpServer only supports one transport. */ -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "SaaS Scenario Modeler", version: "1.0.0", @@ -318,4 +320,23 @@ function createServer(): McpServer { return server; } -startServer(createServer); +// ============================================================================ +// Server Startup +// ============================================================================ + +async function main() { + if (process.argv.includes("--stdio")) { + await createServer().connect(new StdioServerTransport()); + } else { + const port = parseInt(process.env.PORT ?? "3106", 10); + await startServer(createServer, { + port, + name: "SaaS Scenario Modeler Server", + }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/scenario-modeler-server/src/server-utils.ts b/examples/scenario-modeler-server/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/scenario-modeler-server/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/examples/system-monitor-server/package.json b/examples/system-monitor-server/package.json index 6adfbb91..d8198d17 100644 --- a/examples/system-monitor-server/package.json +++ b/examples/system-monitor-server/package.json @@ -1,8 +1,20 @@ { - "name": "system-monitor-server", - "version": "1.0.0", - "private": true, + "name": "@modelcontextprotocol/server-system-monitor", + "version": "0.1.0", "type": "module", + "description": "System monitor MCP App Server with real-time stats", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps", + "directory": "examples/system-monitor-server" + }, + "license": "MIT", + "main": "server.ts", + "files": [ + "server.ts", + "server-utils.ts", + "dist" + ], "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build", "watch": "cross-env INPUT=mcp-app.html vite build --watch", @@ -11,10 +23,11 @@ "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", "start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio", - "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'" + "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'", + "prepublishOnly": "npm run build" }, "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "chart.js": "^4.4.0", "systeminformation": "^5.27.11", @@ -26,6 +39,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", diff --git a/examples/system-monitor-server/server-utils.ts b/examples/system-monitor-server/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/system-monitor-server/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/system-monitor-server/server.ts b/examples/system-monitor-server/server.ts index 75300507..4cf58882 100644 --- a/examples/system-monitor-server/server.ts +++ b/examples/system-monitor-server/server.ts @@ -1,4 +1,5 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { CallToolResult, ReadResourceResult, @@ -14,7 +15,7 @@ import { registerAppResource, registerAppTool, } from "@modelcontextprotocol/ext-apps/server"; -import { startServer } from "./src/server-utils.js"; +import { startServer } from "./server-utils.js"; // Schemas - types are derived from these using z.infer const CpuCoreSchema = z.object({ @@ -106,7 +107,7 @@ async function getMemoryStats(): Promise { }; } -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "System Monitor Server", version: "1.0.0", @@ -180,4 +181,16 @@ function createServer(): McpServer { return server; } -startServer(createServer); +async function main() { + if (process.argv.includes("--stdio")) { + await createServer().connect(new StdioServerTransport()); + } else { + const port = parseInt(process.env.PORT ?? "3107", 10); + await startServer(createServer, { port, name: "System Monitor Server" }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/system-monitor-server/src/server-utils.ts b/examples/system-monitor-server/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/system-monitor-server/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/examples/threejs-server/package.json b/examples/threejs-server/package.json index bdc00f55..8145b8e2 100644 --- a/examples/threejs-server/package.json +++ b/examples/threejs-server/package.json @@ -1,8 +1,20 @@ { - "name": "threejs-server", - "version": "1.0.0", - "private": true, + "name": "@modelcontextprotocol/server-threejs", + "version": "0.1.0", "type": "module", + "description": "Three.js 3D visualization MCP App Server", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps", + "directory": "examples/threejs-server" + }, + "license": "MIT", + "main": "server.ts", + "files": [ + "server.ts", + "server-utils.ts", + "dist" + ], "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build", "watch": "cross-env INPUT=mcp-app.html vite build --watch", @@ -11,10 +23,11 @@ "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", "start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio", - "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'" + "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'", + "prepublishOnly": "npm run build" }, "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -31,6 +44,7 @@ "@vitejs/plugin-react": "^4.3.4", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", diff --git a/examples/threejs-server/server-utils.ts b/examples/threejs-server/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/threejs-server/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/threejs-server/server.ts b/examples/threejs-server/server.ts index 8732a5f6..e2f28c7d 100644 --- a/examples/threejs-server/server.ts +++ b/examples/threejs-server/server.ts @@ -4,6 +4,7 @@ * Provides tools for rendering interactive 3D scenes using Three.js. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { ReadResourceResult } from "@modelcontextprotocol/sdk/types.js"; import fs from "node:fs/promises"; import path from "node:path"; @@ -14,7 +15,7 @@ import { registerAppResource, registerAppTool, } from "@modelcontextprotocol/ext-apps/server"; -import { startServer } from "./src/server-utils.js"; +import { startServer } from "./server-utils.js"; const DIST_DIR = path.join(import.meta.dirname, "dist"); @@ -137,8 +138,9 @@ const resourceUri = "ui://threejs/mcp-app.html"; /** * Creates a new MCP server instance with tools and resources registered. + * Each HTTP session needs its own server instance because McpServer only supports one transport. */ -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "Three.js Server", version: "1.0.0", @@ -221,4 +223,16 @@ function createServer(): McpServer { return server; } -startServer(createServer); +async function main() { + if (process.argv.includes("--stdio")) { + await createServer().connect(new StdioServerTransport()); + } else { + const port = parseInt(process.env.PORT ?? "3108", 10); + await startServer(createServer, { port, name: "Three.js Server" }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/threejs-server/src/server-utils.ts b/examples/threejs-server/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/threejs-server/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/examples/wiki-explorer-server/package.json b/examples/wiki-explorer-server/package.json index 5c389c31..47fba403 100644 --- a/examples/wiki-explorer-server/package.json +++ b/examples/wiki-explorer-server/package.json @@ -1,8 +1,20 @@ { - "name": "wiki-explorer-server", - "version": "1.0.0", - "private": true, + "name": "@modelcontextprotocol/server-wiki-explorer", + "version": "0.1.0", "type": "module", + "description": "Wikipedia link explorer MCP App Server with graph visualization", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps", + "directory": "examples/wiki-explorer-server" + }, + "license": "MIT", + "main": "server.ts", + "files": [ + "server.ts", + "server-utils.ts", + "dist" + ], "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build", "watch": "cross-env INPUT=mcp-app.html vite build --watch", @@ -11,10 +23,11 @@ "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", "start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio", - "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'" + "dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'", + "prepublishOnly": "npm run build" }, "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "cheerio": "^1.0.0", "zod": "^4.1.13" @@ -25,6 +38,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "force-graph": "^1.49.0", "typescript": "^5.9.3", diff --git a/examples/wiki-explorer-server/server-utils.ts b/examples/wiki-explorer-server/server-utils.ts new file mode 100644 index 00000000..c700c818 --- /dev/null +++ b/examples/wiki-explorer-server/server-utils.ts @@ -0,0 +1,68 @@ +/** + * Shared utilities for running MCP servers with Streamable HTTP transport. + */ + +import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import cors from "cors"; +import type { Request, Response } from "express"; + +export interface ServerOptions { + port: number; + name?: string; +} + +/** + * Starts an MCP server with Streamable HTTP transport in stateless mode. + * + * @param createServer - Factory function that creates a new McpServer instance per request. + * @param options - Server configuration options. + */ +export async function startServer( + createServer: () => McpServer, + options: ServerOptions, +): Promise { + const { port, name = "MCP Server" } = options; + + const app = createMcpExpressApp({ host: "0.0.0.0" }); + app.use(cors()); + + app.all("/mcp", async (req: Request, res: Response) => { + const server = createServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + res.on("close", () => { + transport.close().catch(() => {}); + server.close().catch(() => {}); + }); + + try { + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + } catch (error) { + console.error("MCP error:", error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: "2.0", + error: { code: -32603, message: "Internal server error" }, + id: null, + }); + } + } + }); + + const httpServer = app.listen(port, () => { + console.log(`${name} listening on http://localhost:${port}/mcp`); + }); + + const shutdown = () => { + console.log("\nShutting down..."); + httpServer.close(() => process.exit(0)); + }; + + process.on("SIGINT", shutdown); + process.on("SIGTERM", shutdown); +} diff --git a/examples/wiki-explorer-server/server.ts b/examples/wiki-explorer-server/server.ts index 99670c6a..063cacfe 100644 --- a/examples/wiki-explorer-server/server.ts +++ b/examples/wiki-explorer-server/server.ts @@ -1,4 +1,5 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import type { CallToolResult, ReadResourceResult, @@ -13,7 +14,7 @@ import { registerAppResource, registerAppTool, } from "@modelcontextprotocol/ext-apps/server"; -import { startServer } from "./src/server-utils.js"; +import { startServer } from "./server-utils.js"; const DIST_DIR = path.join(import.meta.dirname, "dist"); @@ -71,7 +72,7 @@ function extractWikiLinks(pageUrl: URL, html: string): PageInfo[] { })); } -function createServer(): McpServer { +export function createServer(): McpServer { const server = new McpServer({ name: "Wiki Explorer", version: "1.0.0", @@ -151,4 +152,16 @@ function createServer(): McpServer { return server; } -startServer(createServer); +async function main() { + if (process.argv.includes("--stdio")) { + await createServer().connect(new StdioServerTransport()); + } else { + const port = parseInt(process.env.PORT ?? "3109", 10); + await startServer(createServer, { port, name: "Wiki Explorer" }); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/examples/wiki-explorer-server/src/server-utils.ts b/examples/wiki-explorer-server/src/server-utils.ts deleted file mode 100644 index 40524237..00000000 --- a/examples/wiki-explorer-server/src/server-utils.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Shared utilities for running MCP servers with various transports. - */ - -import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js"; -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; -import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import cors from "cors"; -import type { Request, Response } from "express"; - -/** - * Starts an MCP server using the appropriate transport based on command-line arguments. - * - * If `--stdio` is passed, uses stdio transport. Otherwise, uses Streamable HTTP transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startServer( - createServer: () => McpServer, -): Promise { - try { - if (process.argv.includes("--stdio")) { - await startStdioServer(createServer); - } else { - await startStreamableHttpServer(createServer); - } - } catch (e) { - console.error(e); - process.exit(1); - } -} - -/** - * Starts an MCP server with stdio transport. - * - * @param createServer - Factory function that creates a new McpServer instance. - */ -export async function startStdioServer( - createServer: () => McpServer, -): Promise { - await createServer().connect(new StdioServerTransport()); -} - -/** - * Starts an MCP server with Streamable HTTP transport in stateless mode. - * - * Each request creates a fresh server and transport instance, which are - * closed when the response ends (no session tracking). - * - * The server listens on the port specified by the PORT environment variable, - * defaulting to 3001 if not set. - * - * @param createServer - Factory function that creates a new McpServer instance per request. - */ -export async function startStreamableHttpServer( - createServer: () => McpServer, -): Promise { - const port = parseInt(process.env.PORT ?? "3001", 10); - - // Express app - bind to all interfaces for development/testing - const expressApp = createMcpExpressApp({ host: "0.0.0.0" }); - expressApp.use(cors()); - - expressApp.all("/mcp", async (req: Request, res: Response) => { - // Create fresh server and transport for each request (stateless mode) - const server = createServer(); - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined, - }); - - // Clean up when response ends - res.on("close", () => { - transport.close().catch(() => {}); - server.close().catch(() => {}); - }); - - try { - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - } catch (error) { - console.error("MCP error:", error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: "2.0", - error: { code: -32603, message: "Internal server error" }, - id: null, - }); - } - } - }); - - const { promise, resolve, reject } = Promise.withResolvers(); - - const httpServer = expressApp.listen(port, (err?: Error) => { - if (err) return reject(err); - console.log(`Server listening on http://localhost:${port}/mcp`); - resolve(); - }); - - const shutdown = () => { - console.log("\nShutting down..."); - httpServer.close(() => process.exit(0)); - }; - - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - - return promise; -} diff --git a/package-lock.json b/package-lock.json index 00ad1e77..a23486f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -111,9 +111,11 @@ "license": "MIT" }, "examples/basic-server-react": { - "version": "1.0.0", + "name": "@modelcontextprotocol/server-basic-react", + "version": "0.1.0", + "license": "MIT", "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -128,6 +130,7 @@ "@vitejs/plugin-react": "^4.3.4", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", @@ -152,9 +155,11 @@ "license": "MIT" }, "examples/basic-server-vanillajs": { - "version": "1.0.0", + "name": "@modelcontextprotocol/server-basic-vanillajs", + "version": "0.1.0", + "license": "MIT", "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "zod": "^4.1.13" }, @@ -164,6 +169,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", @@ -188,9 +194,11 @@ "license": "MIT" }, "examples/budget-allocator-server": { - "version": "1.0.0", + "name": "@modelcontextprotocol/server-budget-allocator", + "version": "0.1.0", + "license": "MIT", "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "chart.js": "^4.4.0", "zod": "^4.1.13" @@ -201,6 +209,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", @@ -225,9 +234,11 @@ "license": "MIT" }, "examples/cohort-heatmap-server": { - "version": "1.0.0", + "name": "@modelcontextprotocol/server-cohort-heatmap", + "version": "0.1.0", + "license": "MIT", "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -242,6 +253,7 @@ "@vitejs/plugin-react": "^4.3.4", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", @@ -266,9 +278,11 @@ "license": "MIT" }, "examples/customer-segmentation-server": { - "version": "1.0.0", + "name": "@modelcontextprotocol/server-customer-segmentation", + "version": "0.1.0", + "license": "MIT", "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "chart.js": "^4.4.0", "zod": "^4.1.13" @@ -279,6 +293,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", @@ -306,7 +321,7 @@ "version": "1.0.0", "dependencies": { "@modelcontextprotocol/ext-apps": "../..", - "@modelcontextprotocol/sdk": "^1.22.0", + "@modelcontextprotocol/sdk": "^1.24.0", "react": "^19.2.0", "react-dom": "^19.2.0", "zod": "^4.1.13" @@ -318,7 +333,6 @@ "@types/react": "^19.2.2", "@types/react-dom": "^19.2.2", "@vitejs/plugin-react": "^4.3.4", - "bun": "^1.3.2", "concurrently": "^9.2.1", "cors": "^2.8.5", "express": "^5.1.0", @@ -329,8 +343,6 @@ }, "examples/integration-server/node_modules/@types/node": { "version": "22.19.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.3.tgz", - "integrity": "sha512-1N9SBnWYOJTrNZCdh/yJE+t910Y128BoyY+zBLWhL3r0TYzlTmFdXrPwHL9DyFZmlEXNQQolTZh3KHV31QDhyA==", "dev": true, "license": "MIT", "dependencies": { @@ -345,9 +357,11 @@ "license": "MIT" }, "examples/scenario-modeler-server": { - "version": "1.0.0", + "name": "@modelcontextprotocol/server-scenario-modeler", + "version": "0.1.0", + "license": "MIT", "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "chart.js": "^4.4.0", "react": "^19.2.0", @@ -363,6 +377,7 @@ "@vitejs/plugin-react": "^4.3.4", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", @@ -387,9 +402,11 @@ "license": "MIT" }, "examples/system-monitor-server": { - "version": "1.0.0", + "name": "@modelcontextprotocol/server-system-monitor", + "version": "0.1.0", + "license": "MIT", "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "chart.js": "^4.4.0", "systeminformation": "^5.27.11", @@ -401,6 +418,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", @@ -425,9 +443,11 @@ "license": "MIT" }, "examples/threejs-server": { - "version": "1.0.0", + "name": "@modelcontextprotocol/server-threejs", + "version": "0.1.0", + "license": "MIT", "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -444,6 +464,7 @@ "@vitejs/plugin-react": "^4.3.4", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "typescript": "^5.9.3", "vite": "^6.0.0", @@ -468,9 +489,11 @@ "license": "MIT" }, "examples/wiki-explorer-server": { - "version": "1.0.0", + "name": "@modelcontextprotocol/server-wiki-explorer", + "version": "0.1.0", + "license": "MIT", "dependencies": { - "@modelcontextprotocol/ext-apps": "../..", + "@modelcontextprotocol/ext-apps": "^0.2.2", "@modelcontextprotocol/sdk": "^1.24.0", "cheerio": "^1.0.0", "zod": "^4.1.13" @@ -481,6 +504,7 @@ "@types/node": "^22.0.0", "concurrently": "^9.2.1", "cors": "^2.8.5", + "cross-env": "^10.1.0", "express": "^5.1.0", "force-graph": "^1.49.0", "typescript": "^5.9.3", @@ -534,7 +558,6 @@ "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -843,74 +866,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", - "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", - "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", - "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", - "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, "node_modules/@esbuild/darwin-arm64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", @@ -928,553 +883,413 @@ "node": ">=18" } }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", - "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", - "cpu": [ - "x64" - ], + "node_modules/@gerrit0/mini-shiki": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.19.0.tgz", + "integrity": "sha512-ZSlWfLvr8Nl0T4iA3FF/8VH8HivYF82xQts2DY0tJxZd4wtXJ8AA0nmdW9lmO4hlrh3f9xNwEPtOgqETPqKwDA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@shikijs/engine-oniguruma": "^3.19.0", + "@shikijs/langs": "^3.19.0", + "@shikijs/themes": "^3.19.0", + "@shikijs/types": "^3.19.0", + "@shikijs/vscode-textmate": "^10.0.2" } }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", - "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", - "cpu": [ - "arm64" - ], + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", - "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", - "cpu": [ - "x64" - ], + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", - "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", - "cpu": [ - "arm" - ], + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=6.0.0" } }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", - "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", - "cpu": [ - "arm64" - ], + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } + "license": "MIT" }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", - "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", - "cpu": [ - "ia32" - ], + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", - "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } + "node_modules/@kurkle/color": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz", + "integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==", + "license": "MIT" }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", - "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } + "node_modules/@modelcontextprotocol/ext-apps": { + "resolved": "", + "link": true }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", - "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } + "node_modules/@modelcontextprotocol/ext-apps-basic-host": { + "resolved": "examples/basic-host", + "link": true }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", - "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", - "cpu": [ - "riscv64" - ], - "dev": true, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.24.3", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.24.3.tgz", + "integrity": "sha512-YgSHW29fuzKKAHTGe9zjNoo+yF8KaQPzDC2W9Pv41E7/57IfY+AMGJ/aDFlgTLcVVELoggKE4syABCE75u3NCw==", "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.0.1", + "express-rate-limit": "^7.5.0", + "jose": "^6.1.1", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.0" + }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } } }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", - "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", - "cpu": [ - "s390x" - ], + "node_modules/@modelcontextprotocol/server-basic-react": { + "resolved": "examples/basic-server-react", + "link": true + }, + "node_modules/@modelcontextprotocol/server-basic-vanillajs": { + "resolved": "examples/basic-server-vanillajs", + "link": true + }, + "node_modules/@modelcontextprotocol/server-budget-allocator": { + "resolved": "examples/budget-allocator-server", + "link": true + }, + "node_modules/@modelcontextprotocol/server-cohort-heatmap": { + "resolved": "examples/cohort-heatmap-server", + "link": true + }, + "node_modules/@modelcontextprotocol/server-customer-segmentation": { + "resolved": "examples/customer-segmentation-server", + "link": true + }, + "node_modules/@modelcontextprotocol/server-scenario-modeler": { + "resolved": "examples/scenario-modeler-server", + "link": true + }, + "node_modules/@modelcontextprotocol/server-system-monitor": { + "resolved": "examples/system-monitor-server", + "link": true + }, + "node_modules/@modelcontextprotocol/server-threejs": { + "resolved": "examples/threejs-server", + "link": true + }, + "node_modules/@modelcontextprotocol/server-wiki-explorer": { + "resolved": "examples/wiki-explorer-server", + "link": true + }, + "node_modules/@oclif/core": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.8.0.tgz", + "integrity": "sha512-jteNUQKgJHLHFbbz806aGZqf+RJJ7t4gwF4MYa8fCwCxQ8/klJNWc0MvaJiBebk7Mc+J39mdlsB4XraaCKznFw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "ansi-escapes": "^4.3.2", + "ansis": "^3.17.0", + "clean-stack": "^3.0.1", + "cli-spinners": "^2.9.2", + "debug": "^4.4.3", + "ejs": "^3.1.10", + "get-package-type": "^0.1.0", + "indent-string": "^4.0.0", + "is-wsl": "^2.2.0", + "lilconfig": "^3.1.3", + "minimatch": "^9.0.5", + "semver": "^7.7.3", + "string-width": "^4.2.3", + "supports-color": "^8", + "tinyglobby": "^0.2.14", + "widest-line": "^3.1.0", + "wordwrap": "^1.0.0", + "wrap-ansi": "^7.0.0" + }, "engines": { - "node": ">=18" + "node": ">=18.0.0" } }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", - "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", - "cpu": [ - "x64" - ], + "node_modules/@oclif/core/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@oclif/core/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, "engines": { - "node": ">=18" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", - "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "node_modules/@oven/bun-darwin-aarch64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.3.5.tgz", + "integrity": "sha512-8GvNtMo0NINM7Emk9cNAviCG3teEgr3BUX9be0+GD029zIagx2Sf54jMui1Eu1IpFm7nWHODuLEefGOQNaJ0gQ==", "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } + "darwin" + ] }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", - "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "node_modules/@oven/bun-darwin-x64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.3.5.tgz", + "integrity": "sha512-r33eHQOHAwkuiBJIwmkXIyqONQOQMnd1GMTpDzaxx9vf9+svby80LZO9Hcm1ns6KT/TBRFyODC/0loA7FAaffg==", "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } + "darwin" + ] }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", - "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "node_modules/@oven/bun-darwin-x64-baseline": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.3.5.tgz", + "integrity": "sha512-p5q3rJk48qhLuLBOFehVc+kqCE03YrswTc6NCxbwsxiwfySXwcAvpF2KWKF/ZZObvvR8hCCvqe1F81b2p5r2dg==", "cpu": [ - "arm64" + "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } + "darwin" + ] }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", - "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "node_modules/@oven/bun-linux-aarch64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.3.5.tgz", + "integrity": "sha512-zkcHPI23QxJ1TdqafhgkXt1NOEN8o5C460sVeNnrhfJ43LwZgtfcvcQE39x/pBedu67fatY8CU0iY00nOh46ZQ==", "cpu": [ - "x64" + "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } + "linux" + ] }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", - "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "node_modules/@oven/bun-linux-aarch64-musl": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.3.5.tgz", + "integrity": "sha512-HKBeUlJdNduRkzJKZ5DXM+pPqntfC50/Hu2X65jVX0Y7hu/6IC8RaUTqpr8FtCZqqmc9wDK0OTL+Mbi9UQIKYQ==", "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } + "linux" + ] }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", - "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "node_modules/@oven/bun-linux-x64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.3.5.tgz", + "integrity": "sha512-n7zhKTSDZS0yOYg5Rq8easZu5Y/o47sv0c7yGr2ciFdcie9uYV55fZ7QMqhWMGK33ezCSikh5EDkUMCIvfWpjA==", "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } + "linux" + ] }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", - "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "node_modules/@oven/bun-linux-x64-baseline": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.3.5.tgz", + "integrity": "sha512-FeCQyBU62DMuB0nn01vPnf3McXrKOsrK9p7sHaBFYycw0mmoU8kCq/WkBkGMnLuvQljJSyen8QBTx+fXdNupWg==", "cpu": [ - "arm64" + "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } + "linux" + ] }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", - "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "node_modules/@oven/bun-linux-x64-musl": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.3.5.tgz", + "integrity": "sha512-XkCCHkByYn8BIDvoxnny898znju4xnW2kvFE8FT5+0Y62cWdcBGMZ9RdsEUTeRz16k8hHtJpaSfLcEmNTFIwRQ==", "cpu": [ - "ia32" + "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ - "win32" + "linux" + ] + }, + "node_modules/@oven/bun-linux-x64-musl-baseline": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.3.5.tgz", + "integrity": "sha512-TJiYC7KCr0XxFTsxgwQOeE7dncrEL/RSyL0EzSL3xRkrxJMWBCvCSjQn7LV1i6T7hFst0+3KoN3VWvD5BinqHA==", + "cpu": [ + "x64" ], - "engines": { - "node": ">=18" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", - "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "node_modules/@oven/bun-windows-x64": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.3.5.tgz", + "integrity": "sha512-T3xkODItb/0ftQPFsZDc7EAX2D6A4TEazQ2YZyofZToO8Q7y8YT8ooWdhd0BQiTCd66uEvgE1DCZetynwg2IoA==", "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@gerrit0/mini-shiki": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.19.0.tgz", - "integrity": "sha512-ZSlWfLvr8Nl0T4iA3FF/8VH8HivYF82xQts2DY0tJxZd4wtXJ8AA0nmdW9lmO4hlrh3f9xNwEPtOgqETPqKwDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/engine-oniguruma": "^3.19.0", - "@shikijs/langs": "^3.19.0", - "@shikijs/themes": "^3.19.0", - "@shikijs/types": "^3.19.0", - "@shikijs/vscode-textmate": "^10.0.2" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } + ] }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, + "node_modules/@oven/bun-windows-x64-baseline": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.3.5.tgz", + "integrity": "sha512-rtVQB9/1XK8FWJgFtsOthbPifRMYypgJwxu+pK3NHx8WvFKmq7HcPDqNr8xLzGULjQEO7eAo2aOZfONOwYz+5g==", + "cpu": [ + "x64" + ], "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "node_modules/@playwright/test": { + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.57.0.tgz", + "integrity": "sha512-6TyEnHgd6SArQO8UO2OMTxshln3QMWBtPGrOCgs3wVEmQmwyuNtB10IZMfmYDE0riwNR1cu4q+pPcxMVtaG3TA==", "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@kurkle/color": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz", - "integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==", - "license": "MIT" - }, - "node_modules/@modelcontextprotocol/ext-apps": { - "resolved": "", - "link": true - }, - "node_modules/@modelcontextprotocol/ext-apps-basic-host": { - "resolved": "examples/basic-host", - "link": true - }, - "node_modules/@modelcontextprotocol/sdk": { - "version": "1.24.3", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.24.3.tgz", - "integrity": "sha512-YgSHW29fuzKKAHTGe9zjNoo+yF8KaQPzDC2W9Pv41E7/57IfY+AMGJ/aDFlgTLcVVELoggKE4syABCE75u3NCw==", - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "ajv": "^8.17.1", - "ajv-formats": "^3.0.1", - "content-type": "^1.0.5", - "cors": "^2.8.5", - "cross-spawn": "^7.0.5", - "eventsource": "^3.0.2", - "eventsource-parser": "^3.0.0", - "express": "^5.0.1", - "express-rate-limit": "^7.5.0", - "jose": "^6.1.1", - "pkce-challenge": "^5.0.0", - "raw-body": "^3.0.0", - "zod": "^3.25 || ^4.0", - "zod-to-json-schema": "^3.25.0" + "playwright": "1.57.0" + }, + "bin": { + "playwright": "cli.js" }, "engines": { "node": ">=18" - }, - "peerDependencies": { - "@cfworker/json-schema": "^4.1.1", - "zod": "^3.25 || ^4.0" - }, - "peerDependenciesMeta": { - "@cfworker/json-schema": { - "optional": true - }, - "zod": { - "optional": false - } } }, - "node_modules/@oclif/core": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.8.0.tgz", - "integrity": "sha512-jteNUQKgJHLHFbbz806aGZqf+RJJ7t4gwF4MYa8fCwCxQ8/klJNWc0MvaJiBebk7Mc+J39mdlsB4XraaCKznFw==", + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", "dev": true, - "license": "MIT", - "dependencies": { - "ansi-escapes": "^4.3.2", - "ansis": "^3.17.0", - "clean-stack": "^3.0.1", - "cli-spinners": "^2.9.2", - "debug": "^4.4.3", - "ejs": "^3.1.10", - "get-package-type": "^0.1.0", - "indent-string": "^4.0.0", - "is-wsl": "^2.2.0", - "lilconfig": "^3.1.3", - "minimatch": "^9.0.5", - "semver": "^7.7.3", - "string-width": "^4.2.3", - "supports-color": "^8", - "tinyglobby": "^0.2.14", - "widest-line": "^3.1.0", - "wordwrap": "^1.0.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=18.0.0" - } + "license": "MIT" }, - "node_modules/@oclif/core/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.3.tgz", + "integrity": "sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@oclif/core/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "optional": true, + "os": [ + "android" + ] }, - "node_modules/@oven/bun-darwin-aarch64": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.3.5.tgz", - "integrity": "sha512-8GvNtMo0NINM7Emk9cNAviCG3teEgr3BUX9be0+GD029zIagx2Sf54jMui1Eu1IpFm7nWHODuLEefGOQNaJ0gQ==", + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.3.tgz", + "integrity": "sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==", "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ - "darwin" + "android" ] }, - "node_modules/@oven/bun-darwin-x64": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.3.5.tgz", - "integrity": "sha512-r33eHQOHAwkuiBJIwmkXIyqONQOQMnd1GMTpDzaxx9vf9+svby80LZO9Hcm1ns6KT/TBRFyODC/0loA7FAaffg==", + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.3.tgz", + "integrity": "sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==", "cpu": [ - "x64" + "arm64" ], "license": "MIT", "optional": true, @@ -1482,10 +1297,10 @@ "darwin" ] }, - "node_modules/@oven/bun-darwin-x64-baseline": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.3.5.tgz", - "integrity": "sha512-p5q3rJk48qhLuLBOFehVc+kqCE03YrswTc6NCxbwsxiwfySXwcAvpF2KWKF/ZZObvvR8hCCvqe1F81b2p5r2dg==", + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.53.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.5.tgz", + "integrity": "sha512-YTbnsAaHo6VrAczISxgpTva8EkfQus0VPEVJCEaboHtZRIb6h6j0BNxRBOwnDciFTZLDPW5r+ZBmhL/+YpTZgA==", "cpu": [ "x64" ], @@ -1495,223 +1310,42 @@ "darwin" ] }, - "node_modules/@oven/bun-linux-aarch64": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.3.5.tgz", - "integrity": "sha512-zkcHPI23QxJ1TdqafhgkXt1NOEN8o5C460sVeNnrhfJ43LwZgtfcvcQE39x/pBedu67fatY8CU0iY00nOh46ZQ==", + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.3.tgz", + "integrity": "sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==", "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "freebsd" ] }, - "node_modules/@oven/bun-linux-aarch64-musl": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.3.5.tgz", - "integrity": "sha512-HKBeUlJdNduRkzJKZ5DXM+pPqntfC50/Hu2X65jVX0Y7hu/6IC8RaUTqpr8FtCZqqmc9wDK0OTL+Mbi9UQIKYQ==", + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.3.tgz", + "integrity": "sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==", "cpu": [ - "arm64" + "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "freebsd" ] }, - "node_modules/@oven/bun-linux-x64": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.3.5.tgz", - "integrity": "sha512-n7zhKTSDZS0yOYg5Rq8easZu5Y/o47sv0c7yGr2ciFdcie9uYV55fZ7QMqhWMGK33ezCSikh5EDkUMCIvfWpjA==", + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.3.tgz", + "integrity": "sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==", "cpu": [ - "x64" + "arm" ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@oven/bun-linux-x64-baseline": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.3.5.tgz", - "integrity": "sha512-FeCQyBU62DMuB0nn01vPnf3McXrKOsrK9p7sHaBFYycw0mmoU8kCq/WkBkGMnLuvQljJSyen8QBTx+fXdNupWg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@oven/bun-linux-x64-musl": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.3.5.tgz", - "integrity": "sha512-XkCCHkByYn8BIDvoxnny898znju4xnW2kvFE8FT5+0Y62cWdcBGMZ9RdsEUTeRz16k8hHtJpaSfLcEmNTFIwRQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@oven/bun-linux-x64-musl-baseline": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.3.5.tgz", - "integrity": "sha512-TJiYC7KCr0XxFTsxgwQOeE7dncrEL/RSyL0EzSL3xRkrxJMWBCvCSjQn7LV1i6T7hFst0+3KoN3VWvD5BinqHA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@oven/bun-windows-x64": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.3.5.tgz", - "integrity": "sha512-T3xkODItb/0ftQPFsZDc7EAX2D6A4TEazQ2YZyofZToO8Q7y8YT8ooWdhd0BQiTCd66uEvgE1DCZetynwg2IoA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@oven/bun-windows-x64-baseline": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.3.5.tgz", - "integrity": "sha512-rtVQB9/1XK8FWJgFtsOthbPifRMYypgJwxu+pK3NHx8WvFKmq7HcPDqNr8xLzGULjQEO7eAo2aOZfONOwYz+5g==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@playwright/test": { - "version": "1.57.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.57.0.tgz", - "integrity": "sha512-6TyEnHgd6SArQO8UO2OMTxshln3QMWBtPGrOCgs3wVEmQmwyuNtB10IZMfmYDE0riwNR1cu4q+pPcxMVtaG3TA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "playwright": "1.57.0" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.0-beta.27", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", - "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.3.tgz", - "integrity": "sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.3.tgz", - "integrity": "sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.3.tgz", - "integrity": "sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.3.tgz", - "integrity": "sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.3.tgz", - "integrity": "sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.3.tgz", - "integrity": "sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.3.tgz", - "integrity": "sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==", - "cpu": [ - "arm" - ], - "dev": true, + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1733,9 +1367,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.3.tgz", - "integrity": "sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==", + "version": "4.53.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.5.tgz", + "integrity": "sha512-Y+qVA0D9d0y2FRNiG9oM3Hut/DgODZbU9I8pLLPwAsU0tUKZ49cyV1tzmB/qRbSzGvY8lpgGkJuMyuhH7Ma+Vg==", "cpu": [ "arm64" ], @@ -1830,9 +1464,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.3.tgz", - "integrity": "sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==", + "version": "4.53.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.5.tgz", + "integrity": "sha512-Pg6E+oP7GvZ4XwgRJBuSXZjcqpIW3yCBhK4BcsANvb47qMvAbCjR6E+1a/U2WXz1JJxp9/4Dno3/iSJLcm5auw==", "cpu": [ "x64" ], @@ -1913,9 +1547,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.3.tgz", - "integrity": "sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==", + "version": "4.53.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.5.tgz", + "integrity": "sha512-JRpZUhCfhZ4keB5v0fe02gQJy05GqboPOaxvjugW04RLSYYoB/9t2lx2u/tMs/Na/1NXfY8QYjgRljRpN+MjTQ==", "cpu": [ "x64" ], @@ -2140,7 +1774,6 @@ "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -2165,7 +1798,6 @@ "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -2560,14 +2192,6 @@ "baseline-browser-mapping": "dist/cli.js" } }, - "node_modules/basic-server-react": { - "resolved": "examples/basic-server-react", - "link": true - }, - "node_modules/basic-server-vanillajs": { - "resolved": "examples/basic-server-vanillajs", - "link": true - }, "node_modules/bezier-js": { "version": "6.1.4", "resolved": "https://registry.npmjs.org/bezier-js/-/bezier-js-6.1.4.tgz", @@ -2666,7 +2290,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -2681,44 +2304,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/budget-allocator-server": { - "resolved": "examples/budget-allocator-server", - "link": true - }, - "node_modules/bun": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/bun/-/bun-1.3.5.tgz", - "integrity": "sha512-c1YHIGUfgvYPJmLug5QiLzNWlX2Dg7X/67JWu1Va+AmMXNXzC/KQn2lgQ7rD+n1u1UqDpJMowVGGxTNpbPydNw==", - "cpu": [ - "arm64", - "x64" - ], - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "os": [ - "darwin", - "linux", - "win32" - ], - "bin": { - "bun": "bin/bun.exe", - "bunx": "bin/bunx.exe" - }, - "optionalDependencies": { - "@oven/bun-darwin-aarch64": "1.3.5", - "@oven/bun-darwin-x64": "1.3.5", - "@oven/bun-darwin-x64-baseline": "1.3.5", - "@oven/bun-linux-aarch64": "1.3.5", - "@oven/bun-linux-aarch64-musl": "1.3.5", - "@oven/bun-linux-x64": "1.3.5", - "@oven/bun-linux-x64-baseline": "1.3.5", - "@oven/bun-linux-x64-musl": "1.3.5", - "@oven/bun-linux-x64-musl-baseline": "1.3.5", - "@oven/bun-windows-x64": "1.3.5", - "@oven/bun-windows-x64-baseline": "1.3.5" - } - }, "node_modules/bun-types": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.3.3.tgz", @@ -3064,10 +2649,6 @@ "node": ">=8" } }, - "node_modules/cohort-heatmap-server": { - "resolved": "examples/cohort-heatmap-server", - "link": true - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -3254,10 +2835,6 @@ "dev": true, "license": "MIT" }, - "node_modules/customer-segmentation-server": { - "resolved": "examples/customer-segmentation-server", - "link": true - }, "node_modules/d3-array": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", @@ -3416,7 +2993,6 @@ "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "dev": true, "license": "ISC", - "peer": true, "engines": { "node": ">=12" } @@ -3864,7 +3440,6 @@ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", @@ -4079,7 +3654,6 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, - "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ @@ -5261,7 +4835,6 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ @@ -5401,7 +4974,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.1.tgz", "integrity": "sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5500,7 +5072,6 @@ "integrity": "sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/estree": "1.0.8" }, @@ -5537,27 +5108,83 @@ "fsevents": "~2.3.2" } }, - "node_modules/router": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", - "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "node_modules/rollup/node_modules/@rollup/rollup-darwin-x64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.3.tgz", + "integrity": "sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==", + "cpu": [ + "x64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "debug": "^4.4.0", - "depd": "^2.0.0", - "is-promise": "^4.0.0", - "parseurl": "^1.3.3", - "path-to-regexp": "^8.0.0" - }, - "engines": { - "node": ">= 18" - } + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/rxjs": { - "version": "7.8.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", - "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", - "dev": true, + "node_modules/rollup/node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.3.tgz", + "integrity": "sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/rollup/node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.3.tgz", + "integrity": "sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/rollup/node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.3.tgz", + "integrity": "sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" @@ -5569,10 +5196,6 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, - "node_modules/scenario-modeler-server": { - "resolved": "examples/scenario-modeler-server", - "link": true - }, "node_modules/scheduler": { "version": "0.27.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", @@ -5957,10 +5580,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/system-monitor-server": { - "resolved": "examples/system-monitor-server", - "link": true - }, "node_modules/systeminformation": { "version": "5.27.11", "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.27.11.tgz", @@ -6205,10 +5824,6 @@ "integrity": "sha512-k/CjiZ80bYss6Qs7/ex1TBlPD11whT9oKfT8oTGiHa34W4JRd1NiH/Tr1DbHWQ2/vMUypxksLnF2CfmlmM5XFQ==", "license": "MIT" }, - "node_modules/threejs-server": { - "resolved": "examples/threejs-server", - "link": true - }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -6261,636 +5876,210 @@ }, "peerDependenciesMeta": { "picomatch": { - "optional": true - } - } - }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/tinypool": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", - "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.0.0 || >=20.0.0" - } - }, - "node_modules/tinyrainbow": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", - "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", - "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/touch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", - "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", - "dev": true, - "license": "ISC", - "bin": { - "nodetouch": "bin/nodetouch.js" - } - }, - "node_modules/tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true, - "license": "MIT", - "bin": { - "tree-kill": "cli.js" - } - }, - "node_modules/ts-to-zod": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ts-to-zod/-/ts-to-zod-5.1.0.tgz", - "integrity": "sha512-giqqlvRHunlJqG9tBL/KAO3wWIVZGF//mZiWLKm/fdQnKnz4EN2mtiK5cugN9slytBkdMEXQIaLvMzIScbhhFw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@clack/prompts": "1.0.0-alpha.4", - "@oclif/core": "^4.5.4", - "@typescript/vfs": "^1.5.0", - "chokidar": "^4.0.3", - "listr2": "^9.0.4", - "slash": "^5.1.0", - "text-case": "^1.2.4", - "tslib": "^2.3.1", - "tsutils": "^3.21.0", - "typescript": "^5.2.2", - "zod": "^4.1.5" - }, - "bin": { - "ts-to-zod": "bin/run" - } - }, - "node_modules/ts-to-zod/node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/ts-to-zod/node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, - "license": "0BSD" - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true, - "license": "0BSD" - }, - "node_modules/tsx": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", - "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.27.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, - "node_modules/tsx/node_modules/@esbuild/aix-ppc64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.1.tgz", - "integrity": "sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/android-arm": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.1.tgz", - "integrity": "sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/android-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.1.tgz", - "integrity": "sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/android-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.1.tgz", - "integrity": "sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz", - "integrity": "sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/darwin-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.1.tgz", - "integrity": "sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.1.tgz", - "integrity": "sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.1.tgz", - "integrity": "sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-arm": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.1.tgz", - "integrity": "sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.1.tgz", - "integrity": "sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-ia32": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.1.tgz", - "integrity": "sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-loong64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.1.tgz", - "integrity": "sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "optional": true + } } }, - "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.1.tgz", - "integrity": "sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==", - "cpu": [ - "mips64el" - ], + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.1.tgz", - "integrity": "sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==", - "cpu": [ - "ppc64" - ], + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": "^18.0.0 || >=20.0.0" } }, - "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.1.tgz", - "integrity": "sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==", - "cpu": [ - "riscv64" - ], + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=14.0.0" } }, - "node_modules/tsx/node_modules/@esbuild/linux-s390x": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.1.tgz", - "integrity": "sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==", - "cpu": [ - "s390x" - ], + "node_modules/tinyspy": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", + "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=14.0.0" } }, - "node_modules/tsx/node_modules/@esbuild/linux-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.1.tgz", - "integrity": "sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==", - "cpu": [ - "x64" - ], + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "is-number": "^7.0.0" + }, "engines": { - "node": ">=18" + "node": ">=8.0" } }, - "node_modules/tsx/node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.1.tgz", - "integrity": "sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==", - "cpu": [ - "arm64" - ], - "dev": true, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], "engines": { - "node": ">=18" + "node": ">=0.6" } }, - "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.1.tgz", - "integrity": "sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==", - "cpu": [ - "x64" - ], + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" } }, - "node_modules/tsx/node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.1.tgz", - "integrity": "sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==", - "cpu": [ - "arm64" - ], + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" + "bin": { + "tree-kill": "cli.js" } }, - "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.1.tgz", - "integrity": "sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==", - "cpu": [ - "x64" - ], + "node_modules/ts-to-zod": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ts-to-zod/-/ts-to-zod-5.1.0.tgz", + "integrity": "sha512-giqqlvRHunlJqG9tBL/KAO3wWIVZGF//mZiWLKm/fdQnKnz4EN2mtiK5cugN9slytBkdMEXQIaLvMzIScbhhFw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@clack/prompts": "1.0.0-alpha.4", + "@oclif/core": "^4.5.4", + "@typescript/vfs": "^1.5.0", + "chokidar": "^4.0.3", + "listr2": "^9.0.4", + "slash": "^5.1.0", + "text-case": "^1.2.4", + "tslib": "^2.3.1", + "tsutils": "^3.21.0", + "typescript": "^5.2.2", + "zod": "^4.1.5" + }, + "bin": { + "ts-to-zod": "bin/run" } }, - "node_modules/tsx/node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.1.tgz", - "integrity": "sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==", - "cpu": [ - "arm64" - ], + "node_modules/ts-to-zod/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], + "dependencies": { + "readdirp": "^4.0.1" + }, "engines": { - "node": ">=18" + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/tsx/node_modules/@esbuild/sunos-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.1.tgz", - "integrity": "sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==", - "cpu": [ - "x64" - ], + "node_modules/ts-to-zod/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], "engines": { - "node": ">=18" + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, - "node_modules/tsx/node_modules/@esbuild/win32-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.1.tgz", - "integrity": "sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==", - "cpu": [ - "arm64" - ], + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "tslib": "^1.8.1" + }, "engines": { - "node": ">=18" + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, - "node_modules/tsx/node_modules/@esbuild/win32-ia32": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.1.tgz", - "integrity": "sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==", - "cpu": [ - "ia32" - ], + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsx": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", + "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "esbuild": "~0.27.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, "engines": { - "node": ">=18" + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" } }, - "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.1.tgz", - "integrity": "sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz", + "integrity": "sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==", "cpu": [ - "x64" + "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "win32" + "darwin" ], "engines": { "node": ">=18" @@ -7021,7 +6210,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7115,7 +6303,6 @@ "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -7249,7 +6436,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -7421,10 +6607,6 @@ "node": ">=8" } }, - "node_modules/wiki-explorer-server": { - "resolved": "examples/wiki-explorer-server", - "link": true - }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -7502,7 +6684,6 @@ "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", "dev": true, "license": "ISC", - "peer": true, "bin": { "yaml": "bin.mjs" }, @@ -7547,7 +6728,6 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-4.2.1.tgz", "integrity": "sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 83b0b58d..37c77587 100644 --- a/package.json +++ b/package.json @@ -41,13 +41,14 @@ "generate:schemas": "tsx scripts/generate-schemas.ts && prettier --write \"src/generated/**/*\"", "build": "npm run generate:schemas && node scripts/run-bun.mjs build.bun.ts", "prepack": "npm run build", - "build:all": "npm run build && npm run examples:build", + "build:all": "npm run examples:build", "test": "bun test src", "test:e2e": "playwright test", "test:e2e:update": "playwright test --update-snapshots", "test:e2e:ui": "playwright test --ui", "test:e2e:docker": "docker run --rm -v $(pwd):/work -w /work -it mcr.microsoft.com/playwright:v1.57.0-noble sh -c 'npm i -g bun && npm ci && npx playwright test'", "test:e2e:docker:update": "docker run --rm -v $(pwd):/work -w /work -it mcr.microsoft.com/playwright:v1.57.0-noble sh -c 'npm i -g bun && npm ci && npx playwright test --update-snapshots'", + "preexamples:build": "npm run build", "examples:build": "bun examples/run-all.ts build", "examples:start": "NODE_ENV=development npm run build && bun examples/run-all.ts start", "examples:dev": "NODE_ENV=development bun examples/run-all.ts dev", @@ -56,7 +57,8 @@ "docs": "typedoc", "docs:watch": "typedoc --watch", "prettier": "prettier -u \"**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --check", - "prettier:fix": "prettier -u \"**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --write" + "prettier:fix": "prettier -u \"**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --write", + "check:versions": "node scripts/check-versions.mjs" }, "author": "Olivier Chafik", "devDependencies": { diff --git a/scripts/check-versions.mjs b/scripts/check-versions.mjs new file mode 100644 index 00000000..c80ad52f --- /dev/null +++ b/scripts/check-versions.mjs @@ -0,0 +1,49 @@ +#!/usr/bin/env node +/** + * Checks that example package.json files reference the same version + * of @modelcontextprotocol/ext-apps as the root package.json. + * + * This ensures examples stay in sync with the library version. + */ + +import { readFileSync, readdirSync, statSync, existsSync } from "fs"; +import { join } from "path"; + +const rootPkg = JSON.parse(readFileSync("package.json", "utf-8")); +const rootVersion = rootPkg.version; +const pkgName = rootPkg.name; + +const expectedDep = `^${rootVersion}`; + +let hasError = false; + +const examplesDir = "examples"; +const examples = readdirSync(examplesDir).filter((d) => { + const pkgPath = join(examplesDir, d, "package.json"); + return statSync(join(examplesDir, d)).isDirectory() && existsSync(pkgPath); +}); + +for (const example of examples) { + const pkgPath = join(examplesDir, example, "package.json"); + const pkg = JSON.parse(readFileSync(pkgPath, "utf-8")); + + const dep = pkg.dependencies?.[pkgName]; + // Allow "../.." (local dev) or the correct versioned dependency + if (dep && dep !== expectedDep && dep !== "../..") { + console.error( + `❌ ${pkgPath}: expected "${pkgName}": "${expectedDep}" (or "../.."), got "${dep}"`, + ); + hasError = true; + } +} + +if (hasError) { + console.error( + `\nRun the following to fix:\n npm pkg set dependencies.${pkgName}=${expectedDep} --workspaces`, + ); + process.exit(1); +} else { + console.log( + `✅ All examples reference ${pkgName}@${expectedDep} (root version: ${rootVersion})`, + ); +} diff --git a/tests/e2e/servers.spec.ts-snapshots/basic-react.png b/tests/e2e/servers.spec.ts-snapshots/basic-react.png index 40f57873..62f0410b 100644 Binary files a/tests/e2e/servers.spec.ts-snapshots/basic-react.png and b/tests/e2e/servers.spec.ts-snapshots/basic-react.png differ diff --git a/tests/e2e/servers.spec.ts-snapshots/basic-vanillajs.png b/tests/e2e/servers.spec.ts-snapshots/basic-vanillajs.png index bd0e88a4..bd0d93c5 100644 Binary files a/tests/e2e/servers.spec.ts-snapshots/basic-vanillajs.png and b/tests/e2e/servers.spec.ts-snapshots/basic-vanillajs.png differ