From b594fc2dbde79b55982f7db86b50d1e0b09a8691 Mon Sep 17 00:00:00 2001 From: Maurizio Albari Date: Tue, 20 Jan 2026 18:57:08 +0100 Subject: [PATCH] fix: update serve:http to run main.ts instead of server.ts (#315) After commit 65a62a9f, the server startup code was moved from server.ts to main.ts, but the serve:http script was not updated accordingly. This caused 9 example servers to fail to start when running npm start: - budget-allocator-server - cohort-heatmap-server - customer-segmentation-server - integration-server - map-server - scenario-modeler-server - system-monitor-server - threejs-server - wiki-explorer-server The server.ts file now only exports createServer(), while main.ts contains the actual server startup logic. --- examples/budget-allocator-server/package.json | 2 +- examples/cohort-heatmap-server/package.json | 2 +- examples/customer-segmentation-server/package.json | 2 +- examples/integration-server/package.json | 2 +- examples/map-server/package.json | 2 +- examples/qr-server/server.py | 4 ++-- examples/scenario-modeler-server/package.json | 2 +- examples/system-monitor-server/package.json | 2 +- examples/threejs-server/package.json | 2 +- examples/wiki-explorer-server/package.json | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/budget-allocator-server/package.json b/examples/budget-allocator-server/package.json index 2aed2b9..7d26960 100644 --- a/examples/budget-allocator-server/package.json +++ b/examples/budget-allocator-server/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build && tsc -p tsconfig.server.json && bun build server.ts --outdir dist --target node && bun build main.ts --outfile dist/index.js --target node --external \"./server.js\" --banner \"#!/usr/bin/env node\"", "watch": "cross-env INPUT=mcp-app.html vite build --watch", - "serve:http": "bun --watch server.ts", + "serve:http": "bun --watch main.ts", "serve:stdio": "bun server.ts --stdio", "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", diff --git a/examples/cohort-heatmap-server/package.json b/examples/cohort-heatmap-server/package.json index 4a88842..ce0a999 100644 --- a/examples/cohort-heatmap-server/package.json +++ b/examples/cohort-heatmap-server/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build && tsc -p tsconfig.server.json && bun build server.ts --outdir dist --target node && bun build main.ts --outfile dist/index.js --target node --external \"./server.js\" --banner \"#!/usr/bin/env node\"", "watch": "cross-env INPUT=mcp-app.html vite build --watch", - "serve:http": "bun --watch server.ts", + "serve:http": "bun --watch main.ts", "serve:stdio": "bun server.ts --stdio", "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", diff --git a/examples/customer-segmentation-server/package.json b/examples/customer-segmentation-server/package.json index 2a31eba..afa419e 100644 --- a/examples/customer-segmentation-server/package.json +++ b/examples/customer-segmentation-server/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build && tsc -p tsconfig.server.json && bun build server.ts --outdir dist --target node && bun build main.ts --outfile dist/index.js --target node --external \"./server.js\" --banner \"#!/usr/bin/env node\"", "watch": "cross-env INPUT=mcp-app.html vite build --watch", - "serve:http": "bun --watch server.ts", + "serve:http": "bun --watch main.ts", "serve:stdio": "bun server.ts --stdio", "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", diff --git a/examples/integration-server/package.json b/examples/integration-server/package.json index 1c31e37..67538c9 100644 --- a/examples/integration-server/package.json +++ b/examples/integration-server/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build && tsc -p tsconfig.server.json && bun build server.ts --outdir dist --target node && bun build main.ts --outfile dist/index.js --target node --external \"./server.js\" --banner \"#!/usr/bin/env node\"", "watch": "cross-env INPUT=mcp-app.html vite build --watch", - "serve:http": "bun --watch server.ts", + "serve:http": "bun --watch main.ts", "serve:stdio": "bun server.ts --stdio", "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", diff --git a/examples/map-server/package.json b/examples/map-server/package.json index c412df5..da5f9f4 100644 --- a/examples/map-server/package.json +++ b/examples/map-server/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build && tsc -p tsconfig.server.json && bun build server.ts --outdir dist --target node && bun build main.ts --outfile dist/index.js --target node --external \"./server.js\" --banner \"#!/usr/bin/env node\"", "watch": "cross-env INPUT=mcp-app.html vite build --watch", - "serve:http": "bun --watch server.ts", + "serve:http": "bun --watch main.ts", "serve:stdio": "bun server.ts --stdio", "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", diff --git a/examples/qr-server/server.py b/examples/qr-server/server.py index baac4d0..f008f67 100755 --- a/examples/qr-server/server.py +++ b/examples/qr-server/server.py @@ -27,7 +27,7 @@ WIDGET_URI = "ui://qr-server/widget.html" HOST = os.environ.get("HOST", "0.0.0.0") # 0.0.0.0 for Docker compatibility PORT = int(os.environ.get("PORT", "3108")) -mcp = FastMCP("QR Code Server", port=PORT, stateless_http=True) +mcp = FastMCP("QR Code Server") @mcp.tool(meta={ @@ -92,7 +92,7 @@ if __name__ == "__main__": mcp.run(transport="stdio") else: # HTTP mode for basic-host (default) - with CORS - app = mcp.streamable_http_app() + app = mcp.streamable_http_app(stateless_http=True) app.add_middleware( CORSMiddleware, allow_origins=["*"], diff --git a/examples/scenario-modeler-server/package.json b/examples/scenario-modeler-server/package.json index 97ba7a1..c0bfc8e 100644 --- a/examples/scenario-modeler-server/package.json +++ b/examples/scenario-modeler-server/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build && tsc -p tsconfig.server.json && bun build server.ts --outdir dist --target node && bun build main.ts --outfile dist/index.js --target node --external \"./server.js\" --banner \"#!/usr/bin/env node\"", "watch": "cross-env INPUT=mcp-app.html vite build --watch", - "serve:http": "bun --watch server.ts", + "serve:http": "bun --watch main.ts", "serve:stdio": "bun server.ts --stdio", "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", diff --git a/examples/system-monitor-server/package.json b/examples/system-monitor-server/package.json index 65ddb85..84ac75f 100644 --- a/examples/system-monitor-server/package.json +++ b/examples/system-monitor-server/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build && tsc -p tsconfig.server.json && bun build server.ts --outdir dist --target node && bun build main.ts --outfile dist/index.js --target node --external \"./server.js\" --banner \"#!/usr/bin/env node\"", "watch": "cross-env INPUT=mcp-app.html vite build --watch", - "serve:http": "bun --watch server.ts", + "serve:http": "bun --watch main.ts", "serve:stdio": "bun server.ts --stdio", "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", diff --git a/examples/threejs-server/package.json b/examples/threejs-server/package.json index da2349c..36b6833 100644 --- a/examples/threejs-server/package.json +++ b/examples/threejs-server/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build && tsc -p tsconfig.server.json && bun build server.ts --outdir dist --target node && bun build main.ts --outfile dist/index.js --target node --external \"./server.js\" --banner \"#!/usr/bin/env node\"", "watch": "cross-env INPUT=mcp-app.html vite build --watch", - "serve:http": "bun --watch server.ts", + "serve:http": "bun --watch main.ts", "serve:stdio": "bun server.ts --stdio", "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http", diff --git a/examples/wiki-explorer-server/package.json b/examples/wiki-explorer-server/package.json index 6b9b68b..20ad160 100644 --- a/examples/wiki-explorer-server/package.json +++ b/examples/wiki-explorer-server/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build && tsc -p tsconfig.server.json && bun build server.ts --outdir dist --target node && bun build main.ts --outfile dist/index.js --target node --external \"./server.js\" --banner \"#!/usr/bin/env node\"", "watch": "cross-env INPUT=mcp-app.html vite build --watch", - "serve:http": "bun --watch server.ts", + "serve:http": "bun --watch main.ts", "serve:stdio": "bun server.ts --stdio", "start": "npm run start:http", "start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http",