-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Support specifying available and unavailable MCP servers in custom mode #4917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! I've left some inline comments on specific implementation details.
The main thing that stands out is that having both allowed and denied lists seems unnecessarily complex. A single exclusion list would be simpler - just let users uncheck the MCP servers they don't want for that mode. This would avoid the confusing precedence logic and make the UI more straightforward.
The i18n support looks good and the search functionality is a nice touch. With the simplification to a single list, this would be a solid addition to the custom modes feature.
thanks for reviewing @daniel-lxs The variable and translation names I used for the two lists when encoding might be a bit ambiguous. My bad.I would like to reiterate the original intention of the design The current implementation considers two scenarios: In my opinion, if only one list must be kept, it should be the "require list" rather than the "block list". mcp tools should be used as a means of "achieving goals" like system tools: On this basis, the custom mode in the marketplace can be generalized into a "custom agent": when users install the mode, in addition to adding a custom prompt, they will also install the dependent mcp server, which can better expand the capabilities of the custom mode. Therefore, if we think the current dual list is too complicated, perhaps we can just keep the require list, or make some adjustments to the UI (such as using tab to switch between require list/blocklist)? |
db38346 to
23ecea6
Compare
|
@daniel-lxs Another look? Thanks! |
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @qdaxb
I left a couple of suggestions, let me know what you think!
|
It'd be absolutely fantastic to have this feature merged. @qdaxb are you still interested in working on this? |
895f5ca to
1aa8274
Compare
- Add status: 'connected' to mock MCP server - Add proper config object with transport details - Update test snapshots to reflect connected MCP server state - Fixes failing tests after MCP server filtering implementation
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @qdaxb and sorry for the delay!
|
I think there might be an issue with the yaml generation. By checking and unchecking boxes a few times I got my yaml to look like this: What is the yaml supposed to look like for this? |
- Updated schema to accept { mcp: { included: [...] } } directly as a GroupEntry
- Modified McpSelector to create the direct object format instead of tuple
- Updated getGroupName and getGroupOptions helpers to handle the new format
- Updated MCP server section to properly extract included list from both formats
This resolves the nested array issue in YAML generation when toggling MCP
checkbox and selecting specific servers. The YAML now correctly generates:
- mcp:
included: [...]
Instead of the previous nested structure.
- Fixed useEffect to properly detect MCP object format { mcp: { included: [...] } }
- Fixed empty selection behavior to enable all MCP servers instead of disabling MCP
- Removed tuple format handling since this feature hasn't been released yet
- Simplified code to only handle the new object format for MCP configuration
- Removed unused GroupOptions import
When no specific servers are selected, MCP is added as a string (enables all servers).
When specific servers are selected, MCP is added as an object with the included list.
This ensures the MCP selector properly loads configurations and maintains
the expected behavior where empty selection means all servers are enabled.
|
hey is this planned on being merged? |
|
Proposing to close this PR and follow up with a version that stabilizes the schema. Two blocking issues remain:
groups:
- read
- edit
- command
- - mcp
- mcp:
included:
- github
- context7
- mcp:
included:
- github
- context7Touchpoint: packages/types/src/mode.ts (groupEntrySchema)
Once these are addressed with a stable, canonical output and explicit empty semantics, we can proceed on a cleaner foundation. |

Related GitHub Issue
Discussion: #639
Closes: #5346
Description
Added whitelist and blacklist lists. When sending an MCP prompt, the system will read the MCP server list configured for the current mode, add or filter MCP servers based on the whitelist/blacklist, and then assemble the prompt. If both lists are empty, all MCP servers will be used.
Test Procedure
Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Documentation Updates
Additional Notes
Get in Touch
Important
Adds support for specifying available/unavailable MCP servers in custom mode, with UI and logic updates for server selection.
McpSelectorcomponent inMcpSelector.tsxfor selecting MCP servers.ModesView.tsxto integrateMcpSelectorfor custom modes.getMcpServersSection()inmcp-servers.tsto filter servers based on whitelist/blacklist.mcp-servers.ts.add-custom-instructions.spec.tsandsystem-prompt.spec.tsto reflect new server selection logic.This description was created by
for 7e92618. You can customize this summary. It will automatically update as commits are pushed.