-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add option for allowed MCPs #5024
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
|
This PR is also trying to achieve this #4917, although I requested some changes since having two separate list seems redundant. But so far I think this cleaner approach might be better. |
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.
This looks really good!
Oh I didn't see that one! I agree that the two separate lists is probably a little much. One nice thing in the other PR though is that it filters the other MCP servers out of the prompt. |
|
@cursoragent can you also make sure that excluded MCP servers don't show up in the system prompt? |
|
Hey I've also been working on a comprehensive implementation of a similar functionality in my PR #5364 that includes additional features and UI. Would be great if we combine forces on this effort |
A new
allowedMcpServersoption was added to the mode configuration, enabling restrictions on MCP server access.groupOptionsSchemainpackages/types/src/mode.tswas updated to include an optionalallowedMcpServersarray of strings.McpServerRestrictionErrorclass was introduced insrc/shared/modes.tsto provide specific error messages when restrictions are violated.isToolAllowedForModefunction insrc/shared/modes.tswas modified to enforce these restrictions foruse_mcp_toolandaccess_mcp_resourcecalls.server_nameis provided and not in the allowed list, anMcpServerRestrictionErroris thrown.server_name(e.g., partial streaming requests) are permitted.src/shared/__tests__/modes.spec.tsto validate the restriction logic, covering permitted/rejected servers, unrestricted modes, and error messages.src/core/config/__tests__/ModeConfig.spec.tsto ensure theallowedMcpServersfield is correctly parsed and validated.This change provides granular control over which MCP servers a mode can interact with.
Important
Adds
allowedMcpServersoption to restrict MCP server access in modes, with error handling and comprehensive tests.allowedMcpServersoption togroupOptionsSchemainmode.tsfor restricting MCP server access.isToolAllowedForModeinmodes.tsto enforce MCP server restrictions, throwingMcpServerRestrictionErrorfor disallowed servers.server_name(e.g., partial streaming requests).McpServerRestrictionErrorinmodes.tsfor specific error messaging when MCP server restrictions are violated.modes.spec.tsto validate MCP server restriction logic, including allowed/rejected servers and error messages.ModeConfig.spec.tsforallowedMcpServersfield parsing and validation.This description was created by
for cecacba. You can customize this summary. It will automatically update as commits are pushed.