Skip to content

Conversation

@jonathanhefner
Copy link
Member

Introduce new example implementations to replace simple-host and simple-server:

  • basic-host: Reference host implementation with double-iframe sandbox pattern for secure UI isolation (outer iframe validates and relays messages, inner iframe renders untrusted tool UI via srcdoc)

  • basic-server-react: MCP server example demonstrating tool registration with linked UI resources and React UI using the useApp() hook

Build infrastructure updates:

  • Add build:all script and simplify CI/pre-commit to use it
  • Add examples:dev for watch-mode development workflow

Also change PostMessageTransport logging from info to debug level.

🤖 Generated with Claude Code

@ochafik
Copy link
Collaborator

ochafik commented Dec 2, 2025

Can you explain the positioning of basic-host vs. simple-host (meant as rename?), and the plan for the vanilla part of simple-server?

@jonathanhefner
Copy link
Member Author

jonathanhefner commented Dec 3, 2025

basic-host is meant to replace simple-host. The mapping is:

  • examples/simple-host => examples/basic-host
  • examples/simple-server/ui-react.html => examples/basic-server-react
  • examples/simple-server/ui-vanilla.html => examples/basic-server-vanillajs

The PR for examples/basic-server-vanillajs is forthcoming, but I am experiencing severe internet connectivity issues right now. I was going to remove examples/simple-host and examples/simple-server only after all examples/basic-* are merged. But, if you prefer, I can do it all in this PR.

I pushed commits to add examples/basic-server-vanillajs and remove examples/simple-*, so everything is contained in this PR.

@jonathanhefner jonathanhefner force-pushed the basic-examples branch 4 times, most recently from accd453 to d390c49 Compare December 3, 2025 15:03
@jonathanhefner
Copy link
Member Author

I've also pushed a commit that adds a Quickstart guide based on basic-server-vanillajs. You can preview it at: https://jonathanhefner.github.io/mcp-ext-apps/api/documents/Quickstart.html

@jonathanhefner jonathanhefner changed the title Add basic-host and basic-server-react examples Add examples and quickstart guide Dec 3, 2025
Copy link
Collaborator

@antonpk1 antonpk1 left a comment

Choose a reason for hiding this comment

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

great work! 🎉

jonathanhefner and others added 4 commits December 4, 2025 14:28
Introduce new example implementations to replace simple-host and
simple-server:

- basic-host: Reference host implementation with double-iframe sandbox
  pattern for secure UI isolation (outer iframe validates and relays
  messages, inner iframe renders untrusted tool UI via srcdoc)

- basic-server-react: MCP server example demonstrating tool registration
  with linked UI resources and React UI using the useApp() hook

Build infrastructure updates:
- Add build:all script and simplify CI/pre-commit to use it
- Add examples:dev for watch-mode development workflow

Also change PostMessageTransport logging from info to debug level.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Demonstrates MCP App SDK usage with vanilla JavaScript (no framework),
providing parity with the existing basic-server-react example.

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

Co-Authored-By: Claude <noreply@anthropic.com>
These legacy examples have been replaced by basic-host,
basic-server-react, and basic-server-vanillajs.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Introduces a step-by-step tutorial covering:
- Project setup with Vite and TypeScript
- Server creation with tool + resource registration
- UI development using the App SDK
- Testing with basic-host

Also updates README to link to the guide and configures
typedoc to include it in generated documentation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@jonathanhefner jonathanhefner merged commit f1c995f into modelcontextprotocol:main Dec 4, 2025
1 check passed
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