KM

kazuph/mcp-browser-tabs

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

15 stars 8 forks 质量 64 趋势 25MIT

用于检索和管理 Chrome 浏览器标签信息的模拟上下文协议服务器。 这允许克洛德桌面(或任何MCP客户端)获取关于当前打开的Chrome的信息并进行控制.

概览

用于检索和管理 Chrome 浏览器标签信息的模拟上下文协议服务器。 这使得克洛德桌面(或任何MCP客户端)能够获取关于当前打开Chrome标签的信息并进行控制. 要使用克洛德桌面的这个工具,只需在克洛德桌面配置中添加以下内容(~/Library/应用程序支持/Claude/claude desktop config.json): 这将在需要时自动下载并运行该工具的最新版本. 1. 启用 Chrome 的无障碍: - 打开系统设置 - 去隐私和安全 > 无障碍 - 点击"+"按钮 - 从您的应用程序文件夹中添加 Google Chrome - 打开 Chrome 的切换 AppleScript与Chrome标签互动需要此无障碍设置. 以下各节为想开发或修改该工具的人. -Node.js 18+ - macOS (用于AppleScript操作) - Google Chrome - Claude桌面 (安装自 https://claude.)

概述(AI 翻译)

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

^ 快速启动( 对于用户)

要与 Claude Desktop 一起使用此工具,只需在您的 Claude 桌面配置中添加以下内容( [[T0] ):

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

需要设置

  1. 启用Chrome的无障碍:
  • 开放系统设置
  • 转到隐私和安全 > 无障碍
  • 单击“+”按钮
  • 从您的应用程序文件夹中添加 Google Chrome
  • 打开Chrome的相机

AppleScript与Chrome标签互动需要此无障碍设置.

□ 对于开发者

以下各节为想开发或修改该工具的人.

· 先决条件

  • 节点.js 18+
  • macOS(用于 AppleScript 操作)
  • Google Chrome (英语).
  • Claude桌面(从[T1]安装)
  • tsx(通过[[T2]安装)
  • 安装

□ 可用的工具

本页由 AI 翻译,技术细节请以原文为准。

README

MCP Browser Tabs

Model Context Protocol server for retrieving and managing Chrome browser tabs information. This allows Claude Desktop (or any MCP client) to fetch information about and control currently open Chrome tabs.

Quick Start (For Users)

To use this tool with Claude Desktop, simply add the following to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):

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

This will automatically download and run the latest version of the tool when needed.

Required Setup

  1. Enable Accessibility for Chrome:
    • Open System Settings
    • Go to Privacy & Security > Accessibility
    • Click the “+” button
    • Add Google Chrome from your Applications folder
    • Turn ON the toggle for Chrome

This accessibility setting is required for AppleScript to interact with Chrome tabs.

For Developers

The following sections are for those who want to develop or modify the tool.

Prerequisites

  • Node.js 18+
  • macOS (for AppleScript operations)
  • Google Chrome
  • Claude Desktop (install from https://claude.ai/desktop)
  • tsx (install via npm install -g tsx)

Installation

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

Available Tools

  • get_tabs: Retrieves all open tabs from Google Chrome browser, returning their titles and URLs. Tabs are grouped by window and displayed in a format like “Window 1-1” (Window 1, Tab 1).

  • close_tab: Closes a specific tab in Google Chrome using window and tab indices.

    • Parameters:
      • windowIndex: Window number (starts from 1)
      • tabIndex: Tab number within the window (starts from 1)
    • Note: When closing multiple tabs, start from the highest index numbers to avoid index shifting. After closing tabs, use get_tabs to confirm the changes.

Notes

  • This tool is designed for macOS only due to its dependency on AppleScript.
  • Requires Google Chrome to be installed and running.
  • Accessibility permissions must be granted for Chrome.

License

MIT License - see the LICENSE file for details

在 GitHub 查看完整 README

安装

npx -y @kazuph/mcp-browser-tabs
新手?先看 mcpskill.org 教程 →