Skip to content

Name the root command after the installed binary - #2998

Open
plusky wants to merge 1 commit into
github:mainfrom
plusky:fix/root-command-name
Open

Name the root command after the installed binary#2998
plusky wants to merge 1 commit into
github:mainfrom
plusky:fix/root-command-name

Conversation

@plusky

@plusky plusky commented Aug 3, 2026

Copy link
Copy Markdown

The cobra root command is declared as Use: "server", but the binary is built and distributed as github-mcp-server. That mismatch has two user-visible consequences.

Shell completions never fire. github-mcp-server completion bash emits a dispatcher keyed on server:

$ github-mcp-server completion bash | grep -E "^(complete|__start)" 
__start_server()
complete -o default -F __start_server server

Installed as the completion file for github-mcp-server (which is how a distribution package ships it), none of it ever runs — the registration binds to a command name that is not on the user's PATH. The same applies to zsh (#compdef server) and fish.

--help names a command that does not exist:

$ github-mcp-server --help
...
Usage:
  server [command]

This changes the root command's Use to match the binary. After the change:

$ github-mcp-server completion bash | grep -E "^complete"
complete -o default -F __start_github-mcp-server github-mcp-server
$ github-mcp-server completion zsh | head -1
#compdef github-mcp-server

cmd/mcpcurl already does this correctly (Use: "mcpcurl"), so this only brings the server in line with its sibling. Nothing else in the tree refers to the root command by name and no test asserts it.

Found while packaging github-mcp-server for openSUSE, where the broken completions would otherwise have to be shipped or dropped.

The cobra root command is declared as "server", but the binary is built and
distributed as "github-mcp-server". Two user-visible consequences:

  * "github-mcp-server completion <shell>" emits a completion dispatcher
    keyed on "server" (_server, __start_server, ...). Installed as
    completions for github-mcp-server they never fire, because the function
    names and the final "complete ... server" registration refer to a
    command that is not on the user's PATH.

  * "--help" prints "Usage: server [command]", naming a command that does
    not exist.

Name the root command after the binary. cmd/mcpcurl already does this
correctly (Use: "mcpcurl"). Nothing else in the tree refers to the root
command by name, and no test asserts it.
@plusky
plusky requested a review from a team as a code owner August 3, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant