Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9473a62
fix: Windows compatibility for npm scripts and cross-platform CI
ochafik Dec 12, 2025
9801093
fix: remove bun npm package from all workspaces
ochafik Dec 12, 2025
8ebae92
fix: skip examples:build on Windows (uses Unix-only INPUT=... syntax)
ochafik Dec 12, 2025
0ed1542
fix: force LF line endings for cross-platform prettier consistency
ochafik Dec 12, 2025
f882958
ci: add test for git-based npm install (cross-platform)
ochafik Dec 12, 2025
f6c9b99
ci: add Linux ARM64 and Windows ARM64 to CI matrix
ochafik Dec 12, 2025
85a30fa
ci: disable Windows ARM64 (Bun lacks stable ARM64 binaries)
ochafik Dec 12, 2025
600de0b
ci: add Windows WSL build test
ochafik Dec 12, 2025
b7b8f75
ci: fix WSL build - install unzip for Bun installer
ochafik Dec 12, 2025
765736f
ci: add setup-bun to publish.yml workflow
ochafik Dec 12, 2025
b3527af
ci: enable Windows ARM64 with x64-baseline Bun (via emulation)
ochafik Dec 12, 2025
9cbb4dc
ci: remove macOS x64 (macos-13 runner retired)
ochafik Dec 12, 2025
f80b167
docs: add Bun installation instructions per platform
ochafik Dec 12, 2025
93f7d98
docs: note Bun requirement in README examples section
ochafik Dec 12, 2025
48fd911
feat: add bun as optional dependency (no global install required)
ochafik Dec 12, 2025
c10ed54
chore: add debug logging to setup-bun script
ochafik Dec 12, 2025
e81518d
chore: force stdout flush in setup-bun for CI debugging
ochafik Dec 12, 2025
a539ae4
chore: add more debugging to setup-bun
ochafik Dec 12, 2025
4535606
chore: remove accidental test artifacts
ochafik Dec 12, 2025
ea668b3
chore: run setup-bun in prepare script (before build)
ochafik Dec 12, 2025
372b580
feat: use cross-env for Windows-compatible example builds
ochafik Dec 12, 2025
e60adf6
chore: remove unused imports in setup-bun.mjs
ochafik Dec 12, 2025
69b8eba
fix: use run-bun.mjs wrapper for prepare hook compatibility
ochafik Dec 15, 2025
181384a
ci: restore setup-bun action for build jobs
ochafik Dec 16, 2025
aebc13b
fix: remove bun devDep, add libc detection for Linux ARM64
ochafik Dec 16, 2025
db41042
ci: simplify WSL build - let setup-bun.mjs handle bun installation
ochafik Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Force LF line endings for all text files (for consistent prettier formatting)
* text=auto eol=lf

package-lock.json linguist-generated=true
src/generated/** linguist-generated=true
93 changes: 87 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,43 @@ permissions:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: Linux x64
- os: ubuntu-24.04-arm
name: Linux ARM64
- os: windows-latest
name: Windows x64
- os: windows-11-arm
name: Windows ARM64
- os: macos-latest
name: macOS ARM64

name: Build (${{ matrix.name }})
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Verify no private URLs in package-lock.json
shell: bash
run: '! grep -E "\"resolved\": \"https?://" package-lock.json | grep -v registry.npmjs.org'

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- uses: actions/setup-node@v4
with:
node-version: "20"

- run: npm install

- run: npm run build:all
- run: npm run build

- run: npm run examples:build

- name: Verify generated schemas are up-to-date
shell: bash
run: |
npm run generate:schemas
git diff --exit-code src/generated/ || (echo "Generated schemas are out of date. Run 'npm run generate:schemas' and commit." && exit 1)
Expand Down Expand Up @@ -67,3 +84,67 @@ jobs:
name: test-results
path: test-results/
retention-days: 7

# Test build in Windows WSL (Ubuntu)
build-wsl:
name: Build (Windows WSL)
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- uses: Vampire/setup-wsl@v5
with:
distribution: Ubuntu-24.04

- name: Install Node.js in WSL
shell: wsl-bash {0}
run: |
sudo apt-get update
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

- name: Build and test in WSL
shell: wsl-bash {0}
run: |
npm install
npm run build
npm run examples:build
npm test
npm run prettier

# Test that the package can be installed from git (triggers prepare script)
test-git-install:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: Linux x64
- os: ubuntu-24.04-arm
name: Linux ARM64
- os: windows-latest
name: Windows x64
- os: windows-11-arm
name: Windows ARM64
- os: macos-latest
name: macOS ARM64

name: Test git install (${{ matrix.name }})
runs-on: ${{ matrix.os }}

steps:
- uses: actions/setup-node@v4
with:
node-version: "20"

- name: Create test project and install from git
shell: bash
run: |
mkdir test-project
cd test-project
npm init -y
# Install from the PR branch
npm install "git+https://github.com/${{ github.repository }}#${{ github.head_ref || github.ref_name }}"
# Verify the package is usable (ESM import)
node --input-type=module -e "import { App } from '@modelcontextprotocol/ext-apps'; console.log('Import successful:', typeof App)"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The [`examples/`](https://github.com/modelcontextprotocol/ext-apps/tree/main/exa

To run all examples together:

```
```bash
npm install
npm run examples:start
```
Expand Down
9 changes: 4 additions & 5 deletions examples/basic-host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"version": "1.0.0",
"type": "module",
"scripts": {
"build": "concurrently 'INPUT=index.html vite build' 'INPUT=sandbox.html vite build'",
"watch": "concurrently 'INPUT=index.html vite build --watch' 'INPUT=sandbox.html vite build --watch'",
"build": "concurrently \"cross-env INPUT=index.html vite build\" \"cross-env INPUT=sandbox.html vite build\"",
"watch": "concurrently \"cross-env INPUT=index.html vite build --watch\" \"cross-env INPUT=sandbox.html vite build --watch\"",
"serve": "bun serve.ts",
"start": "NODE_ENV=development npm run build && npm run serve",
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
"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\""
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
Expand All @@ -23,7 +23,6 @@
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@vitejs/plugin-react": "^4.3.4",
"bun": "^1.3.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this dependency causing a problem on Windows?

In 9f8d00e, I explicitly added bun as a dependency to the examples in order to improve on-ramping (users only have to run npm install).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I see the postinstall script added to package.json, but I'm still unclear on the problem that this dependency is causing.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bun npm package was removed from examples' devDependencies (in the parent branch #144) because it was causing npm install to fail on Windows ARM64 - there's no native ARM64 binary for Bun on Windows yet, so the package's postinstall script throws "Unsupported platform: win32 arm64".

This PR takes a different approach: instead of relying on the bun npm package in each workspace, we add Bun's platform-specific packages (@oven/bun-darwin-aarch64, @oven/bun-linux-x64, etc.) as optionalDependencies in the root package.json. This has several benefits:

  1. Windows ARM64 support: Our setup-bun.mjs script handles this by downloading the x64-baseline binary, which runs via emulation
  2. Single source of truth: Bun version is managed in one place (root package.json)
  3. Works with npm install: Users still just run npm install - the prepare script sets up bun automatically

The user experience is the same (or better) - npm install just works on all platforms including Windows ARM64.

"concurrently": "^9.2.1",
"cors": "^2.8.5",
"express": "^5.1.0",
Expand Down
9 changes: 4 additions & 5 deletions examples/basic-server-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"private": true,
"type": "module",
"scripts": {
"build": "INPUT=mcp-app.html vite build",
"watch": "INPUT=mcp-app.html vite build --watch",
"build": "cross-env INPUT=mcp-app.html vite build",
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
"serve": "bun server.ts",
"start": "NODE_ENV=development npm run build && npm run serve",
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
"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'"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
Expand All @@ -24,7 +24,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",
Expand Down
9 changes: 4 additions & 5 deletions examples/basic-server-vanillajs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"private": true,
"type": "module",
"scripts": {
"build": "INPUT=mcp-app.html vite build",
"watch": "INPUT=mcp-app.html vite build --watch",
"build": "cross-env INPUT=mcp-app.html vite build",
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
"serve": "bun server.ts",
"start": "NODE_ENV=development npm run build && npm run serve",
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
"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'"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
Expand All @@ -19,7 +19,6 @@
"@types/cors": "^2.8.19",
"@types/express": "^5.0.0",
"@types/node": "^22.0.0",
"bun": "^1.3.2",
"concurrently": "^9.2.1",
"cors": "^2.8.5",
"express": "^5.1.0",
Expand Down
11 changes: 5 additions & 6 deletions examples/budget-allocator-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"private": true,
"type": "module",
"scripts": {
"build": "INPUT=mcp-app.html vite build",
"watch": "INPUT=mcp-app.html vite build --watch",
"build": "cross-env INPUT=mcp-app.html vite build",
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
"serve:http": "bun server.ts",
"serve:stdio": "bun server.ts --stdio",
"start": "npm run start:http",
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve: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'"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
Expand All @@ -23,7 +23,6 @@
"@types/cors": "^2.8.19",
"@types/express": "^5.0.0",
"@types/node": "^22.0.0",
"bun": "^1.3.2",
"concurrently": "^9.2.1",
"cors": "^2.8.5",
"express": "^5.1.0",
Expand Down
11 changes: 5 additions & 6 deletions examples/cohort-heatmap-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"private": true,
"type": "module",
"scripts": {
"build": "INPUT=mcp-app.html vite build",
"watch": "INPUT=mcp-app.html vite build --watch",
"build": "cross-env INPUT=mcp-app.html vite build",
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
"serve:http": "bun server.ts",
"serve:stdio": "bun server.ts --stdio",
"start": "npm run start:http",
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve: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'"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
Expand All @@ -27,7 +27,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",
Expand Down
11 changes: 5 additions & 6 deletions examples/customer-segmentation-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"private": true,
"type": "module",
"scripts": {
"build": "INPUT=mcp-app.html vite build",
"watch": "INPUT=mcp-app.html vite build --watch",
"build": "cross-env INPUT=mcp-app.html vite build",
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
"serve:http": "bun server.ts",
"serve:stdio": "bun server.ts --stdio",
"start": "npm run start:http",
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve: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'"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
Expand All @@ -23,7 +23,6 @@
"@types/cors": "^2.8.19",
"@types/express": "^5.0.0",
"@types/node": "^22.0.0",
"bun": "^1.3.2",
"concurrently": "^9.2.1",
"cors": "^2.8.5",
"express": "^5.1.0",
Expand Down
11 changes: 5 additions & 6 deletions examples/scenario-modeler-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"private": true,
"type": "module",
"scripts": {
"build": "INPUT=mcp-app.html vite build",
"watch": "INPUT=mcp-app.html vite build --watch",
"build": "cross-env INPUT=mcp-app.html vite build",
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
"serve:http": "bun server.ts",
"serve:stdio": "bun server.ts --stdio",
"start": "npm run start:http",
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve: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'"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
Expand All @@ -28,7 +28,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",
Expand Down
11 changes: 5 additions & 6 deletions examples/system-monitor-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"private": true,
"type": "module",
"scripts": {
"build": "INPUT=mcp-app.html vite build",
"watch": "INPUT=mcp-app.html vite build --watch",
"build": "cross-env INPUT=mcp-app.html vite build",
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
"serve:http": "bun server.ts",
"serve:stdio": "bun server.ts --stdio",
"start": "npm run start:http",
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve: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'"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
Expand All @@ -24,7 +24,6 @@
"@types/cors": "^2.8.19",
"@types/express": "^5.0.0",
"@types/node": "^22.0.0",
"bun": "^1.3.2",
"concurrently": "^9.2.1",
"cors": "^2.8.5",
"express": "^5.1.0",
Expand Down
11 changes: 5 additions & 6 deletions examples/threejs-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"private": true,
"type": "module",
"scripts": {
"build": "INPUT=mcp-app.html vite build",
"watch": "INPUT=mcp-app.html vite build --watch",
"build": "cross-env INPUT=mcp-app.html vite build",
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
"serve:http": "bun server.ts",
"serve:stdio": "bun server.ts --stdio",
"start": "npm run start:http",
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve: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'"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "../..",
Expand All @@ -29,7 +29,6 @@
"@types/react-dom": "^19.2.2",
"@types/three": "^0.181.0",
"@vitejs/plugin-react": "^4.3.4",
"bun": "^1.3.2",
"concurrently": "^9.2.1",
"cors": "^2.8.5",
"express": "^5.1.0",
Expand Down
Loading
Loading