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
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Aug 11, 2026
https://build.opensuse.org/request/show/1370576
by user pluskalm + anag_factory
Update to 1.9.0: search_issues is semantic by default, issue_read now reports the pull requests that close an issue, issue types can be cleared, projects_write gained batched update_project_items plus singular Issue Field updates, a new non-default find_duplicate tool behind the duplicate_detection flag, list_label ordered by issue count, and create_or_update_file's content parameter is documented as plain text. Vendored Go dependency set is unchanged from 1.8.0 (identical go.mod/go.sum, 41 modules, all MIT/BSD-3-Clause/Apache-2.0), so License: MIT still holds. github-mcp-server-root-command-name.patch is kept - upstream PR gh#github/github-mcp-server#2998 is still open and the cobra root command is still named 'server'. Built locally for openSUSE_Tumbleweed/aarch64: green, rpmlint 0 errors
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