Skip to main content
Low-level utilities for building MCP UI resources, dual-protocol widget metadata, and SEO landing pages. Most servers register widgets declaratively with server.uiResource(...) (see UIResource), which calls these helpers internally. The functions and types here are the building blocks for that pipeline and are also exported for advanced use. A widget is shipped as a ui:// resource plus tool metadata. mcp-use supports two protocols from a single definition:
  • MCP Apps Extension (SEP-1865): mime type text/html;profile=mcp-app, metadata under _meta.ui.*, camelCase CSP keys. Used by Claude, Goose, and other MCP Apps clients.
  • ChatGPT Apps SDK: mime type text/html+skybridge, metadata under openai/* keys, snake_case CSP keys.
The adapters on this page transform one UnifiedWidgetMetadata definition into either format, so you write the configuration once.
import { MCPServer } from "mcp-use/server"

const server = new MCPServer({
  name: "mcp-apps-gallery",
  version: "1.0.0",
  description: "MCP Apps widget gallery",
})

// Declarative path - registers a tool + ui:// resource and emits
// dual-protocol metadata under the hood.
server.uiResource({
  type: "mcpApps",
  name: "welcome-card",
  title: "Welcome",
  description: "A welcome card with server information",
  htmlTemplate: "<div class=\"card\"><h1>Welcome to MCP Apps</h1></div>",
  metadata: {
    prefersBorder: true,
    widgetDescription: "Server welcome card",
  },
  exposeAsTool: true,
})

await server.listen()

Resource builders

These functions produce UIResourceContent objects ({ type: "resource", resource }) that you can return from a tool or resource handler. They are the lower-level primitives behind createUIResourceFromDefinition.

createUIResourceFromDefinition

Create a UIResourceContent from a high-level UIResourceDefinition. This is the main router: it inspects the discriminated type field and delegates to the appropriate builder.
import { createUIResourceFromDefinition } from "mcp-use/server"
Routes a definition to the correct resource creator based on its type ("externalUrl", "rawHtml", "remoteDom", "appsSdk", or "mcpApps"). The resource URI is derived from definition.name. For appsSdk and mcpApps types it is ui://widget/<name>.html; for the others it is ui://widget/<name>. When config.buildId is set, it is appended to the name (ui://widget/<name>-<buildId>...) for cache busting. The encoding defaults to "text" when definition.encoding is not set. For the externalUrl type, params are passed through buildWidgetUrl to build the iframe URL. Throws Error("Unknown UI resource type: ...") if the definition type is not one of the supported values (enforced by an exhaustiveness check). Parameters
definition
UIResourceDefinition
required
UIResource definition (discriminated union on type)
params
Record<string, any>
required
Runtime parameters for the widget (used for the externalUrl type)
config
UrlConfig
required
URL configuration used when building widget URLs
Returns
returns
Promise<UIResourceContent>
Signature
function createUIResourceFromDefinition(definition: UIResourceDefinition, params: Record<string, any>, config: UrlConfig): Promise<UIResourceContent>

createMcpAppsResource

Create a UIResourceContent for the MCP Apps Extension (SEP-1865) using the text/html;profile=mcp-app mime type.
import { createMcpAppsResource } from "mcp-use/server"
Builds a synchronous MCP Apps resource. The HTML template should contain the component code with embedded JS and CSS. The widget receives the tool output via the MCP protocol. Metadata is written under resource._meta.ui per SEP-1865. Only the fields you set are emitted: csp is included when it has at least one key, prefersBorder when it is not undefined, and domain when truthy. If no metadata fields apply, _meta is omitted entirely. Parameters
uri
string
required
Resource URI (must start with ui://)
htmlTemplate
string
required
HTML template with embedded component code
metadata
{ description?: string; csp?: { connectDomains?: string[]; resourceDomains?: string[]; frameDomains?: string[]; baseUriDomains?: string[] }; prefersBorder?: boolean; domain?: string }
MCP Apps metadata (CSP, border preference, domain)
Returns
returns
UIResourceContent
Signature
function createMcpAppsResource(uri: string, htmlTemplate: string, metadata?: { description?: string; csp?: { connectDomains?: string[]; resourceDomains?: string[]; frameDomains?: string[]; baseUriDomains?: string[] }; prefersBorder?: boolean; domain?: string }): UIResourceContent

createExternalUrlResource

Create a UIResourceContent that loads an external URL in an iframe.
import { createExternalUrlResource } from "mcp-use/server"
Wraps @mcp-ui/server’s createUIResource with content: { type: "externalUrl", iframeUrl }. Use this for widgets served from a separate origin (for example a Vite dev server or a deployed static site). Parameters
uri
string
required
Resource URI (must start with ui://)
iframeUrl
string
required
URL to load in the iframe
encoding
UIEncoding
default:"\"text\""
Encoding type ("text" or "blob")
adapters
AdaptersConfig
Adapter configuration (for example Apps SDK) passed through to @mcp-ui/server
metadata
AppsSdkMetadata
Additional metadata for the resource
Returns
returns
Promise<UIResourceContent>
Signature
function createExternalUrlResource(uri: string, iframeUrl: string, encoding?: UIEncoding, adapters?: AdaptersConfig, metadata?: AppsSdkMetadata): Promise<UIResourceContent>

createRawHtmlResource

Create a UIResourceContent that renders raw HTML inline.
import { createRawHtmlResource } from "mcp-use/server"
Wraps @mcp-ui/server’s createUIResource with content: { type: "rawHtml", htmlString }. The HTML is delivered inline rather than loaded from a URL. Parameters
uri
string
required
Resource URI (must start with ui://)
htmlString
string
required
HTML content to render
encoding
UIEncoding
default:"\"text\""
Encoding type ("text" or "blob")
adapters
AdaptersConfig
Adapter configuration (for example Apps SDK)
metadata
AppsSdkMetadata
Additional metadata for the resource
Returns
returns
Promise<UIResourceContent>
Signature
function createRawHtmlResource(uri: string, htmlString: string, encoding?: UIEncoding, adapters?: AdaptersConfig, metadata?: AppsSdkMetadata): Promise<UIResourceContent>

createRemoteDomResource

Create a UIResourceContent for Remote DOM scripting.
import { createRemoteDomResource } from "mcp-use/server"
Builds a Remote DOM resource with mime type application/vnd.mcp-ui.remote-dom+<framework>. Because remoteDom was removed from createUIResource in @mcp-ui/server v6, this constructs the resource object manually. When encoding is "blob", the script is base64-encoded into resource.blob; otherwise it is placed in resource.text.
The adapters and metadata parameters are accepted for signature parity but are not applied (they are prefixed with an underscore in the implementation). The MIME type is still rendered by @mcp-ui/client.
Parameters
uri
string
required
Resource URI (must start with ui://)
script
string
required
JavaScript code for remote DOM manipulation
framework
"react" | "webcomponents"
default:"\"react\""
Framework for remote DOM
encoding
UIEncoding
default:"\"text\""
Encoding type ("text" or "blob")
_adapters
AdaptersConfig
Accepted for parity; not applied
_metadata
AppsSdkMetadata
Accepted for parity; not applied
Returns
returns
Promise<UIResourceContent>
Signature
function createRemoteDomResource(uri: string, script: string, framework?: "react" | "webcomponents", encoding?: UIEncoding, _adapters?: AdaptersConfig, _metadata?: AppsSdkMetadata): Promise<UIResourceContent>

buildWidgetUrl

Build the full URL for a locally served widget, including encoded props.
import { buildWidgetUrl } from "mcp-use/server"
Constructs a URL of the form <baseUrl>:<port>/mcp-use/widgets/<slug>. The widget name is slugified for URL safety. When props is provided and non-empty, all props are serialized into a single props query parameter as JSON. When props is undefined or an empty object, no query parameter is added. Parameters
widget
string
required
Widget identifier (slugified for the URL path)
props
Record<string, any> | undefined
required
Parameters passed as a single JSON-encoded props query param
config
UrlConfig
required
URL configuration (baseUrl, port, optional buildId)
Returns
returns
string
Signature
function buildWidgetUrl(widget: string, props: Record<string, any> | undefined, config: UrlConfig): string

UrlConfig

Configuration for building widget URLs, consumed by buildWidgetUrl and createUIResourceFromDefinition.
import type { UrlConfig } from "mcp-use/server"
Properties
baseUrl
string
required
Base URL of the server (for example http://localhost)
port
number | string
required
Server port appended to the base URL
buildId
string
Optional build ID appended to widget URIs for cache busting
Signature
interface UrlConfig {
  baseUrl: string
  port: number | string
  buildId?: string
}

Protocol adapters

Adapters transform a single UnifiedWidgetMetadata definition into protocol-specific tool and resource metadata. Both implement ProtocolAdapter.

AppsSdkAdapter

Protocol adapter that emits ChatGPT Apps SDK metadata.
import { AppsSdkAdapter } from "mcp-use/server"
Transforms unified widget definitions into Apps SDK format: mime type text/html+skybridge, flat _meta keys prefixed with openai/, and snake_case CSP fields (connect_domains, resource_domains, and so on). buildToolMetadata always sets openai/outputTemplate to the resource URI and copies openai/toolInvocation/invoking, openai/toolInvocation/invoked, openai/widgetAccessible, and openai/resultCanProduceWidget from appsSdkMetadata when present. It falls back to metadata.invoking and metadata.invoked for the invocation status keys. buildResourceMetadata extends the base implementation by copying additional openai/* fields from appsSdkMetadata when they are not already set. Members
mimeType
string
Readonly. Always "text/html+skybridge".
protocol
"apps-sdk"
Readonly protocol identifier.
buildToolMetadata(definition, uri)
Record<string, unknown>
Builds Apps SDK tool metadata for a definition and resource URI.
buildResourceMetadata(definition)
{ mimeType: string; _meta?: Record<string, unknown> }
Builds Apps SDK resource metadata (mime type plus _meta).
Signature
class AppsSdkAdapter extends BaseProtocolAdapter {
  readonly mimeType: string // "text/html+skybridge"
  readonly protocol: "apps-sdk"
  buildToolMetadata(definition: UIResourceDefinition, uri: string): Record<string, unknown>
  buildResourceMetadata(definition: UIResourceDefinition): { mimeType: string; _meta?: Record<string, unknown> }
}

McpAppsAdapter

Protocol adapter that emits MCP Apps Extension (SEP-1865) metadata.
import { McpAppsAdapter } from "mcp-use/server"
Transforms unified widget definitions into MCP Apps format: mime type text/html;profile=mcp-app (the value of RESOURCE_MIME_TYPE), metadata under the _meta.ui.* namespace, and camelCase CSP fields kept as-is. buildToolMetadata returns the new nested form { ui: { resourceUri } } and also includes the legacy flat key RESOURCE_URI_META_KEY pointing at the same URI for backward compatibility with older clients. Resource metadata is wrapped under _meta.ui. Members
mimeType
string
Readonly. Equals RESOURCE_MIME_TYPE ("text/html;profile=mcp-app").
protocol
"mcp-apps"
Readonly protocol identifier.
buildToolMetadata(definition, uri)
Record<string, unknown>
Builds MCP Apps tool metadata (ui.resourceUri plus the legacy flat key).
buildResourceMetadata(definition)
{ mimeType: string; _meta?: Record<string, unknown> }
Builds MCP Apps resource metadata wrapped under _meta.ui.
Signature
class McpAppsAdapter extends BaseProtocolAdapter {
  readonly mimeType: string // "text/html;profile=mcp-app"
  readonly protocol: "mcp-apps"
  buildToolMetadata(definition: UIResourceDefinition, uri: string): Record<string, unknown>
  buildResourceMetadata(definition: UIResourceDefinition): { mimeType: string; _meta?: Record<string, unknown> }
}

ProtocolAdapter

The interface implemented by every protocol adapter (AppsSdkAdapter and McpAppsAdapter).
import type { ProtocolAdapter } from "mcp-use/server"
Defines how a unified widget definition is converted into protocol-specific tool and resource metadata. Properties
mimeType
string
required
Readonly mime type for this protocol (text/html;profile=mcp-app for MCP Apps, text/html+skybridge for Apps SDK)
protocol
"mcp-apps" | "apps-sdk"
required
Readonly protocol identifier
Methods
buildToolMetadata(definition, uri)
Record<string, unknown>
required
Build protocol-specific tool metadata from a definition and resource URI
buildResourceMetadata(definition)
{ mimeType: string; _meta?: Record<string, unknown> }
required
Build protocol-specific resource metadata (includes mimeType and optional _meta)
Signature
interface ProtocolAdapter {
  readonly mimeType: string
  readonly protocol: "mcp-apps" | "apps-sdk"
  buildToolMetadata(definition: UIResourceDefinition, uri: string): Record<string, unknown>
  buildResourceMetadata(definition: UIResourceDefinition): { mimeType: string; _meta?: Record<string, unknown> }
}

CSPConfig

Unified Content Security Policy configuration. Adapters map these camelCase fields to MCP Apps (camelCase) or Apps SDK (snake_case) format.
import type { CSPConfig } from "mcp-use/server"
Follows the SEP-1865 specification with support for arbitrary additional properties (the index signature allows fields not yet listed here, for future spec evolution). Properties
connectDomains
string[]
Domains allowed for fetch, XHR, and WebSocket connections
resourceDomains
string[]
Domains allowed for images, scripts, stylesheets, and fonts
frameDomains
string[]
Allowed iframe origins
baseUriDomains
string[]
Allowed base URIs for the document (SEP-1865)
redirectDomains
string[]
Domains for openExternal without a confirmation modal (ChatGPT only, not in SEP-1865)
scriptDirectives
string[]
CSP directive literals to include in script-src (for example 'unsafe-eval'). Use with caution, these weaken security.
styleDirectives
string[]
CSP directive literals to include in style-src (for example 'unsafe-inline')
Signature
interface CSPConfig {
  connectDomains?: string[]
  resourceDomains?: string[]
  frameDomains?: string[]
  baseUriDomains?: string[]
  redirectDomains?: string[]
  scriptDirectives?: string[]
  styleDirectives?: string[]
  [key: string]: any
}

UnifiedWidgetMetadata

Protocol-agnostic widget metadata. Write it once, and adapters transform it into both MCP Apps and Apps SDK formats.
import type { UnifiedWidgetMetadata } from "mcp-use/server"
Follows SEP-1865 with support for arbitrary additional properties via an index signature. Some fields target a single protocol (noted below); the other protocol ignores them. Properties
description
string
Description of the widget
csp
CSPConfig
Content Security Policy
prefersBorder
boolean
Request a visible border around the widget
domain
string
Dedicated domain for widget isolation
widgetDescription
string
Human-readable summary for the AI model (ChatGPT only)
permissions
{ camera?; microphone?; geolocation?; clipboardWrite?; [key: string]: any }
Sandbox permissions requested by the UI (SEP-1865). Hosts MAY honor these via iframe allow attributes.
autoResize
boolean
Enable automatic size change notifications (legacy MCP-UI, still supported)
invoking
string
Status text shown while the tool is running. Maps to openai/toolInvocation/invoking. Defaults to "Loading {name}...".
invoked
string
Status text shown after the tool completes. Maps to openai/toolInvocation/invoked. Defaults to "{name} ready".
Signature
interface UnifiedWidgetMetadata {
  description?: string
  csp?: CSPConfig
  prefersBorder?: boolean
  domain?: string
  widgetDescription?: string
  permissions?: {
    camera?: Record<string, never>
    microphone?: Record<string, never>
    geolocation?: Record<string, never>
    clipboardWrite?: Record<string, never>
    [key: string]: any
  }
  autoResize?: boolean
  invoking?: string
  invoked?: string
  [key: string]: any
}

RESOURCE_MIME_TYPE

The MCP Apps Extension mime type, re-exported from @modelcontextprotocol/ext-apps.
import { RESOURCE_MIME_TYPE } from "mcp-use/server"
The mime type used for MCP Apps resources: "text/html;profile=mcp-app". It is the value returned by McpAppsAdapter’s mimeType property. Re-exported from @modelcontextprotocol/ext-apps/server for convenience. Signature
const RESOURCE_MIME_TYPE: string // "text/html;profile=mcp-app"

RESOURCE_URI_META_KEY

The legacy flat _meta key for an MCP Apps resource URI, re-exported from @modelcontextprotocol/ext-apps.
import { RESOURCE_URI_META_KEY } from "mcp-use/server"
The flat _meta key under which the resource URI is duplicated for backward compatibility with older MCP Apps clients (McpAppsAdapter also emits the newer nested ui.resourceUri form). Re-exported from @modelcontextprotocol/ext-apps/server. Signature
const RESOURCE_URI_META_KEY: string

Widget definition types

These types describe widgets at the discovery and manifest level.

WidgetManifest

Manifest describing a built widget on disk.
import type { WidgetManifest } from "mcp-use/server"
Describes a widget’s identity, props, preferred frame size, and built asset paths. The name must match the widget directory or file name. Properties
name
string
required
Unique widget identifier (must match directory or file name), for example "weather-display"
title
string
Human-readable title
description
string
Description of what the widget displays
version
string
Semantic version of the widget
props
WidgetProps
Widget props schema (type, required, default per prop)
size
[string, string]
Preferred frame size [width, height], for example ["800px", "600px"]
assets
{ main?: string; scripts?: string[]; styles?: string[] }
Asset paths for the main entry, scripts, and styles
Signature
interface WidgetManifest {
  name: string
  title?: string
  description?: string
  version?: string
  props?: WidgetProps
  size?: [string, string]
  assets?: { main?: string; scripts?: string[]; styles?: string[] }
}

WidgetMetadata

Metadata exported from a React widget module (a resources/*.tsx file) for auto-discovery and auto-registration.
import type { WidgetMetadata } from "mcp-use/react"
Declares a widget’s title, props schema, tool output, and dual-protocol metadata. Exported by widget developers as widgetMetadata. The auto-discovery pipeline reads it to register the widget and (when exposeAsTool is not false) an MCP tool.
This type is exported from mcp-use/react, not mcp-use/server. It is documented here because it configures the same dual-protocol widget pipeline.
Properties
title
string
Human-readable title for the widget
description
string
Description shown to the model and used for auto-registered tool descriptions
props
z.ZodTypeAny | InputDefinition[]
Zod schema (preferred) or InputDefinition array for widget props validation
inputs
z.ZodTypeAny | InputDefinition[]
Deprecated. Use props instead.
schema
z.ZodTypeAny | InputDefinition[]
Deprecated. Use props instead.
toolOutput
((params: Record<string, any>) => CallToolResult | TypedCallToolResult<any>) | CallToolResult | TypedCallToolResult<any>
Function or static value producing the tool output (what the model sees). Defaults to a summary message.
exposeAsTool
boolean
default:"true"
Whether to auto-register this widget as an MCP tool. Set to false when paired with a custom server.tool().
annotations
ResourceAnnotations & Partial<ToolAnnotations>
Annotations applied to both the resource and the tool
_meta
Record<string, unknown>
Optional raw metadata for the widget
appsSdkMetadata
AppsSdkMetadata
Deprecated. Legacy ChatGPT-only metadata. Prefer metadata for dual-protocol support.
metadata
{ description?; csp?: CSPConfig; prefersBorder?; domain?; widgetDescription?; autoResize?; invoking?; invoked? }
Unified dual-protocol metadata. Write once; the server generates both Apps SDK and MCP Apps formats.
Signature
interface WidgetMetadata {
  title?: string
  description?: string
  props?: z.ZodTypeAny | InputDefinition[]
  inputs?: z.ZodTypeAny | InputDefinition[] // deprecated
  schema?: z.ZodTypeAny | InputDefinition[] // deprecated
  toolOutput?:
    | ((params: Record<string, any>) => CallToolResult | TypedCallToolResult<any>)
    | CallToolResult
    | TypedCallToolResult<any>
  exposeAsTool?: boolean
  annotations?: ResourceAnnotations & Partial<ToolAnnotations>
  _meta?: Record<string, unknown>
  appsSdkMetadata?: AppsSdkMetadata // deprecated
  metadata?: {
    description?: string
    csp?: CSPConfig
    prefersBorder?: boolean
    domain?: string
    widgetDescription?: string
    autoResize?: boolean
    invoking?: string
    invoked?: string
  }
}

DiscoverWidgetsOptions

Options for discovering and registering widgets from a directory.
import type { DiscoverWidgetsOptions } from "mcp-use/server"
Controls where widgets are discovered, whether widgets without manifests are auto-registered, and an optional name filter. Properties
path
string
Path to the widgets directory. Defaults to dist/resources/mcp-use/widgets.
autoRegister
boolean
default:"false"
Automatically register widgets that do not have manifests
filter
string | RegExp
Filter widgets by name pattern, for example "weather-*"
Signature
interface DiscoverWidgetsOptions {
  path?: string
  autoRegister?: boolean
  filter?: string | RegExp
}

Landing page

generateLandingPage builds the SEO-friendly HTML page shown when a browser hits the MCP endpoint. Most servers do not call it directly: set publicLandingPage: true on new MCPServer({ ... }) and the server renders this page automatically for browser GET requests.
import { MCPServer, oauthProxy } from "mcp-use/server"

const server = new MCPServer({
  name: "public-landing-page-example",
  version: "1.0.0",
  description: "An OAuth-protected MCP server whose browser landing page remains public.",
  baseUrl: "http://localhost:3000",
  publicLandingPage: true,
  oauth: oauthProxy({
    issuer: "https://example.com/demo-oauth",
    authEndpoint: "https://example.com/demo-oauth/authorize",
    tokenEndpoint: "https://example.com/demo-oauth/token",
    clientId: "public-landing-page-example",
    scopes: ["openid", "profile", "read:demo"],
    verifyToken: async (token: string) => {
      if (token !== "demo-token") {
        throw new Error("Invalid demo token")
      }
      return { payload: { sub: "demo-user" } }
    },
  }),
})

await server.listen(3000)

generateLandingPage

Generate an SEO-friendly HTML landing page with connection instructions for Claude Code, Cursor, VS Code, VS Code Insiders, ChatGPT, and the hosted Manufact Inspector.
import { generateLandingPage } from "mcp-use/server"
Returns a complete HTML document string (including inline CSS and JS) that lists install commands and deep links for each supported client, plus an optional Primitives section listing tools, prompts, and resources. All user-provided values are HTML-escaped. Tool entries may be plain strings or LandingPageTool objects. Parameters
name
string
required
Server name
version
string
required
Server version
url
string
required
Full server URL (protocol, host, port, and path)
description
string
Optional server description
tools
(LandingPageTool | string)[]
Optional list of tools (names or { name, description })
prompts
LandingPagePrompt[]
Optional list of prompts
resources
LandingPageResource[]
Optional list of resources
iconUrl
string
Optional full URL to the server icon image
Returns
returns
string
Signature
function generateLandingPage(name: string, version: string, url: string, description?: string, tools?: (LandingPageTool | string)[], prompts?: LandingPagePrompt[], resources?: LandingPageResource[], iconUrl?: string): string

LandingPageTool

A tool entry rendered in the landing page Primitives section.
import type { LandingPageTool } from "mcp-use/server"
Properties
name
string
required
Tool name
description
string
Optional tool description
Signature
interface LandingPageTool {
  name: string
  description?: string
}

LandingPagePrompt

A prompt entry rendered in the landing page Primitives section.
import type { LandingPagePrompt } from "mcp-use/server"
Properties
name
string
required
Prompt name
description
string
Optional prompt description
Signature
interface LandingPagePrompt {
  name: string
  description?: string
}

LandingPageResource

A resource entry rendered in the landing page Primitives section.
import type { LandingPageResource } from "mcp-use/server"
Properties
uri
string
required
Resource URI
name
string
Optional resource name
description
string
Optional resource description
Signature
interface LandingPageResource {
  uri: string
  name?: string
  description?: string
}

Type generation

generateToolRegistryTypes

Generate TypeScript type definitions for the ToolRegistry from registered tools and write them to .mcp-use/tool-registry.d.ts.
import { generateToolRegistryTypes } from "mcp-use/server"
Reads each registered tool’s Zod input and output schemas, converts them to TypeScript types, and emits a declare module "mcp-use/react" augmentation of the ToolRegistry interface. This powers type-safe tool calls in the useCallTool React hook. It is invoked automatically during development (on startup and on tool or widget changes) and by the mcp-use generate-types CLI command. Behavior and edge cases:
  • Production-safe: returns true immediately and writes nothing when process.env.NODE_ENV === "production".
  • Deterministic: tools are sorted alphabetically by name before generation.
  • Idempotent writes: the new content is compared against the existing file (ignoring the timestamp line); if unchanged, the file is not rewritten.
  • Defaults: a tool with no input schema is typed as null; a tool with no outputSchema is typed as Record<string, unknown>.
Parameters
registrations
Map<string, { config: ToolDefinition; handler: ToolCallback }>
required
The server’s registrations.tools map
projectRoot
string
default:"process.cwd()"
Project root directory where .mcp-use/ is written
Returns
returns
Promise<boolean>
Signature
function generateToolRegistryTypes(registrations: Map<string, { config: ToolDefinition; handler: ToolCallback }>, projectRoot?: string): Promise<boolean>