You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add server helpers and optional connect() transport
## Server Helpers (`src/server/`)
Add convenience functions for registering MCP App tools and resources:
- `registerAppTool(server, name, config, handler)` - registers a tool with
`_meta[RESOURCE_URI_META_KEY]` for the UI resource URI
- `registerAppResource(server, name, uri, config, callback)` - registers a
resource with default MIME type `text/html;profile=mcp-app`
Types use SDK directly: `Pick<McpServer, "registerTool">`, `ToolCallback`, etc.
## Optional Transport in App.connect()
`App.connect()` now accepts an optional transport parameter:
- Defaults to `PostMessageTransport(window.parent)` when not provided
- Simplifies app initialization: `await app.connect()` just works
## Example Updates
Updated basic-server-react and basic-server-vanillajs examples to use the new helpers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
0 commit comments