fix(cli,server): report correct binary name and server identity#90
Merged
Conversation
- Remove `#[command(name = "mcp-cli")]` from `Cli` so clap derives the binary name from argv[0] at runtime; fixes `--version` output and generated shell completions targeting the wrong name (issue #89) - Replace `Implementation::from_build_env()` in `get_info()` with a direct construction using `env!("CARGO_PKG_NAME")` / `env!("CARGO_PKG_VERSION")` so the MCP handshake reports `mcp-execution-server` instead of `rmcp` (issue #85)
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #90 +/- ##
=======================================
Coverage 88.96% 88.97%
=======================================
Files 33 33
Lines 7706 7708 +2
=======================================
+ Hits 6856 6858 +2
Misses 850 850
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Summary
#[command(name = "mcp-cli")]fromCliincrates/mcp-cli/src/cli.rsso clap derives the binary name from argv[0] at runtime — fixes--versionoutput and generated shell completions targeting the wrong nameImplementation::from_build_env()withImplementation::new(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"))incrates/mcp-server/src/service.rs— fixes MCP handshake reportingrmcp/1.5.0instead ofmcp-execution-server/<version>Closes #89, #85.
Test plan
cargo run -p mcp-execution-cli -- --versionoutputsmcp-execution-cli <version>cargo run -p mcp-execution-cli -- completions bash | head -1shows_mcp-execution-cli()cargo run -p mcp-execution-cli -- completions zsh | head -1shows#compdef mcp-execution-cli"serverInfo": {"name": "mcp-execution-server", "version": "<version>"}cargo nextest run --all-features --workspace)test_get_infonow asserts correct name and version viaenv!("CARGO_PKG_NAME")/env!("CARGO_PKG_VERSION")