Skip to content

Documentation / @agentick/mcp / createMCPApp

Function: createMCPApp()

createMCPApp(options): Promise<MCPAppHandle>

Defined in: client/apps.ts:114

Create an MCP App bridge for a sandboxed iframe.

The host should:

  1. Create the iframe with appropriate sandbox and allow attributes (use buildAllowAttribute(permissions) for the allow attribute)
  2. Set the iframe's src to a URL serving the ui:// resource HTML
  3. Wait for the iframe to load
  4. Call createMCPApp({ iframe, ... }) to wire up the bridge

The bridge handles:

  • postMessage JSON-RPC protocol via PostMessageTransport
  • Tool call proxying from the iframe to the MCP server
  • Visibility enforcement (model-only tools rejected)
  • Standard MCP forwarding (resources/read, prompts/get, etc.)

Parameters

options

CreateMCPAppOptions

Returns

Promise<MCPAppHandle>

Released under the ISC License.