Skip to content

docs: add contextual launch pattern - #736

Draft
Chipagosfinest wants to merge 1 commit into
modelcontextprotocol:mainfrom
Chipagosfinest:agent/document-contextual-launches
Draft

docs: add contextual launch pattern#736
Chipagosfinest wants to merge 1 commit into
modelcontextprotocol:mainfrom
Chipagosfinest:agent/document-contextual-launches

Conversation

@Chipagosfinest

@Chipagosfinest Chipagosfinest commented Jul 31, 2026

Copy link
Copy Markdown

What changed

  • document tool arguments as the portable way to pass app-specific launch data
  • add type-checked server and View examples for multiple contextual entry points
  • distinguish launch input from authenticated identity or trusted host provenance
  • document the current hostContext.toolInfo limitation and link issue Provide a consistent way for MCP Apps to know which tool invoked them #492

Why

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_discussion tool accepts a Discussion URL as an ordinary argument and returns source-grounded structuredContent for the linked view.

I tested it against ext-apps Discussion #606 through this repository's basic reference host:

  • the real Discussion loaded with 4 comments, 4 participants, and 8 source-linked questions
  • the app rendered through the sandbox with zero browser console errors
  • host-message handoff, comment filters, source links, and draft selection worked
  • the app never posts or mutates GitHub state

This prototype does not require a separate launch envelope or claim that tool input is authenticated provenance.

Validation

  • npm run prettier
  • npm test — 374 passed, 1 skipped
  • npm exec typedoc -- --treatValidationWarningsAsErrors --emit none
  • pre-commit npm run build:all and npm run prettier:fix

Prototype repository:

AI 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.

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.

1 participant