Skip to content

Commit 3b22338

Browse files
committed
chore(mcp): migrate from bun
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
1 parent 68eb5ed commit 3b22338

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

apps/mcp/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"scripts": {
1919
"build": "tsc --noEmit && cross-env INPUT=mcp-app.html vite build",
2020
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
21-
"serve:http": "bun --watch server.ts",
22-
"serve:stdio": "bun server.ts --stdio",
21+
"serve:http": "tsx watch server.ts",
22+
"serve:stdio": "tsx server.ts --stdio",
2323
"start": "npm run start:http",
2424
"start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http",
2525
"start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio",
@@ -46,6 +46,7 @@
4646
"cors": "^2.8.5",
4747
"cross-env": "^10.1.0",
4848
"express": "^5.1.0",
49+
"tsx": "^4.19.2",
4950
"typescript": "^5.9.3",
5051
"vite": "^6.0.0",
5152
"vite-plugin-singlefile": "^2.3.0"

apps/mcp/server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
1313
import type { ReadResourceResult } from "@modelcontextprotocol/sdk/types.js";
1414
import fs from "node:fs/promises";
1515
import path from "node:path";
16+
import { fileURLToPath } from "node:url";
1617
import { z } from "zod";
1718
import { startServer } from "./server-utils.js";
1819

1920
// =============================================================================
2021
// Constants
2122
// =============================================================================
2223

23-
const DIST_DIR = path.join(import.meta.dirname, "dist");
24+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
25+
const DIST_DIR = path.join(__dirname, "dist");
2426

2527
// Default code example for the Three.js widget
2628
const DEFAULT_THREEJS_CODE = `const scene = new THREE.Scene();

apps/mcp/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"allowImportingTsExtensions": true,
88
"resolveJsonModule": true,
99
"isolatedModules": true,
10-
"verbatimModuleSyntax": true,
10+
"esModuleInterop": true,
11+
"allowSyntheticDefaultImports": true,
1112
"noEmit": true,
1213
"jsx": "react-jsx",
1314
"strict": true,

0 commit comments

Comments
 (0)