@mcpjam/sdk/host-compat is the shared host-compatibility engine. It answers “does this MCP server work on host X?” by joining a server’s derived requirements against per-host capability profiles to produce works / degraded / blocked verdicts. The same engine powers the Inspector’s Compatibility destination, the CLI, and the public API.
Import
deriveServerRequirements()
Derives what a server demands of a host from its tools list, optional widget-usage scan, and optional connection facts.Parameters
| Parameter | Type | Description |
|---|---|---|
toolsData | HostCompatToolsInput | null | Tools list from ListToolsResult, plus optional per-tool _meta metadata. |
widgetUsage | WidgetUsage | Capability needs derived from scanning widget HTML (from scanWidgetSource). Pass undefined when HTML hasn’t been fetched yet — the result will include an unknownDimensions entry. |
connectionFacts | ConnectionFacts | Protocol version negotiated at connect time. |
HostCompatToolsInput
| Property | Type | Description |
|---|---|---|
tools | HostCompatTool[] | Array of tools. Each tool needs at minimum a name and optional _meta. |
toolsMetadata | Record<string, Record<string, unknown>> | Per-tool _meta map keyed by tool name. When present, wins over inline tool._meta. |
Returns: ServerRequirements
| Property | Type | Description |
|---|---|---|
widgets.mcpAppsOnly | string[] | Tool names that declare only an MCP Apps widget template. |
widgets.openaiAppsOnly | string[] | Tool names that declare only an OpenAI Apps SDK template. |
widgets.dual | string[] | Tool names that declare both templates. |
appOnlyWidgets | string[] | Widget tools with no text fallback (hidden from the model). |
hasWidgets | boolean | Whether any widget tools were found. |
widgetUsage | WidgetUsage | undefined | The passed-in widget usage scan, if any. |
connectionFacts | ConnectionFacts | undefined | The passed-in connection facts, if any. |
unknownDimensions | string[] | Dimensions that couldn’t be determined (e.g. widget HTML not yet fetched). Non-empty means the verdict may be unknown. |
Example
evaluateHostCompat()
Evaluates a server’s requirements against a single host profile and returns aHostCompatReport.
Parameters
| Parameter | Type | Description |
|---|---|---|
requirements | ServerRequirements | Output of deriveServerRequirements. |
profile | HostCompatProfile | A host capability profile describing what the host supports. |
Returns: HostCompatReport
| Property | Type | Description |
|---|---|---|
hostId | string | Profile identifier (e.g. "claude", "chatgpt"). |
hostLabel | string | Human-readable host name. |
verdict | CompatVerdict | "works" | "degraded" | "blocked" | "unknown" |
provenance | CompatProvenance | Confidence level of the overall report. |
lanes.apps | CompatLaneVerdict | Apps-lane verdict (widget rendering + capability gaps). |
lanes.server | CompatLaneVerdict | Server-lane verdict (protocol version compatibility). |
findings | CompatFinding[] | Individual findings, each with a lane, severity, title, detail, and optional remediation. |
CompatVerdict
| Value | Meaning |
|---|---|
"works" | No blockers or degraded findings. |
"degraded" | Functional but with capability gaps or text fallbacks. |
"blocked" | App-only tools are unusable on this host. |
"unknown" | A required dimension couldn’t be determined. |
evaluateAllHosts()
Evaluates a server against multiple host profiles in one call.Parameters
| Parameter | Type | Description |
|---|---|---|
toolsData | HostCompatToolsInput | null | Tools list input. |
profiles | HostCompatProfile[] | Array of host profiles to evaluate against. |
options.widgetUsage | WidgetUsage | Widget capability scan results. |
options.connectionFacts | ConnectionFacts | Protocol version from connect time. |
Returns: HostCompatEvaluation
| Property | Type | Description |
|---|---|---|
requirements | ServerRequirements | Derived server requirements. |
reports | HostCompatReport[] | One report per profile, in the same order as profiles. |
Example
scanWidgetSource()
Scans widget HTML source to detect which MCP Apps capabilities the widget uses.Parameters
| Parameter | Type | Description |
|---|---|---|
html | string | Raw HTML of the widget (fetched from the MCP resource URI). |
Returns: WidgetUsage
A map from capability name to the list of tool names whose widgets use that capability. An empty object{} means the HTML was scanned and no capability usage was found — this is conclusive. undefined means the scan hasn’t run yet.
scanWidgetMeta()
Scans a tool’s_meta bag to detect widget bridge type and app-only status without fetching the HTML.
detectHostCompatBridgeFromMeta()
Detects which widget bridge protocol a tool uses from its_meta bag.
HostCompatBridge
| Value | Meaning |
|---|---|
NONE | Tool has no widget template. |
MCP_APPS | Tool declares an MCP Apps widget (_meta.ui.resourceUri). |
OPENAI_SDK | Tool declares an OpenAI Apps SDK template (openai/outputTemplate). |
OPENAI_SDK_AND_MCP_APPS | Tool declares both templates. |
Types
HostCompatProfile
Describes a host’s capabilities for evaluation purposes. Supply your own profiles or use the Inspector’s built-in catalog.| Property | Type | Description |
|---|---|---|
id | string | Unique identifier (e.g. "claude"). |
label | string | Human-readable name. |
provenance | CompatProvenance | Confidence level of the profile data. |
rendersMcpApps | boolean | Whether the host renders MCP Apps widgets. |
rendersOpenAiApps | boolean | Whether the host renders OpenAI Apps SDK widgets. |
supportedProtocolVersions | string[] | MCP protocol versions the host advertises. |
capabilities | Partial<Record<WidgetCapabilityNeed, boolean>> | Which widget capabilities the host supports. |
CompatProvenance
| Value | Meaning |
|---|---|
"probe" | Captured from a real host via DevTools or the inspector. |
"vendor-doc" | Verified from vendor documentation. |
"observed" | Stamped by a live widget render run. |
"assumed" | Best-effort — unverified. |
ConnectionFacts
| Property | Type | Description |
|---|---|---|
protocolVersion | string | MCP protocol version negotiated at connect time (e.g. "2025-11-25"). |
Related
- Compatibility destination — the Inspector UI powered by this engine
- Apps Conformance SDK — dynamic conformance testing
- Protocol Conformance SDK — MCP protocol checks

