@modelcontextprotocol/ext-apps - v1.0.1
    Preparing search index...

    Module server-helpers

    Utilities for MCP servers to register tools and resources that display interactive UIs.

    Use these helpers instead of the base SDK's registerTool and registerResource when your tool should render an App in the client. They handle UI metadata normalization and provide sensible defaults for the MCP Apps MIME type (RESOURCE_MIME_TYPE).

    // Register a tool that displays a view
    registerAppTool(
    server,
    "weather",
    {
    description: "Get weather forecast",
    _meta: { ui: { resourceUri: "ui://weather/view.html" } },
    },
    toolCallback,
    );

    // Register the HTML resource the tool references
    registerAppResource(
    server,
    "Weather View",
    "ui://weather/view.html",
    {},
    readCallback,
    );

    Interfaces

    McpUiAppResourceConfig
    McpUiAppToolConfig
    ToolConfig

    Type Aliases

    ReadResourceCallback
    ResourceMetadata
    ToolCallback

    Variables

    EXTENSION_ID

    Functions

    getUiCapability
    registerAppResource
    registerAppTool

    References

    RESOURCE_MIME_TYPE → RESOURCE_MIME_TYPE
    RESOURCE_URI_META_KEY → RESOURCE_URI_META_KEY