Repository navigation
Conversation
Adds a fifth agent skill, add-apps-to-host, for building the host side of MCP Apps in TypeScript: the sandbox proxy page on a separate origin, the AppFrame component that owns the iframe and AppBridge, and the backend endpoints they rely on. The skill walks through the required startup order, the four UI-to-model routes, persistence and re-drawing, the spec's security rules (origin split, CSP as an HTTP header, visibility checks), common mistakes, and a test plan using the repo's example servers. Also adds docs/building-a-host.html, a standalone visual walkthrough of the same material, and lists the new skill in docs/agent-skills.md, the plugin README and AGENTS.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The repo ships skills for building MCP Apps (create-mcp-app, add-app-to-server, convert-web-app, migrate-oai-app). Nothing covers the other side of the protocol: a chat client that wants to render MCP Apps. Host authors have to reverse-engineer examples/basic-host and the spec to learn which pieces to build, in what order, and which security rules are mandatory. Most mistakes happen in the browser parts, the sandbox proxy page and the component that owns the iframe and AppBridge: a sandbox on the same origin as the host, CSP in a meta tag, sending tool input before
initialized, or no visibility check on app-initiated tool calls.Solution
plugins/mcp-apps/skills/add-apps-to-host/:initialized, graceful teardown, theme and size sync, app-provided tools) and a React wrapper that is safe under Strict Mode.Testing
examples/basic-host(strict tsconfig) from a throwaway folder (not committed). The only errors were ones caused by splitting the snippets apart (duplicate imports across sections, unused locals). No real type errors, so the markdown needed no changes.src/app-bridge.ts,src/app.tsandsrc/spec.types.ts, and that the ports in the test plan matchexamples/run-all.ts(3101+) andexamples/basic-host/serve.ts(8080/8081).npm run build:alland prettier, both passed.typedoc --treatValidationWarningsAsErrors --emit nonepassed.