Skip to content

[backport] Remove show_ui parameter, centralize show/defer decision (upstream main) #17

Description

@gastrodon

Summary

Fixes a fundamental contradiction in MCP Apps: show_ui=false caused the server to execute a PR/issue creation up-front, but the host still rendered the MCP App form (because it renders for any tool carrying _meta.ui.resourceUri). The result was a form shown on top of an already-completed action.

Fix has two parts:

  1. UI Views driven by result: completedToolResult() helper checks the actual tool result from the host; write Views show success card when the result shows a completed action (not a deferral sentinel), so the form is only rendered while the action is genuinely pending
  2. Remove show_ui entirely: Drop the parameter from create_pull_request and issue_write, remove the form-param allowlist entry, delete now-unused ConditionalSchemaPropertyDescriptions, stripUIOnlySchemaProperties, and uiOnlySchemaProperties machinery in pkg/inventory
  3. Centralize in ui_capability.go: Extract shared shouldDeferToForm(ctx, deps, req, args, formParams) and hasNonFormParams(args, formParams) replacing three near-identical per-tool functions

Upstream reference

Fork conflict

Mild note. The fork is at v1.4.0 which introduced show_ui (PR github#2601). This backport removes it. The fork's custom tools (issue_graph, set_project_item_status, add_issue_to_project) don't use MCP Apps UI, so no conflict at the tool level — but any caller relying on show_ui behavior on issue_write or create_pull_request will see the parameter silently ignored.

Context

show_ui was broken by design: the MCP Apps 2026-01-26 spec has no per-call opt-out of rendering — the host renders whenever _meta.ui.resourceUri is present. The fix removes the misleading parameter and ensures the View state machine is driven by the actual tool result, not in-app form state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backportBackport from upstreambugSomething isn't workingno-opFork already has equivalent functionality

    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