@maxhealth.tech/prefab / mcp
mcp
Interfaces
| Interface | Description |
|---|---|
| DisplayA2uiOptions | - |
| A2uiResourceOptions | - |
| DisplayOptions | - |
| DisplayFormOptions | - |
| StateUpdate | - |
| DisplayUpdateOptions | - |
| DisplayErrorOptions | - |
| DisplaySuccessOptions | - |
| FormInputRequestOptions | - |
| McpAppCsp | CSP configuration for MCP Apps resources. |
| McpAppPermissions | Permission Policy requests for MCP Apps resources. |
| ResourceMetaOptions | - |
| RendererHtmlOptions | - |
| ViewerResourceOptions | - |
| ResourceConfig | Registration config accepted by both SDK generations. |
| McpServerLike | MCP server interface expected by registerViewerResource. |
| ToolResultOptions | - |
| VsCodeTokenSource | How one prefab token is sourced from the VS Code webview. |
Type Aliases
| Type Alias | Description |
|---|---|
| PrefabUpdateWire | The $prefab state-delta payload, sent as structuredContent. |
| FormValue | Values a client may return for one field. |
| ResourceReadHandler | resources/read handler shape passed to the server — the viewer is always HTML text. |
| ThemeBridge | Supported theme bridges. |
| McpTextContent | MCP text content block (compatible with SDK's TextContent) |
| McpImageContent | MCP image content block (compatible with SDK's ImageContent) |
| McpTextResourceContents | Text resource contents (has text, never blob). |
| McpBlobResourceContents | Blob resource contents (has blob, never text). See McpTextResourceContents on the alias. |
| McpResourceContent | MCP embedded resource content block (compatible with SDK's EmbeddedResource) |
| McpContent | Any MCP content block |
| McpToolResult | MCP tool result — returned from tool handlers. |
| McpDisplayResult | A tool result whose structuredContent is guaranteed present. |
| McpCacheScope | Cache scopes defined for cacheable results. |
| McpCacheHint | Cache fields required on results from the cacheable operations (tools/list, prompts/list, resources/list, resources/templates/list, resources/read, server/discover). |
| McpResourceReadResult | A resources/read result carrying the required cache fields. |
| McpStringSchema | The restricted JSON Schema an elicitation may request. |
| McpNumberSchema | - |
| McpBooleanSchema | - |
| McpEnumSchema | Single selection: a string constrained to a fixed set of values. |
| McpMultiEnumSchema | Multiple selection: an array of values drawn from a fixed set. |
| McpPrimitiveSchema | - |
| McpRestrictedSchema | The flat object schema an elicitation/create request asks the client to fill. |
| McpElicitFormRequest | Form-mode elicitation: the client renders the schema and returns the values. |
| McpElicitUrlRequest | URL-mode elicitation: the client sends the user out of band and reports back. |
| McpElicitRequest | - |
| McpInputRequests | Server-issued requests the client must fulfil before retrying the call. |
| McpElicitResult | What the client sends back for one request, keyed the same way. |
| McpInputResponses | - |
| McpInputRequiredResult | A result asking the client for input before the call can complete. |
Variables
| Variable | Description |
|---|---|
| A2UI_RESOURCE_URI | Default URI for a server that serves a single A2UI surface. |
| displayA2ui | camelCase alias, matching the other display helpers. |
| displayForm | MCP display helpers — return prefab UIs as MCP tool results. |
| displayUpdate | MCP display helpers — return prefab UIs as MCP tool results. |
| displayError | MCP display helpers — return prefab UIs as MCP tool results. |
| displaySuccess | MCP display helpers — return prefab UIs as MCP tool results. |
| PREFAB_CDN_META | Default CSP meta for prefab apps using jsDelivr CDN. |
| PREFAB_RESOURCE_URI | Default URI for the prefab viewer resource. |
| MCP_APP_MIME | MIME type required by MCP Apps hosts. |
| APPS_EXTENSION | Capability key for the MCP Apps extension (versioned independently of core). |
| DEFAULT_VIEWER_CACHE | Default cache hint for the viewer resource. |
| VSCODE_BRIDGE | prefab tokens that VS Code can supply, with the same variables and static fallbacks prefab.css uses. Tokens VS Code has no equivalent for (--success, --warning, shadows, radii) are deliberately absent: the bridge only overrides what the editor can actually provide. |
Functions
| Function | Description |
|---|---|
| a2uiPayload | Wrap messages in the list envelope A2UI defines for non-streaming transports. |
| display_a2ui | Return a view as an A2UI tool result. |
| registerA2uiResource | Register a static A2UI surface as an a2ui:// resource. |
| display | MCP display helpers — return prefab UIs as MCP tool results. |
| display_form | MCP display helpers — return prefab UIs as MCP tool results. |
| display_update | MCP display helpers — return prefab UIs as MCP tool results. |
| display_error | MCP display helpers — return prefab UIs as MCP tool results. |
| display_success | MCP display helpers — return prefab UIs as MCP tool results. |
| formSchema | Derive the restricted elicitation schema from form fields. |
| formInputRequest | Ask the client to collect these fields, then retry the call. |
| inputResponse | A client's answer for one key, or undefined when it has not arrived yet. |
| acceptedFormInput | Read and check an accepted form answer. |
| resourceMeta | Generate the _meta object for MCP Apps ui:// resource registration. |
| rendererHtml | Generate the HTML page for a prefab MCP Apps viewer resource. |
| resolveCache | Fill in and validate the CacheableResult fields, rejecting values the SDK would silently discard in favour of ttlMs: 0. |
| registerViewerResource | Register the prefab viewer as a ui:// resource on an MCP server. |
| toolResult | Wrap a JSON payload as an MCP tool result. |
| themeBridgeCss | Generate the theme-bridge CSS (the contents of a <style> element). |