mcp-browser-tabs

MCP.Pizza Chef: kazuph

The mcp-browser-tabs client enables real-time retrieval and control of Chrome browser tabs through the Model Context Protocol. It allows MCP hosts like Claude Desktop to fetch detailed information about open tabs and manage them programmatically. This client requires accessibility permissions on Chrome to interact with tabs and supports seamless integration by running as a command-line tool, facilitating enhanced browser automation and context-aware workflows.

Use This MCP client To

Fetch list of currently open Chrome tabs for context-aware applications Programmatically switch or close Chrome tabs via MCP client commands Integrate browser tab data into AI workflows for enhanced browsing context Enable AI agents to monitor and manage user browser sessions Automate tab management tasks within desktop AI clients like Claude Desktop

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.

Browser Tabs Server MCP server

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

mcp-browser-tabs FAQ

How do I install the mcp-browser-tabs client?
Install by adding it to your Claude Desktop config or run via 'npx @kazuph/mcp-browser-tabs'.
What permissions are required to use this client?
Accessibility permissions must be enabled for Google Chrome in system settings to allow tab management.
Can this client control tabs in browsers other than Chrome?
No, it is specifically designed to interact with Google Chrome tabs only.
Does this client work with other MCP hosts besides Claude Desktop?
Yes, any MCP host that supports client integration can use mcp-browser-tabs.
Is the client cross-platform?
It primarily supports macOS due to accessibility permission requirements but may work on other platforms with similar setups.
How does the client communicate with Chrome?
It uses system accessibility APIs to retrieve and control tab information securely.
Can I use this client to automate tab switching during AI workflows?
Yes, it enables programmatic tab switching and management as part of AI-driven tasks.