UNPKG

mcp-use

Version:

Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents, Clients and Servers with support for ChatGPT Apps, Code Mode, OAuth, Notifications, Sampling, Observability and more.

28 lines 1.44 kB
/** * Development mode widget mounting with Vite HMR * * This module handles serving widgets from the resources/ directory in development mode * with hot module replacement (HMR) support. It uses Vite to transform and serve * React/TSX widget files with live reloading during development. */ import type { Hono as HonoType } from "hono"; import type { ServerConfig, MountWidgetsOptions, RegisterWidgetCallback } from "./widget-types.js"; /** * Configuration for development widget mounting */ export type MountWidgetsDevOptions = MountWidgetsOptions; /** * Mount widgets from resources/ directory in development mode with Vite HMR * * Discovers TSX widget files and folders with widget.tsx, creates temporary entry files, * and sets up a shared Vite dev server with hot module replacement. Each widget is * registered as both a tool and resource for MCP-UI compatibility. * * @param app - Hono app instance to mount routes on * @param serverConfig - Server configuration (baseUrl, port, CSP URLs) * @param registerWidget - Callback to register each discovered widget * @param options - Optional configuration (baseRoute, resourcesDir) * @returns Promise that resolves when all widgets are mounted */ export declare function mountWidgetsDev(app: HonoType, serverConfig: ServerConfig, registerWidget: RegisterWidgetCallback, options?: MountWidgetsDevOptions): Promise<void>; //# sourceMappingURL=mount-widgets-dev.d.ts.map