Skip to content

feat: add Chrome tab group tools (create/update/add_tabs/close/list)#341

Open
gkrdl wants to merge 3 commits into
hangwin:masterfrom
gkrdl:feat/tab-groups
Open

feat: add Chrome tab group tools (create/update/add_tabs/close/list)#341
gkrdl wants to merge 3 commits into
hangwin:masterfrom
gkrdl:feat/tab-groups

Conversation

@gkrdl
Copy link
Copy Markdown

@gkrdl gkrdl commented May 4, 2026

Summary

Adds five tools that wrap the Chrome tabs.group / tabGroups APIs so MCP clients can organize their automation tabs into named, collapsed groups instead of leaving loose tabs in the user's daily window.

Tools added

Tool Args Purpose
chrome_tab_group_create tabIds, title?, color?, windowId? Create a new group from existing tabs. Returns groupId.
chrome_tab_group_update groupId, title?, color?, collapsed? Rename / recolor / collapse / expand a group.
chrome_tab_group_add_tabs groupId, tabIds Add more tabs to an existing group.
chrome_tab_group_close groupId Close all tabs in a group (group disappears when empty).
chrome_tab_group_list windowId?, color?, title?, collapsed? Enumerate groups (returns enriched entries with tabIds).

A new tabGroups permission has been added to the extension manifest.

Why this matters

Without these, an MCP client running multi-tab research (price comparison, multi-source lookup, etc.) leaves a pile of tabs in the user's main window, and the user has to close them one by one. With grouping, the client can:

  1. Open N tabs with `background: true`.
  2. `chrome_tab_group_create` → `chrome_tab_group_update { collapsed: true }` → only the group label shows in the tab bar.
  3. Extract data in parallel from each tab.
  4. `chrome_tab_group_close` → all tabs gone in one call.

End-user impact: their daily window stays clean during automation, and they can collapse/expand the group on their own to review what the agent is doing.

Verification

  • `pnpm build:shared`, `pnpm build:extension`, `pnpm build:native` all pass.
  • Built extension manifest confirmed to include `tabGroups` permission and the five new tool names.
  • Live test on macOS Chrome: opened 5 search-result tabs in `background: true`, called `chrome_tab_group_create` (got groupId), called `chrome_tab_group_update { collapsed: true }` (group collapsed in the tab bar without disturbing the active tab), called `chrome_javascript` against each grouped tab to extract data in parallel — all worked. The "active tab cannot be collapsed" Chrome quirk is documented in the schema.

Notes

  • The "active tab cannot be collapsed" restriction is a Chrome behavior, not an MCP one. The collapse pattern works as long as the tabs were opened with `background: true` (which is the recommended pattern for automation tabs anyway).
  • `chrome_tab_group_list` returns enriched entries (group metadata + tabIds in that group) so callers don't need a separate `chrome.tabs.query` round-trip.
  • The new permission requires the user to accept a prompt on extension reload.

gkrdl added 3 commits May 4, 2026 14:36
Adds five new MCP tools for managing Chrome tab groups:
- chrome_tab_group_create
- chrome_tab_group_update
- chrome_tab_group_add_tabs
- chrome_tab_group_close
- chrome_tab_group_list

Each tool's JSON schema is exposed via TOOL_SCHEMAS so MCP clients can
discover and invoke them without code changes on the native-server side.
Implements the chrome_tab_group_* tool family on the extension side using
chrome.tabs.group and chrome.tabGroups.update / .query / .get. Adds a new
tab-group.ts module with five handlers and registers them through the
existing browser tool barrel.

Also declares the "tabGroups" permission in the WXT manifest so Chrome
exposes the tabGroups API to the service worker. Without this, the new
handlers would throw at runtime even though chrome.tabs.group itself is
covered by the existing "tabs" permission.
Adds a new "Tab Grouping (5 tools)" section to both README.md and
README_zh.md so the chrome_tab_group_* tools are discoverable from the
project landing page.
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.

1 participant