Skip to content

Name the root command after the installed binary - #2998

Merged
SamMorrowDrums merged 1 commit into
github:mainfrom
plusky:fix/root-command-name
Aug 20, 2026
Merged

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

Conversation

@plusky

@plusky plusky commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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
@SamMorrowDrums
SamMorrowDrums merged commit 64a49f3 into github:main Aug 20, 2026
13 checks passed
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Aug 26, 2026
https://build.opensuse.org/request/show/1373670
by user pluskalm + anag_factory
Update github-mcp-server to 1.11.0.

Upstream highlights: per-call OAuth scope challenges (a tool invocation
requests only the permissions it actually needs), CORS preserved across the
OAuth discovery routes plus a new --authorization-server flag, atomic
parent/sub-issue creation including across repositories, and ETag conditional
requests in the REST transport with a client-scoped, byte-bounded response
cache.

Packaging changes:

* Dropped github-mcp-server-root-command-name.patch. Upstream merged it as
  github/github-mcp-server#2998 (after the v1.10.1 tag), so v1.11.0 already
  declares the cobra root command as "github-mcp-server" and the generated
  shell completions bind to the right command name without the patch. The
  patch file is removed from the package and the %install comment
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.

2 participants