docs: add contextual launch pattern - #736
Draft
Chipagosfinest wants to merge 1 commit into
Draft
Conversation
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.
What changed
hostContext.toolInfolimitation and link issue Provide a consistent way for MCP Apps to know which tool invoked them #492Why
Telegram and Farcaster make contextual launches useful through small entry parameters, but MCP Apps already has the necessary transport: tool arguments arrive through
ui/notifications/tool-input. Documenting that mapping gives builders a portable pattern without adding a new protocol primitive.The security guidance recommends bounded inputs and opaque server-side handles, and warns against putting credentials, raw conversation content, or personal data in launch arguments.
Prototype validation
The pattern is now exercised by Discussion Capsule, a standalone read-only MCP App. Its
open_github_discussiontool accepts a Discussion URL as an ordinary argument and returns source-groundedstructuredContentfor the linked view.I tested it against ext-apps Discussion #606 through this repository's basic reference host:
This prototype does not require a separate launch envelope or claim that tool input is authenticated provenance.
Validation
npm run prettiernpm test— 374 passed, 1 skippednpm exec typedoc -- --treatValidationWarningsAsErrors --emit nonenpm run build:allandnpm run prettier:fixPrototype repository:
npm test— 7 passednpm run buildAI assistance disclosure
This PR and the linked prototype were researched and authored with Codex under Alec Gutman's direction. The contribution uses the existing MCP Apps tool-input lifecycle and adds documentation plus type-checked examples; it does not change the protocol or runtime.