Name the root command after the installed binary - #2998
Open
plusky wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cobra root command is declared as
Use: "server", but the binary is built and distributed asgithub-mcp-server. That mismatch has two user-visible consequences.Shell completions never fire.
github-mcp-server completion bashemits a dispatcher keyed onserver: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.--helpnames a command that does not exist:This changes the root command's
Useto match the binary. After the change:cmd/mcpcurlalready 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.