Skip to content

Conversation

@ochafik
Copy link
Collaborator

@ochafik ochafik commented Dec 19, 2025

Note: This PR is rebased on #184 and should be merged after it.

Summary

  • Add preexamples:build hook to automatically run npm run build before examples:build
  • This ensures examples always type-check against the latest library code, catching breaking changes during development
  • Simplify build:all to just call examples:build (the pre-hook handles building the lib)
  • Add version consistency check to ensure examples reference the correct library version

Changes

  1. preexamples:build hook - ensures lib is built before examples
  2. Version check script (scripts/check-versions.mjs):
    • Validates examples use ^{root-version} or ../..
    • Runs in CI before npm install
    • Available locally via npm run check:versions
    • Shows fix command when versions mismatch

Test plan

  • npm run examples:build now runs npm run build first (via pre-hook)
  • npm run build:all still works as expected
  • npm run check:versions passes with correct versions
  • Version mismatch is caught by the check script
  • Breaking changes in the library are caught by TypeScript during example builds

🤖 Generated with Claude Code

jerome3o-anthropic and others added 3 commits December 19, 2025 15:10
Make example MCP App servers publishable to npm under the
@modelcontextprotocol scope:

- server-basic-react
- server-basic-vanillajs
- server-budget-allocator
- server-cohort-heatmap
- server-customer-segmentation
- server-scenario-modeler
- server-system-monitor
- server-threejs
- server-wiki-explorer

Changes:
- Remove `private: true` from example package.json files
- Add proper npm metadata (description, repository, license, files)
- Update ext-apps dependency from relative to ^0.2.2
- Copy server-utils.ts into each package for standalone use
- Add publish-examples job to npm-publish.yml workflow

The examples will be published automatically when a GitHub release
is created, after the main SDK package is published.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 19, 2025

Open in StackBlitz

@modelcontextprotocol/ext-apps

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@185

@modelcontextprotocol/server-basic-react

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-react@185

@modelcontextprotocol/server-basic-vanillajs

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-vanillajs@185

@modelcontextprotocol/server-budget-allocator

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-budget-allocator@185

@modelcontextprotocol/server-cohort-heatmap

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-cohort-heatmap@185

@modelcontextprotocol/server-customer-segmentation

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-customer-segmentation@185

@modelcontextprotocol/server-scenario-modeler

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-scenario-modeler@185

@modelcontextprotocol/server-system-monitor

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-system-monitor@185

@modelcontextprotocol/server-threejs

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-threejs@185

@modelcontextprotocol/server-wiki-explorer

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-wiki-explorer@185

commit: aae2a86

@ochafik ochafik force-pushed the ochafik/fix-examples-build-order branch from 2076303 to 7c16651 Compare December 19, 2025 12:02
ochafik and others added 2 commits December 19, 2025 12:12
Resolve conflicts by:
- Keep server-utils.ts next to server.ts (not in src/)
- Simplify server-utils.ts to stateless HTTP only (no SSE)
- Keep main() with explicit --stdio handling in server.ts
- Add integration-server from main for E2E testing
- Add npm start alias from main
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@ochafik ochafik force-pushed the ochafik/fix-examples-build-order branch from 7c16651 to 9d8126c Compare December 19, 2025 12:23
ochafik and others added 3 commits December 19, 2025 12:28
Update golden screenshots for basic-react and basic-vanillajs after
the tool output was simplified from JSON to plain text in #182.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Add preexamples:build hook to automatically run `npm run build` before
`examples:build`. This ensures examples always type-check against the
latest library code, catching breaking changes during development.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Add scripts/check-versions.mjs to verify that example package.json files
reference the correct version of @modelcontextprotocol/ext-apps.

- Allows "../.." (local dev) or "^{root-version}" as valid dependencies
- Runs in CI before npm install to catch mismatches early
- Available locally via `npm run check:versions`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@ochafik ochafik force-pushed the ochafik/fix-examples-build-order branch from 9d8126c to 8bab9ef Compare December 19, 2025 12:28
Addresses PR review feedback to preserve explanatory comments
that help developers understand the MCP App registration pattern.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants