Summary
resolveServerMode('auto', clientSupportsUi) is currently hardcoded to return ServerMode.DEFAULT regardless of the client's UI capability. Re-enable capability-driven auto-detection so MCP Apps clients automatically receive apps-mode tools without needing ?ui=apps or UI_MODE=apps.
Current state
src/types.ts:442-449:
```ts
export function resolveServerMode(option: ServerModeOption, clientSupportsUi: boolean): ServerMode {
if (option !== 'auto') return option;
// TODO: re-enable auto-detect from client capabilities. Disabled for the
// initial release so APPS mode is opt-in via `?ui=apps` or `UI_MODE=apps`.
// return clientSupportsUi ? ServerMode.APPS : ServerMode.DEFAULT;
void clientSupportsUi;
return ServerMode.DEFAULT;
}
```
The intended behavior is in the commented line — resolve to APPS when the client advertises MCP Apps UI support, DEFAULT otherwise.
What needs to happen
- Restore the capability-driven branch in
resolveServerMode (uncomment the return, drop the void discard).
- Re-enable the two skipped integration tests in
tests/integration/suite.ts:2533, 2547:
auto mode: client advertising UI capability receives apps-mode tools with widget metadata
auto mode: client without UI capability receives default-mode tools without widget metadata
- Drop the
it.skip and the explanatory TODO above them.
- Verify on
apify-mcp-server-internal (hosted server) that no callers depend on the current auto → default fallback before flipping the switch.
Why
Apps-mode opt-in is currently manual. Once we're confident apps mode is stable for the broad client population, auto-detection is the right default — clients that advertise UI capability get widgets, clients that don't get plain tools, no configuration required.
Context
Summary
resolveServerMode('auto', clientSupportsUi)is currently hardcoded to returnServerMode.DEFAULTregardless of the client's UI capability. Re-enable capability-driven auto-detection so MCP Apps clients automatically receive apps-mode tools without needing?ui=appsorUI_MODE=apps.Current state
src/types.ts:442-449:```ts
export function resolveServerMode(option: ServerModeOption, clientSupportsUi: boolean): ServerMode {
if (option !== 'auto') return option;
// TODO: re-enable auto-detect from client capabilities. Disabled for the
// initial release so APPS mode is opt-in via `?ui=apps` or `UI_MODE=apps`.
// return clientSupportsUi ? ServerMode.APPS : ServerMode.DEFAULT;
void clientSupportsUi;
return ServerMode.DEFAULT;
}
```
The intended behavior is in the commented line — resolve to
APPSwhen the client advertises MCP Apps UI support,DEFAULTotherwise.What needs to happen
resolveServerMode(uncomment the return, drop thevoiddiscard).tests/integration/suite.ts:2533, 2547:auto mode: client advertising UI capability receives apps-mode tools with widget metadataauto mode: client without UI capability receives default-mode tools without widget metadatait.skipand the explanatory TODO above them.apify-mcp-server-internal(hosted server) that no callers depend on the currentauto → defaultfallback before flipping the switch.Why
Apps-mode opt-in is currently manual. Once we're confident apps mode is stable for the broad client population, auto-detection is the right default — clients that advertise UI capability get widgets, clients that don't get plain tools, no configuration required.
Context