Repository navigation
Grant an MCP server to several bots from its edit dialog - #313
Merged
Merged
Conversation
The edit dialog lists the bots with a checkbox each: ticked when a bot has all of the server's tools, partly when it has some. Saving grants or clears the server's current tools for the bots that changed, the same way the bot editor's server checkbox does.
regnull
reviewed
Nov 3, 2026
regnull
left a comment
Owner
There was a problem hiding this comment.
LGTM. Risk 3. CI is green and the merge state is CLEAN at e1a34ff.
Musts: none.
Authorization: this is frontend-only. Each grant goes through the existing PATCH /bots/{id} with only tool_names and approval_tools (exclude_unset), and the server's _validate_tools checks it. There's no new endpoint and no new permission surface; OpenBot has one operator, and bots have no per-user ownership. Revoking works: unticking calls setGroup(..., false), which also drops the matching approval_tools. Grants are still bot.tool_names, so nothing needs migrating. MCP credentials stay on the server config and aren't copied per bot.
Shoulds
SettingsPage.tsxMcpServerDialogsave: the bot PATCHes run one after another beforeupdateMcpServer. If one fails midway, some bots are updated, the server edit isn't saved, and the error doesn't say which bots changed. List what was applied, or save the server first.- The grant list shows every bot, including CLI-provider bots (#312), which can't use MCP tools. Hide them or label them.
Verified
- It merges with #312 and main with no conflicts.
- vitest on SettingsPage, toolGroups and BotEditorPage passed 16/16 (Node 22).
tsc -bis clean.
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 #239.
The MCP server's edit dialog now lists the bots with a checkbox each. It is ticked when a bot has all of the server's tools and shows a dash with "n of m" when it has some, like the server checkbox in the bot editor. Save grants or clears the server's tools for the bots that were ticked or unticked in the dialog and leaves the others alone; clearing also drops their approvals, as in the bot editor.
toggleGroupnow goes through a newsetGroup(sel, names, on), which the dialog uses.One limit: grants are tool names, so a tick grants the tools the server has now. Tools it adds later still have to be granted in the bot editor, and a server that isn't connected has no tools to grant; the dialog says so instead of listing the bots.
Testing
SettingsPage.test.tsx(the three states, saving only the changed bots with approvals dropped; the hint for a server without tools and no list when adding a server) and one forsetGroup.typecheck,lintandtestpass, exceptelectron/main.test.ts, which needsbashon PATH.tests/mcp_stub_server.pyconnected: ticked two bots in the dialog, saved, and both had all three tools with their other tools kept; the bot with one of the three showed "1 of 3". Screenshot below.