Skip to content

[cli-consistency] Dead code: Unused NewMCPInspectCommand function in mcp_inspect.go #3765

@github-actions

Description

@github-actions

Issue Description

File: pkg/cli/mcp_inspect.go
Type: Dead code / Code cleanup
Priority: Low

Current Situation

The file pkg/cli/mcp_inspect.go contains two nearly identical functions for creating the MCP inspect command:

  1. NewMCPInspectCommand() at line 257 - Never used
  2. NewMCPInspectSubcommand() at line 532 - Actually used (referenced in pkg/cli/mcp.go:32)

Evidence

From pkg/cli/mcp.go:

cmd.AddCommand(NewMCPInspectSubcommand())  // Line 32 - This is the one actually used

The NewMCPInspectCommand() function is defined at line 257 but is never referenced anywhere in the codebase.

Impact

  • Low impact: The unused function doesn't affect functionality
  • Code maintenance: Having duplicate functions is confusing for developers
  • Binary size: Unused code slightly increases the binary size
  • Code clarity: Reduces codebase clarity

Suggested Fix

Remove the NewMCPInspectCommand() function (lines 257-320) since it's not being used. Keep only NewMCPInspectSubcommand() which is the active implementation.

Additional Context

Both functions have identical:

  • Short descriptions: "Inspect MCP servers and list available tools, resources, and roots"
  • Long descriptions (same examples and documentation)
  • Flag definitions

This appears to be leftover code from a refactoring where the command was moved from a top-level command to a subcommand under the mcp command.

AI generated by CLI Consistency Checker

Metadata

Metadata

Assignees

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