Skip to content

Grant an MCP server to several bots from its edit dialog - #313

Merged
regnull merged 2 commits into
regnull:mainfrom
bymarvin:feat/mcp-bots-checklist
Nov 3, 2026
Merged

regnull merged 2 commits into
regnull:mainfrom
bymarvin:feat/mcp-bots-checklist

Conversation

@bymarvin

Copy link
Copy Markdown
Collaborator

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. toggleGroup now goes through a new setGroup(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

  • Two tests in 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 for setGroup. typecheck, lint and test pass, except electron/main.test.ts, which needs bash on PATH.
  • A local instance with the stub MCP server from tests/mcp_stub_server.py connected: 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.

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 regnull left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. SettingsPage.tsx McpServerDialog save: the bot PATCHes run one after another before updateMcpServer. 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.
  2. 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 -b is clean.

@regnull
regnull merged commit b67aeac into regnull:main Nov 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better way to enable MCPs per bot

2 participants