Update mcp's list function to check for disablement.#21148
Update mcp's list function to check for disablement.#21148DavidAPierce merged 13 commits intomainfrom
Conversation
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 significantly enhances the Highlights
Changelog
Activity
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. 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly implements disablement checks for MCP servers in the list command, preventing connections to blocked or disabled servers. The changes are logical and include corresponding test updates. However, I've identified a significant performance issue where settings are loaded repeatedly within a loop, which should be addressed, aligning with the guideline to gather all settings first for initialization.
|
Size Change: +1.33 kB (+0.01%) Total Size: 26 MB
ℹ️ View Unchanged
|
|
If i follow the instructions in https://github.com/google-gemini/maintainers-gemini-cli/issues/1442 i get two MCPs in the list
|
…ngs instead of MergedSettings.

Summary
modified packages/cli/src/commands/mcp/list.ts to integrate the canLoadServer function which enforces mcp.excluded rules, as well as checking against mcp.allowed and the user's manual enable/disable settings from McpServerEnablementManager.
Details
Imported canLoadServer and McpServerEnablementManager into list.ts.
Updated the getServerStatus function to consult canLoadServer before attempting testMCPConnection.
Added string enums BLOCKED and DISABLED to the return type MCPServerStatus of getServerStatus to accurately represent servers that shouldn't be loaded without actually connecting to them.
Updated listMcpServers to correctly display the output string using chalk colors for Blocked and Disabled states.
Adjusted packages/cli/src/commands/mcp/list.test.ts to mock the necessary Storage parameters and cover the new Blocked functionality explicitly. The test suite passes fully without attempting RCE on excluded servers.
Related Issues
Fixes https://github.com/google-gemini/maintainers-gemini-cli/issues/1442