Use skybridge/server
This guide shows you how to addskybridge/server to an existing MCP server to enable widget support with full TypeScript type inference.
Prerequisites
You should already have:- A working MCP server using the official TypeScript MCP SDK
- Node.js 24+
Install Skybridge
Update your server
Replace yourMcpServer import with Skybridge’s enhanced version:
skybridge/server, you will also be able to register widgets, a new class encompassing a Tool and a corresponding UI Resource.
Widget structure
Skybridge follows a file-based convention for organizing widgets. Here’s the recommended project structure:Widget naming convention
Widget file name must match the registration name (e.g.,"my-widget" → my-widget.tsx). See registerWidget.
Set up the web project
Create aweb folder for your UI widgets:
Configure Vite
Createvite.config.ts in the web folder:
Create your first widget
Create a widget file inweb/src/widgets/my-widget.tsx:
Register the widget
In your server code, register the widget usingserver.registerWidget():
Configure your dev server
Update your server startup to serve the MCP endpoint. If you’re using Express:Type Safety
For full type inference and autocomplete, use method chaining andgenerateHelpers. See Type Safety for the complete setup.
Quick summary:
- Use method chaining when registering widgets
- Export
type AppType = typeof server - Create a
skybridge.tsfile withgenerateHelpers<AppType>() - Import typed hooks from your helper file
