Skip to content

[plan] Add interactive MCP server selection with Huh forms #14017

@github-actions

Description

@github-actions

Objective

Enhance the gh aw mcp inspect command with interactive server selection using Huh forms, improving user experience when working with multiple MCP servers.

Context

Issue #14013 identified that while Huh forms are used in 8 CLI files, several commands like mcp inspect could benefit from enhanced interactivity. Currently, users must specify servers via command-line flags.

Approach

  1. Create selectMCPServer() function in pkg/cli/mcp_inspect.go
  2. Use huh.NewSelect() with server options
  3. Integrate with existing console.IsAccessibleMode() for accessibility
  4. Fall back to flag-based selection when --server is explicitly provided

Implementation Details

func selectMCPServer(servers []string) (string, error) {
    options := make([]huh.Option[string], len(servers))
    for i, server := range servers {
        options[i] = huh.NewOption(server, server)
    }
    
    var selected string
    form := huh.NewForm(
        huh.NewGroup(
            huh.NewSelect[string]().
                Title("Which MCP server would you like to inspect?").
                Options(options...).
                Value(&selected),
        ),
    ).WithAccessible(console.IsAccessibleMode())
    
    return selected, form.Run()
}

Files to Modify

  • Update: pkg/cli/mcp_inspect.go - Add interactive server selection
  • Update: pkg/cli/mcp_inspect_command.go - Wire up interactive mode

Acceptance Criteria

  • Interactive server selection when no --server flag provided
  • Accessibility mode support (ACCESSIBLE, NO_COLOR, TERM=dumb)
  • TTY detection - skip interactive prompt when output is piped
  • Command-line flag takes precedence over interactive prompt
  • Tests cover interactive and flag-based selection
    Related to Terminal Stylist Analysis: Console Output Patterns in gh-aw #14013

AI generated by Plan Command for #14013

  • expires on Feb 8, 2026, 1:01 AM UTC

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions