Skip to content

Only show the Apps tab/screen when the server exposes MCP App tools #1450

@cliffhall

Description

@cliffhall

Background

The Apps tab is currently always present in the navigation, even when the connected server exposes no MCP App tools. In that case the Apps screen is empty/unusable, which is confusing — the tab should only appear when there's something to show.

The pieces needed already exist in clients/web/src/components/views/InspectorView/InspectorView.tsx:

  • appTools is already computed by filtering the tool list with isAppTool (from @inspector/core/mcp/apps.js, which detects _meta.ui.resourceUri):
    const appTools = useMemo<Tool[]>(() => tools.filter((t) => { try { return isAppTool(t); } catch { return false; } }), [tools]);
  • ALL_TABS unconditionally includes "Apps", and availableTabs only removes Network for stdio:
    const availableTabs = useMemo<string[]>(() => {
      ...
      return isStdio ? ALL_TABS.filter((t) => t !== NETWORK_TAB) : ALL_TABS;
    }, [...]);

Scope

  • Gate the "Apps" tab on appTools.length > 0: exclude it from availableTabs when the current tool list contains no MCP App tools. (Compute appTools before availableTabs, or inline the check, so availableTabs can depend on it.)
  • The tab should appear/disappear reactively as the tool list changes (e.g. after a tools/list_changed refresh or switching servers).
  • Existing fallback logic already redirects activeTab to Servers when the selected tab isn't in availableTabs, so a user sitting on Apps when it disappears lands somewhere valid — verify this still holds.
  • Consider the "sandbox unavailable" state: today the Apps screen renders an "MCP Apps are unavailable" message. Decide whether the tab should still be hidden when there are app tools but no sandbox — recommended: keep showing the tab when app tools exist (so the unavailable message is reachable), and only hide it when there are zero app tools.

Acceptance criteria

  • When the connected server exposes no MCP App tools, the Apps tab is not shown and its screen is not reachable.
  • When the server exposes one or more MCP App tools, the Apps tab appears as today.
  • The tab updates live as the tool list changes (list-changed refresh, server switch).
  • No regression to the existing activeTab-fallback behavior.
  • Unit tests cover both states (no app tools → no Apps tab; with app tools → Apps tab present); npm run validate, test:integration, and test:storybook pass.

References

  • clients/web/src/components/views/InspectorView/InspectorView.tsx (ALL_TABS, availableTabs, appTools)
  • core/mcp/apps.ts (isAppTool)
  • clients/web/src/components/screens/AppsScreen/AppsScreen.tsx

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions