fix(cli): filter blocked MCP servers case-insensitively#25936
fix(cli): filter blocked MCP servers case-insensitively#25936spencer426 wants to merge 2 commits into
Conversation
…plication Fixes a bug where disconnected MCP servers were listed twice in '/mcp list' (once as 'Disconnected' and once as 'Blocked') due to a strict string equality check that failed when extension server names had different casing or trailing whitespace compared to user configuration. Updated the filter in 'McpStatus.tsx' to use '.trim().toLowerCase()'.
|
Hi @spencer426, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello, 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 a UI bug where MCP servers were being duplicated in the list view. By normalizing server names using trim and lowercase operations during the filtering process, the application now correctly identifies and hides blocked servers even when there are minor formatting differences between the configuration and the server registration. Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the McpStatus component to ensure that blocked MCP servers are filtered using case-insensitive comparison and by ignoring leading or trailing whitespace. A corresponding test case has been added to verify this behavior, along with updated snapshots. I have no feedback to provide.
|
Size Change: +38 B (0%) Total Size: 33.7 MB
ℹ️ View Unchanged
|
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
|
Closing this pull request as it does not have an associated tracked issue linked, and there has been no progress since the nudge. |
Summary
Fixes a bug where disconnected MCP servers were listed twice in
/mcp list(once as 'Disconnected' and once as 'Blocked') due to a strict string equality check that failed when extension server names had different casing or trailing whitespace compared to user configuration. Updated the filter inMcpStatus.tsxto use.trim().toLowerCase().Details
The logic in
McpStatus.tsxthat removes blocked servers from the main list relies on a strict string equality check (blockedServer.name === serverName). If an extension registers a server with a slight casing difference or trailing whitespace compared to its name in the blocked configuration, the filter fails to remove it from the main list. Because it isn't "Connected" or "Connecting", it defaults to "Disconnected" in the main UI rendering block before being rendered again by the Blocked list logic.Related Issues
Fixes https://github.com/google-gemini/maintainers-gemini-cli/issues/1634
How to Validate
npm run test -w @google/gemini-cli -- src/ui/components/views/McpStatus.test.tsx/mcp list. The server should only appear once under "Blocked".Pre-Merge Checklist