fix(mcp): drop -p shorthand on --port to avoid collision with global --profile - #9
Open
Millon15 wants to merge 1 commit into
Open
fix(mcp): drop -p shorthand on --port to avoid collision with global --profile#9Millon15 wants to merge 1 commit into
Millon15 wants to merge 1 commit into
Conversation
…--profile
`bbkt mcp` panicked at startup:
panic: unable to redefine 'p' shorthand in "mcp" flagset: it's already used for "port" flag
The persistent `--profile` flag (cmd/cli/root.go) and the mcp-local `--port`
flag (cmd/cli/mcp.go) both registered the `-p` shorthand. cobra's
mergePersistentFlags panics when it merges the global `-p` into the mcp
flagset, so every `bbkt mcp` invocation crashed before serving — MCP clients
(Claude Code/Desktop, Cursor) could never connect over stdio.
Drop the rarely-used `-p` shorthand from `--port`; the long `--port` still
works and stdio clients don't use it at all. `--profile -p` is unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
bbkt mcppanics immediately on startup and never serves:The persistent
--profileflag and themcp-local--portflag both claim the-pshorthand:cmd/cli/root.go—RootCmd.PersistentFlags().StringP("profile", "p", "", ...)cmd/cli/mcp.go—mcpCmd.Flags().IntVarP(&port, "port", "p", 0, ...)When cobra runs
mergePersistentFlags(viaInitDefaultHelpFlagat execute time), pflag panics because two flags in themcpflagset want-p. Onlymcpis affected — it's the sole subcommand defining its own-p— which is why the rest of the CLI works whilebbkt mcpalways crashes.Net effect: MCP clients (Claude Code/Desktop, Cursor, etc.) can never connect over stdio — the server process dies before the handshake, surfacing as a generic transport failure on the client side.
Fix
Drop the
-pshorthand from--port:--profile -p(global, documented in--helpexamples) is unchanged.--portkeeps its long form; stdio MCP clients don't use a port at all, and the HTTP-transport example already uses--port 8080(long form), so docs stay accurate.Verification
go build ./cmd/bbktpasses.🤖 Generated with Claude Code