fix: correct mcp client name and version#3487
fix: correct mcp client name and version#3487seuros wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @seuros, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request addresses an issue where the MCP client was reporting a static, outdated version. It updates the client's reported name and dynamically fetches its version from the package configuration, ensuring accurate client identification.
Highlights
- Client Identification: The MCP client's reported name has been simplified from
gemini-cli-mcp-clienttogemini. - Dynamic Versioning: The hardcoded client version
0.0.1has been replaced with a dynamic lookup from thepackage.jsonfile, ensuring the client reports its actual package version.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request updates the MCP client to use a dynamic version from package.json instead of a hardcoded one, and also updates the client name. The change is straightforward, but there's a critical issue with the relative path used to import package.json, which may cause a runtime error or lead to using an incorrect version. I've suggested a fix for the path.
94a8b38 to
60fbba4
Compare
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request updates the MCP client to use the package version from package.json instead of a hardcoded version, and also renames the client. My review identifies a critical issue with how package.json is imported. The current relative path will break when the package is published and consumed as a dependency, causing it to read the version from the wrong package.json. I've provided a suggestion to correct the import path.
|
@gemini-code-assist review |
| const mcpClient = new Client({ | ||
| name: 'gemini-cli-mcp-client', | ||
| version: '0.0.1', | ||
| name: 'gemini', | ||
| version: pkg.version, |
There was a problem hiding this comment.
Using a hardcoded client name could lead to confusion or conflicts if multiple applications use the same name. Consider using a more specific name, potentially incorporating the application name or environment, to ensure uniqueness and easier identification in logs and monitoring systems.
Also, the version should be validated to ensure it is a valid semantic version.
There was a problem hiding this comment.
Code Review
The pull request updates the MCP client's name and version to use the package version. The client name is changed to 'gemini' and the version is dynamically pulled from the package.json file. A review comment suggests using a more specific client name to avoid potential confusion.
deeb237 to
184b29d
Compare
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request updates the MCP client to use the package version, improving consistency. The version string is now plumbed through the configuration, and all necessary call sites, including tests, have been updated. Additional unit tests and ensuring the version is used everywhere are recommended.
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request correctly addresses the issue of the MCP client sending a hardcoded name and version. The changes effectively plumb the CLI's package version down to the MCP client instantiation.
The implementation is consistent across the affected packages, and the necessary updates to tests and configuration parameters have been made. The use of getCliVersion with a fallback to 'unknown' is a robust approach.
I've reviewed the changes for correctness, security, and maintainability, and I don't see any issues of high or critical severity. The code appears solid and achieves the stated goal of the pull request.
NTaylorMullen
left a comment
There was a problem hiding this comment.
Looks like you have some merge conflicts as well. Feel free to @ me once done though and I can work on getting this merged!
|
@NTaylorMullen The build is ready for merge. |
|
@NTaylorMullen here you go |
|
@NTaylorMullen can you approve the build ? i would like to have this PR merged, i want to release few servers and i would appreciate if the version of version is detect so the server don't offer a feature that not supported. |
|
Hi, could you update again? I would like to get this change in. Sorry about the delay. |
|
@cornmander fixed. you can squash merge it. |
|
@cornmander @NTaylorMullen any issue on merging this ? |
09d8348 to
3b99406
Compare
540eb71 to
3a2a0a5
Compare
The mcp client now reports 'gemini' as its name and uses the actual CLI version instead of hardcoded '0.0.1' Changes: - Pass CLI version through config chain from gemini.tsx to MCP client - Update MCP client name from 'gemini-cli-mcp-client' to 'gemini' - Use dynamic version from getCliVersion() instead of hardcoded value - Update all test files to pass version parameter
|
I think this has been covered by some other changes. Please re-open if I'm wrong! Thanks for the contribution! |
This commit addresses several TODO comments and code issues across the codebase: 1. Fix ide-client.ts - Use CLI version instead of hardcoded '1.0.0' (issue google-gemini#3487) - Updated MCP client initialization to use process.env['CLI_VERSION'] - Consistent with pattern used in contentGenerator.ts - Affects both HTTP and stdio transport connections 2. Fix ide-server.ts - Clarify newContent parameter as optional - Changed TODO to clear documentation explaining why newContent is optional - Defaults to empty string to support creating new files or showing empty diffs 3. Fix task.ts - Add proper prompt_id handling (lines 810, 850) - Added promptId field to Task class - Generate unique prompt_id in constructor using task-${id}-${uuid} pattern - Now properly passes prompt_id to sendMessageStream calls - Follows same pattern as Turn class in core 4. Fix testing_utils.ts - Document MockTool duplication - Updated TODO to note similarity with core MockTool - Explains why a2a-server version is needed (mock function support) - Recommends future consolidation 5. Document stdin-context.test.ts sandbox limitation - Enhanced TODO with detailed root cause analysis - Explained stdin forwarding issue: test process → node process → container - Identified issue in sandbox.ts stdio handling - Provided potential fix approach All changes maintain backward compatibility and follow existing code patterns.
This change ensures that the IdeClient uses the actual version of the CLI when establishing a connection to the IDE companion extension. - Modified `IdeClient` to accept an optional version in `connect()`. - Updated `Config` to store and propagate the version to `IdeClient`. - Updated CLI configuration loader to fetch the actual version from `package.json` and pass it to the `Config`. - Added unit tests in `packages/core/src/config/config.test.ts` to verify the propagation of the version. Closes google-gemini#3487. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Resolves google-gemini#3487 - Import getVersion from utils/version.js - Replace hardcoded '1.0.0' with actual CLI version in HTTP connection - Replace hardcoded '1.0.0' with actual CLI version in stdio connection
The mcp client keeps sending the same version 0.0.1 since dawn of time.
This PR, use the package version to give gemini mcp client a version.