412
413
private _buildTopLevel(id: string, serverName: string, state: McpServerState, enabled: boolean): McpServerCustomization {
415
>
// Per AHP spec, `mcpApp` is a static capability declaration —
416
>
// "SHOULD be present whenever the server can host Apps". We
417
>
// proxy every MCP server uniformly, so advertise the host's
418
>
// capability set regardless of runtime `state`. Clients gate
419
>
// rendering on `state.kind === Ready` + `channel` themselves.
420
>
const mcpApp = this._options.capabilities
421
? { capabilities: this._options.capabilities }
423
>
return {
424
>
type: CustomizationType.McpServer,
425
>
id,
426
>
uri: this._mintTopLevelId(serverName),
427
>
name: serverName,
428
>
enabled: getEffectiveMcpServerCustomizations(this._stateManager.getSessionState(this._options.sessionUri.toString())?.customizations ?? [])
429
>
.find(customization => customization.id === id)?.enabled ?? enabled,
430
>
state,
431
>
channel,
432
>
mcpApp,
433
>
};
434
>
}
435
}
436