Skip to content

Commit 626231d

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/app-tool-registration
# Conflicts: # examples/pdf-server/src/mcp-app.ts # src/app.examples.ts # src/app.ts
2 parents c17d0c1 + 621a70a commit 626231d

File tree

54 files changed

+4236
-796
lines changed

Some content is hidden

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

54 files changed

+4236
-796
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ jobs:
103103

104104
- name: Build MCPB bundle (pdf-server)
105105
if: runner.os == 'Linux' && matrix.name == 'Linux x64'
106-
run: npx -y @anthropic-ai/mcpb pack
106+
run: node build-mcpb.mjs
107+
working-directory: examples/pdf-server
108+
109+
- name: Smoke-test MCPB bundle starts
110+
if: runner.os == 'Linux' && matrix.name == 'Linux x64'
111+
run: |
112+
unzip -q pdf-server.mcpb -d .mcpb-smoke
113+
node .mcpb-smoke/dist/index.js --stdio < /dev/null 2>&1 | tee /tmp/mcpb-smoke.log
114+
grep -q "Ready" /tmp/mcpb-smoke.log
107115
working-directory: examples/pdf-server
108116

109117
e2e:

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,8 @@ jobs:
159159
cache: npm
160160
- run: npm ci
161161

162-
- name: Build pdf-server
163-
run: npm run build --workspace examples/pdf-server
164-
165-
- name: Pack MCPB bundle
166-
run: npx -y @anthropic-ai/mcpb pack
167-
working-directory: examples/pdf-server
162+
- name: Build pdf-server + MCPB bundle
163+
run: npm run build:mcpb --workspace examples/pdf-server
168164

169165
- name: Upload MCPB to release
170166
run: gh release upload "${{ github.event.release.tag_name }}" examples/pdf-server/*.mcpb --clobber

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ __pycache__/
1515
*.pyc
1616

1717
# MCPB bundles (built artifacts)
18-
*.mcpb
18+
*.mcpb
19+
.mcpb-stage/
20+
.mcpb-smoke/

examples/basic-host/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"homepage": "https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host",
33
"name": "@modelcontextprotocol/ext-apps-basic-host",
4-
"version": "1.3.1",
4+
"version": "1.5.0",
55
"type": "module",
66
"scripts": {
77
"build": "tsc --noEmit && concurrently \"cross-env INPUT=index.html vite build\" \"cross-env INPUT=sandbox.html vite build\"",
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@modelcontextprotocol/ext-apps": "^1.0.0",
15-
"@modelcontextprotocol/sdk": "^1.24.0",
15+
"@modelcontextprotocol/sdk": "^1.29.0",
1616
"react": "^19.2.0",
1717
"react-dom": "^19.2.0",
1818
"zod": "^4.1.13"

examples/basic-host/src/implementation.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,28 @@ export function newAppBridge(
306306
appBridge.sendHostContextChange({ theme: newTheme });
307307
});
308308

309+
// Per spec, the host SHOULD notify the view when container dimensions
310+
// change. A ResizeObserver on the iframe covers window resize, layout
311+
// shifts, and the inline↔fullscreen panel toggle (which React applies
312+
// a tick after onrequestdisplaymode returns — sending containerDimensions
313+
// alongside displayMode there would race the layout). Height stays
314+
// flexible (maxHeight) so the view can keep driving it via sendSizeChanged.
315+
const iframeResizeObserver = new ResizeObserver(([entry]) => {
316+
const width = Math.round(entry.contentRect.width);
317+
if (width > 0) {
318+
appBridge.sendHostContextChange({
319+
containerDimensions: { width, maxHeight: 6000 },
320+
});
321+
}
322+
});
323+
iframeResizeObserver.observe(iframe);
324+
// AppBridge inherits Protocol's onclose hook — chain disposal there.
325+
const prevOnclose = appBridge.onclose;
326+
appBridge.onclose = () => {
327+
iframeResizeObserver.disconnect();
328+
prevOnclose?.();
329+
};
330+
309331
// Register all handlers before calling connect(). The view can start
310332
// sending requests immediately after the initialization handshake, so any
311333
// handlers registered after connect() might miss early requests.

examples/basic-server-preact/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/server-basic-preact",
3-
"version": "1.3.1",
3+
"version": "1.5.0",
44
"type": "module",
55
"description": "Basic MCP App Server example using Preact",
66
"repository": {
@@ -25,7 +25,7 @@
2525
},
2626
"dependencies": {
2727
"@modelcontextprotocol/ext-apps": "^1.0.0",
28-
"@modelcontextprotocol/sdk": "^1.24.0",
28+
"@modelcontextprotocol/sdk": "^1.29.0",
2929
"cors": "^2.8.5",
3030
"express": "^5.1.0",
3131
"preact": "^10.0.0",

examples/basic-server-react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/server-basic-react",
3-
"version": "1.3.1",
3+
"version": "1.5.0",
44
"type": "module",
55
"description": "Basic MCP App Server example using React",
66
"repository": {
@@ -35,7 +35,7 @@
3535
},
3636
"dependencies": {
3737
"@modelcontextprotocol/ext-apps": "^1.0.0",
38-
"@modelcontextprotocol/sdk": "^1.24.0",
38+
"@modelcontextprotocol/sdk": "^1.29.0",
3939
"cors": "^2.8.5",
4040
"express": "^5.1.0",
4141
"react": "^19.2.0",

examples/basic-server-solid/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/server-basic-solid",
3-
"version": "1.3.1",
3+
"version": "1.5.0",
44
"type": "module",
55
"description": "Basic MCP App Server example using Solid",
66
"repository": {
@@ -25,7 +25,7 @@
2525
},
2626
"dependencies": {
2727
"@modelcontextprotocol/ext-apps": "^1.0.0",
28-
"@modelcontextprotocol/sdk": "^1.24.0",
28+
"@modelcontextprotocol/sdk": "^1.29.0",
2929
"cors": "^2.8.5",
3030
"express": "^5.1.0",
3131
"solid-js": "1.9.10",

examples/basic-server-svelte/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/server-basic-svelte",
3-
"version": "1.3.1",
3+
"version": "1.5.0",
44
"type": "module",
55
"description": "Basic MCP App Server example using Svelte",
66
"repository": {
@@ -25,7 +25,7 @@
2525
},
2626
"dependencies": {
2727
"@modelcontextprotocol/ext-apps": "^1.0.0",
28-
"@modelcontextprotocol/sdk": "^1.24.0",
28+
"@modelcontextprotocol/sdk": "^1.29.0",
2929
"cors": "^2.8.5",
3030
"express": "^5.1.0",
3131
"svelte": "^5.0.0",

examples/basic-server-vanillajs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/server-basic-vanillajs",
3-
"version": "1.3.1",
3+
"version": "1.5.0",
44
"type": "module",
55
"description": "Basic MCP App Server example using vanilla JavaScript",
66
"repository": {
@@ -25,7 +25,7 @@
2525
},
2626
"dependencies": {
2727
"@modelcontextprotocol/ext-apps": "^1.0.0",
28-
"@modelcontextprotocol/sdk": "^1.24.0",
28+
"@modelcontextprotocol/sdk": "^1.29.0",
2929
"cors": "^2.8.5",
3030
"express": "^5.1.0",
3131
"zod": "^4.1.13"

0 commit comments

Comments
 (0)