Repository navigation
Let /mcp disable and /mcp remove take a name with * that applies to every server it fits - #4227
Merged
Merged
Conversation
…very server it fits (SERVERS-19) A `*` in the argument of `/mcp disable` or `/mcp remove` stands for any run of characters, so `/mcp remove brave-tabs*` removes brave-tabs-manage and brave-tabs-read, and `/mcp disable brave-*` turns off every server whose name starts with `brave-`. The pattern is matched against the aliases the session runs, the settings request and, for remove, the state directory declares. Each alias it names is handled as if it had been typed alone, in alphabetical order, through the same two program calls as before, and a failure for one is said and does not stop the others. A pattern that fits nothing says so and changes nothing. A word with a `*` and a character no alias has is not a pattern. The pattern is never passed to the program. bravebot_config::mcp::is_alias_pattern and alias_matches hold the grammar and the match. SERVERS-19 states the behaviour and names the tests, the website page and the changelog describe it, and the catalog has the no-match sentence and the longer usage and hint lines, with the French translations. Closes brave#4225
netzenbot-reviewer
approved these changes
Nov 15, 2026
The CI step that holds clippy::string_slice to the base failed: the matcher added a site in crates/config/src/mcp.rs by slicing `rest` after a `find`. `split_once` takes the text after the first occurrence of the part without slicing, so the count is back to the base's and the matching is unchanged. Part of brave#4225
netzenbot-reviewer
approved these changes
Nov 15, 2026
bbondy
approved these changes
Nov 15, 2026
This was referenced Nov 15, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4225
User impact:
/mcp remove brave-tabs*removes every server whose name starts withbrave-tabs, and/mcp disable brave-*turns off every server whose name starts withbrave-.Decisions to confirm
*stands for any run of characters, anywhere in the word, and a word with a*and a character no alias has is refused. Instead: a prefix-only*at the end. Why: the issue's example is a prefix, and a general rule costs the same code and also covers*-read. Commit: Let /mcp disable and /mcp remove take a name with * that applies to every server it fits. To reverse: restrictis_alias_patternandalias_matchesincrates/config/src/mcp.rs.removematches the aliases the session holds, the settings request and the state directory declares, anddisablematches the ones the session holds and the settings request. Instead: only what the session holds. Why:remove <alias>works on a declaration that no session holds, so a pattern does too. Commit: same. To reverse: drop the declared aliases fromremove_matching.remove_matchingon a failed removal.The problem
#4225
/mcp removeand/mcp disabletake one alias. Removingbrave-tabs-manageandbrave-tabs-readtakes two commands, and a person with several servers under one prefix types one command for each.Reproduce
brave-tabs-manage,brave-tabs-readandbrave-page-read./mcp remove brave-tabs*.Before this change the word
brave-tabs*is refused as a word that is no alias. After it, bothbrave-tabs-servers are disabled and removed andbrave-page-readkeeps running.cargo test -p bravebot-tui mcp_commandcovers it.The fix
#4225.
/mcp disableand/mcp removeaccept a word made of alias characters and at least one*. Each alias it fits is handled as if it had been typed alone, in alphabetical order, and a pattern that fits nothing says so and changes nothing. The pattern is never passed to the program. SERVERS-19 states it, and the website page, the changelog and the catalog (en-US and fr) describe it.Test plan
BRAVEBOT_ALLOW_UNCONFIGURED_BUILD=1 cargo test -p bravebot-tui mcp_command --locked: passedBRAVEBOT_ALLOW_UNCONFIGURED_BUILD=1 cargo test -p bravebot-config pattern --locked: passedBRAVEBOT_ALLOW_UNCONFIGURED_BUILD=1 cargo clippy -p bravebot-config -p bravebot-tui --all-targets --locked -- -D warnings: passedpython3 contrib/check-lint-increase.py: failed on the first commit (one newclippy::string_slicesite inalias_matches), passed after the second commita_pattern_names_the_aliases_whose_spelling_fits_around_its_stars: rejects a match that ignores the text after the last*; demonstrated by replacing the end check with|| true, which fails it. The demonstration ran before the second commit, which changed the matcher's middle-text step and not the end checka_pattern_has_a_star_and_only_the_characters_of_an_alias: rejects treating--help,../*or a word with a space as a pattern; reasoned onlyremoving_by_a_pattern_removes_each_server_it_names_and_no_otheranda_pattern_removal_that_fails_for_one_server_still_removes_the_others: reject a removal that reachesbrave-page-reador stops at the first failure; reasoned onlydisabling_by_a_pattern_turns_off_each_server_it_names_and_no_other: rejects a disable that touches a server the pattern does not fit; reasoned onlymake check-affected: ran on the first commit only and stopped at the same lint check as CI. It was not run again on the head. CI covers the head.Docker gates skipped: host-only