ext-apps/examples
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Olivier Chafik 04fed524a9
fix(pdf-server): npx DOMMatrix crash + broken MCPB bundle (#584)
* fix(pdf-server): stub DOMMatrix/ImageData/Path2D for npx without @napi-rs/canvas

pdfjs-dist/legacy/build/pdf.mjs does `new DOMMatrix()` at module scope.
Its own polyfill loads @napi-rs/canvas (an optionalDependency), but npx
frequently misses the platform-native binary (npm/cli#4828), so the
server crashed on `npx @modelcontextprotocol/server-pdf --stdio`:

    ReferenceError: DOMMatrix is not defined
        at pdfjs-dist/legacy/build/pdf.mjs:17078

The server only uses pdfjs for text/metadata/form-field extraction —
never canvas rendering — so no-op stubs suffice and avoid shipping
~130MB of native binaries.

The polyfill is a separate ESM module kept --external in the bun bundle
so it executes before pdfjs's hoisted static import; inlined body code
would run too late.

Broken since 1.3.0 (#506). Thanks to Bryan Thompson for the analysis
and fix shape from the npm-to-mcpb pipeline.

* fix(pdf-server): MCPB bundle missing runtime deps + display_name with spaces

`mcpb pack` zips whatever is on disk; in this monorepo all runtime deps
are hoisted to root node_modules, so the published .mcpb shipped without
pdfjs-dist/ajv/express/etc. and crashed on import in Claude Desktop.

build-mcpb.mjs stages dist/ + manifest into a clean temp dir, runs a
non-workspace `npm install --omit=dev --omit=optional` (the new
DOMMatrix polyfill makes @napi-rs/canvas's ~130MB of native binaries
unnecessary), syncs manifest.version to package.json, then packs.
Result: 12.3MB / 38.8MB unpacked, full MCP handshake + tools/list pass.

Also rename display_name "PDF (By Anthropic)" → "pdf-viewer" — spaces
in display_name break MCP App UI rendering for MCPBs in Claude Desktop.

CI now smoke-tests the extracted bundle starts (`dist/index.js --stdio`
prints "Ready") so a deps-less bundle can't ship again.

* fix(pdf-server): list interact in MCPB manifest tools (was stale since #491)
2026-04-02 04:16:33 +01:00
..
basic-host feat(pdf-server): fit-to-page on fullscreen + pinch-to-zoom (#583) 2026-04-02 03:43:47 +01:00
basic-server-preact chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-react chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-solid chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-svelte chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-vanillajs chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-vue chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
budget-allocator-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
cohort-heatmap-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
customer-segmentation-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
debug-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
integration-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
map-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
pdf-server fix(pdf-server): npx DOMMatrix crash + broken MCPB bundle (#584) 2026-04-02 04:16:33 +01:00
qr-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
quickstart chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
say-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
scenario-modeler-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
shadertoy-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
sheet-music-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
system-monitor-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
threejs-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
transcript-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
video-resource-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
wiki-explorer-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
run-all.ts add EXAMPLE=folder-name support for tests & basic-host (#292) 2026-01-19 20:16:37 +00:00