Phantom.App.Preview (phantom_mcp v0.5.0)

Copy Markdown View Source

Development preview plug for MCP App resources.

Lists registered MCP Apps and interact with them in the browser.

MCP Preview App

MCP Sample App

Usage

Mount in your router during development

Phoenix Router

if Mix.env() == :dev do
  forward "/dev/mcp-apps", Phantom.App.Preview,
    router: MyApp.MCPRouter
end

Plug Router

if Mix.env() == :dev do
  forward "/dev/mcp-apps",
    to: Phantom.App.Preview,
    init_opts: [router: MyApp.MCPRouter]
end

Then visit /mcp-apps to see a list of registered apps, and click one to render it in a sandboxed iframe that simulates how MCP hosts display apps.

Development only

This plug is intended for development use only. Do not mount it in production as it renders app content without authentication.