Skip to content

Commit 185b468

Browse files
committed
Merge origin/main into ochafik/kotlin-sdk
2 parents 674ff27 + 9748622 commit 185b468

File tree

47 files changed

+3937
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3937
-541
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
# Force LF line endings for all text files (for consistent prettier formatting)
2+
* text=auto eol=lf
3+
14
package-lock.json linguist-generated=true
5+
src/generated/** linguist-generated=true

.github/workflows/ci.yml

Lines changed: 87 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,43 @@ permissions:
1111

1212
jobs:
1313
build:
14-
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- os: ubuntu-latest
19+
name: Linux x64
20+
- os: ubuntu-24.04-arm
21+
name: Linux ARM64
22+
- os: windows-latest
23+
name: Windows x64
24+
- os: windows-11-arm
25+
name: Windows ARM64
26+
- os: macos-latest
27+
name: macOS ARM64
28+
29+
name: Build (${{ matrix.name }})
30+
runs-on: ${{ matrix.os }}
31+
1532
steps:
1633
- uses: actions/checkout@v4
1734

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

21-
- uses: oven-sh/setup-bun@v2
22-
with:
23-
bun-version: latest
24-
2539
- uses: actions/setup-node@v4
2640
with:
2741
node-version: "20"
2842

2943
- run: npm install
3044

31-
- run: npm run build:all
45+
- run: npm run build
46+
47+
- run: npm run examples:build
3248

3349
- name: Verify generated schemas are up-to-date
50+
shell: bash
3451
run: |
3552
npm run generate:schemas
3653
git diff --exit-code src/generated/ || (echo "Generated schemas are out of date. Run 'npm run generate:schemas' and commit." && exit 1)
@@ -67,3 +84,67 @@ jobs:
6784
name: test-results
6885
path: test-results/
6986
retention-days: 7
87+
88+
# Test build in Windows WSL (Ubuntu)
89+
build-wsl:
90+
name: Build (Windows WSL)
91+
runs-on: windows-latest
92+
93+
steps:
94+
- uses: actions/checkout@v4
95+
96+
- uses: Vampire/setup-wsl@v5
97+
with:
98+
distribution: Ubuntu-24.04
99+
100+
- name: Install Node.js in WSL
101+
shell: wsl-bash {0}
102+
run: |
103+
sudo apt-get update
104+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
105+
sudo apt-get install -y nodejs
106+
107+
- name: Build and test in WSL
108+
shell: wsl-bash {0}
109+
run: |
110+
npm install
111+
npm run build
112+
npm run examples:build
113+
npm test
114+
npm run prettier
115+
116+
# Test that the package can be installed from git (triggers prepare script)
117+
test-git-install:
118+
strategy:
119+
fail-fast: false
120+
matrix:
121+
include:
122+
- os: ubuntu-latest
123+
name: Linux x64
124+
- os: ubuntu-24.04-arm
125+
name: Linux ARM64
126+
- os: windows-latest
127+
name: Windows x64
128+
- os: windows-11-arm
129+
name: Windows ARM64
130+
- os: macos-latest
131+
name: macOS ARM64
132+
133+
name: Test git install (${{ matrix.name }})
134+
runs-on: ${{ matrix.os }}
135+
136+
steps:
137+
- uses: actions/setup-node@v4
138+
with:
139+
node-version: "20"
140+
141+
- name: Create test project and install from git
142+
shell: bash
143+
run: |
144+
mkdir test-project
145+
cd test-project
146+
npm init -y
147+
# Install from the PR branch
148+
npm install "git+https://github.com/${{ github.repository }}#${{ github.head_ref || github.ref_name }}"
149+
# Verify the package is usable (ESM import)
150+
node --input-type=module -e "import { App } from '@modelcontextprotocol/ext-apps'; console.log('Import successful:', typeof App)"

.husky/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Verify no private registry URLs in package-lock.json
2+
if grep -E '"resolved": "https?://' package-lock.json | grep -v registry.npmjs.org > /dev/null; then
3+
echo "ERROR: package-lock.json contains non-npmjs.org URLs"
4+
echo "Run: docker run --rm -i -v \$PWD:/src -w /src node:latest npm i --registry=https://registry.npmjs.org/"
5+
exit 1
6+
fi
7+
18
npm run build:all
29
npm run prettier:fix
310

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The [`examples/`](https://github.com/modelcontextprotocol/ext-apps/tree/main/exa
5656

5757
To run all examples together:
5858

59-
```
59+
```bash
6060
npm install
6161
npm run examples:start
6262
```

examples/basic-host/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta name="color-scheme" content="light dark">
67
<title>MCP Apps Host</title>
78
<link rel="stylesheet" href="/src/global.css">
89
</head>

examples/basic-host/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"version": "1.0.0",
55
"type": "module",
66
"scripts": {
7-
"build": "concurrently 'INPUT=index.html vite build' 'INPUT=sandbox.html vite build'",
8-
"watch": "concurrently 'INPUT=index.html vite build --watch' 'INPUT=sandbox.html vite build --watch'",
7+
"build": "concurrently \"cross-env INPUT=index.html vite build\" \"cross-env INPUT=sandbox.html vite build\"",
8+
"watch": "concurrently \"cross-env INPUT=index.html vite build --watch\" \"cross-env INPUT=sandbox.html vite build --watch\"",
99
"serve": "bun serve.ts",
10-
"start": "NODE_ENV=development npm run build && npm run serve",
11-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
10+
"start": "cross-env NODE_ENV=development npm run build && npm run serve",
11+
"dev": "cross-env NODE_ENV=development concurrently \"npm run watch\" \"npm run serve\""
1212
},
1313
"dependencies": {
1414
"@modelcontextprotocol/ext-apps": "../..",
@@ -23,7 +23,6 @@
2323
"@types/react": "^19.2.2",
2424
"@types/react-dom": "^19.2.2",
2525
"@vitejs/plugin-react": "^4.3.4",
26-
"bun": "^1.3.2",
2726
"concurrently": "^9.2.1",
2827
"cors": "^2.8.5",
2928
"express": "^5.1.0",

examples/basic-host/sandbox.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5+
<meta name="color-scheme" content="light dark">
56
<!-- CSP is set by serve.ts HTTP header - no meta tag needed here
67
The inner iframe's CSP is dynamically injected based on resource metadata -->
78
<title>MCP-UI Proxy</title>

examples/basic-server-react/mcp-app.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta name="color-scheme" content="light dark">
67
<title>Get Time App</title>
78
<link rel="stylesheet" href="/src/global.css">
89
</head>

examples/basic-server-react/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "INPUT=mcp-app.html vite build",
8-
"watch": "INPUT=mcp-app.html vite build --watch",
7+
"build": "cross-env INPUT=mcp-app.html vite build",
8+
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
99
"serve": "bun server.ts",
10-
"start": "NODE_ENV=development npm run build && npm run serve",
11-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
10+
"start": "cross-env NODE_ENV=development npm run build && npm run serve",
11+
"dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
1212
},
1313
"dependencies": {
1414
"@modelcontextprotocol/ext-apps": "../..",
@@ -24,7 +24,6 @@
2424
"@types/react": "^19.2.2",
2525
"@types/react-dom": "^19.2.2",
2626
"@vitejs/plugin-react": "^4.3.4",
27-
"bun": "^1.3.2",
2827
"concurrently": "^9.2.1",
2928
"cors": "^2.8.5",
3029
"express": "^5.1.0",

examples/basic-server-vanillajs/mcp-app.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta name="color-scheme" content="light dark">
67
<title>Get Time App</title>
78
</head>
89
<body>

0 commit comments

Comments
 (0)