Skip to main content
Glama
MCP Browser Tabs Server

MCP Browser Tabs Server

by kazuph

MCP 浏览器标签页

用于检索和管理 Chrome 浏览器标签页信息的模型上下文协议服务器。这使得 Claude Desktop(或任何 MCP 客户端)能够获取当前打开的 Chrome 标签页信息并进行控制。

快速入门(针对用户)

要将此工具与 Claude Desktop 一起使用,只需将以下内容添加到您的 Claude Desktop 配置( ~/Library/Application Support/Claude/claude_desktop_config.json )中:

{
  "tools": {
    "browser-tabs": {
      "command": "npx",
      "args": ["-y", "@kazuph/mcp-browser-tabs"]
    }
  }
}

这将在需要时自动下载并运行该工具的最新版本。

所需设置

  1. 启用 Chrome 的辅助功能:

    • 打开系统设置

    • 前往“隐私和安全”>“辅助功能”

    • 点击“+”按钮

    • 从“应用程序”文件夹添加 Google Chrome

    • 打开 Chrome 的开关

AppleScript 需要此辅助功能设置才能与 Chrome 标签进行交互。

Related MCP server: chrome-agent-bridge

对于开发人员

以下部分适用于那些想要开发或修改该工具的人。

先决条件

  • Node.js 18+

  • macOS(用于 AppleScript 操作)

  • 谷歌浏览器

  • Claude Desktop(从https://claude.ai/desktop安装)

  • tsx(通过npm install -g tsx )

安装

git clone https://github.com/kazuph/mcp-browser-tabs.git
cd mcp-browser-tabs
npm install
npm run build

可用工具

  • get_tabs :从 Google Chrome 浏览器中检索所有打开的标签页,返回其标题和网址。标签页按窗口分组,并以“窗口 1-1”(窗口 1,标签页 1)的格式显示。

  • close_tab :使用窗口和标签索引关闭 Google Chrome 中的特定标签。

    • 参数:

      • windowIndex:窗口编号(从1开始)

      • tabIndex:窗口内的标签编号(从1开始)

    • 注意:关闭多个标签页时,请从索引号最高的标签页开始操作,以避免索引偏移。关闭标签页后,请使用 get_tabs 确认更改。

笔记

  • 由于依赖于 AppleScript,此工具仅适用于 macOS。

  • 需要安装并运行 Google Chrome。

  • 必须授予 Chrome 可访问权限。

执照

MIT 许可证 - 详情请参阅许可证文件

Available Tools

4 tools
activate_tab_by_idA

🔥 PREFERRED METHOD: Activate (focus) a specific tab in Google Chrome using its unique tab ID. Brings the tab to the front and makes it active. Extract the Tab ID from [Tab ID: 1234567890] in get_tabs output.

Inputs: tabId (required).

close_tabA

⚠️ LEGACY DANGER: Close a specific tab using window/tab index. HIGH RISK of closing wrong tabs due to index shifting when tabs are reordered/closed. STRONGLY DEPRECATED: Use close_tab_by_id instead. Only use if Tab ID is unavailable.

Inputs: tabIndex (required), windowIndex (required).

close_tab_by_idA

🔥 PREFERRED METHOD: Close a specific tab in Google Chrome using its unique tab ID. IMMUNE to tab reordering, window changes, and index shifting. Extract the Tab ID from [Tab ID: 1234567890] in get_tabs output. Example: if tab shows '[Tab ID: 1594670961]', use tabId: 1594670961

Inputs: tabId (required).

get_tabsA

Get all open tabs from Google Chrome browser with unique tab IDs. Each tab has a stable, unique ID that persists across browser operations. Output shows both display format (1-1, 1-2) and Tab ID [Tab ID: 1234567890] for each tab. ALWAYS use the Tab ID number for reliable operations.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: get_tabs retrieves tab information, activate_tab_by_id focuses a tab, close_tab_by_id closes a tab reliably, and close_tab serves as a deprecated fallback. The descriptions explicitly differentiate between preferred and legacy methods, eliminating any ambiguity in tool selection.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun or verb_noun_by_id pattern using snake_case (e.g., get_tabs, activate_tab_by_id, close_tab_by_id, close_tab). This uniformity makes the tool set predictable and easy to understand at a glance.

    Tool Count5/5

    With 4 tools, this server is well-scoped for managing browser tabs, covering essential operations: retrieving tabs, activating them, and closing them (with both reliable and deprecated methods). The count is efficient without being overly sparse or bloated.

    Completeness4/5

    The tool set covers the core CRUD-like operations for browser tab management: get (list), activate (update focus), and close (delete). A minor gap exists in creating or opening new tabs, but the domain is focused on existing tab manipulation, and agents can work around this by using external methods if needed.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      MCP server for agent interaction with user-approved Google Chrome tabs, enabling tab listing/control, navigation, clicking, filling, snapshots, and screenshots via a local authenticated bridge.
      100
      4
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to control real Chrome tabs in existing profiles, supporting navigation, interaction, screenshots, and console/network inspection across multiple Chrome instances.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables local control of existing Chrome/Chromium browser tabs through MCP, including tab management, navigation, content reading, screenshots, and page interaction.
      Apache 2.0