The three pieces
Vite turns
weather.html into dist/widgets/weather.html. The resource serves that file under a URI such as ui://weather/widget.html. The host loads the HTML and delivers the tool result to React.
Toolgrain handles the native Apps connection, result delivery, host styling, and widget sizing. Your application owns its UI and build. The host owns iframe creation, sandboxing, CSP enforcement, and permission grants.
Follow the guides in order
- Build your first widget: scaffold a React app, add the tool and resource, and connect a host.
- Use React hooks: add refresh calls, loading/error states, and optional host context.
- Add more widgets: build a separate HTML file for each resource.
- Permissions and metadata: edit one configuration object for the widget’s needs.
Apps and React are available in Toolgrain 0.3.0 or later. Install matching versions across Toolgrain packages. Compatibility and acceptance records exact tested builds and live-host coverage.
2026-01-26, independently of the outer MCP connection. See the protocol support table for the implemented messages.