
BrowserAttach
io.github.EvannZhongg由 GitHub 帳號 EvannZhongg 發布v0.33.0更新於 Nov 7, 2026
Control existing signed-in Chrome and Edge tabs through a locally paired extension.
概覽
BrowserAttach 透過本機配對的擴充功能,讓助理操控你已登入的 Chrome 或 Edge 分頁,不必另開自動化瀏覽器。
- 可以做什麼
- 探索瀏覽器設定檔與分頁,獨佔認領分頁並在完成後釋放
- 讀取無障礙樹、頁面文字、控制項狀態與元素參照,並依條件等待
- 點擊、懸停、拖曳、輸入、填寫、按鍵、捲動、選擇選項,並可批次執行輸入步驟
- 導覽、開關分頁、處理對話框、上傳檔案與截圖
- 在頁面中執行 JavaScript,並讀取主控台、網路與導覽日誌
- 藉由設定檔的登入狀態,在暫存背景分頁中讀取某個網址
- 適用情境
- 適合需要真實已登入瀏覽器狀態的任務,例如查看內部儀表板、填寫登入後的表單,或排查頁面的主控台與網路活動,而不是使用全新的無頭瀏覽器。
- 執行需求
- 需要 Node.js 22 或更新版本與 npm,以及 Chrome 或 Edge 125 或更新版本並允許載入未封裝擴充功能。執行 setup 指令,在要暴露的每個瀏覽器設定檔中載入印出的擴充功能目錄,並在 MCP 用戶端設定以 stdio 啟動此套件。本機 Hub 僅監聽回環位址,預設埠為 47831。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 BrowserAttach,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
BrowserAttach
English · 简体中文
[M8ven Score] [BrowserAttach MCP server – quality and maintenance score on Glama] [BrowserAttach on Agensi] [BrowserAttach MCP on mcprush]
Drive the Chrome / Edge tabs you already have open and already signed in from an MCP client. BrowserAttach connects to the browser through a locally paired extension, keeps your existing sign-in state, and needs neither a remote debugging port nor a separate automation browser.
npm · Usage guide · Architecture · Agent integration · Test report · Issues · Contributing
What it does
- Discover multiple browser profiles, pick one precisely, claim a tab exclusively, and release it when done.
- Control existing ordinary
file://tabs after enabling BrowserAttach's Allow access to file URLs setting in the browser's extension details; use the same discovery, claim, observation and input tools. - Read the accessibility tree, query names/values/nearby field context, inspect field values and supported editor models; click, fill and type through refs or strict CSS/XPath, HTML label, placeholder and AX role/name locators. Type can also target the currently focused field explicitly.
- Native pointer hover, stepped drags and conditional waits; select HTML options without opening a native popup.
- Navigate and go back/forward, open or close tabs, handle JavaScript dialogs, upload local files, and capture the whole page or a single element.
- Evaluate JavaScript expressions in the main page; read console, page-error, network and navigation logs captured after claiming, with bounded available stacks and request initiators; opt in to bounded, redacted request/response details when XHR/fetch needs verification.
- Read one HTTP(S) URL in a temporary background tab with the profile's sign-in, returning rendered text, current DOM, or complete JSON with the main-document HTTP status when observed.
- Standard stdio MCP with 24 tools. The Hub listens on loopback only and pairs with the extension through a random key.
Requirements
- Node.js 22 or newer, plus npm.
- Chrome / Edge 125 or newer with permission to load unpacked extensions. Latest stable is recommended.
- An MCP client that speaks stdio MCP and can find Node/npm on
PATH.
Quick start
1. Install and pair
setup prints a stable extension directory and starts the local Hub. The directory is usually:
- Windows:
%USERPROFILE%\.browser-attach\extension - macOS / Linux:
~/.local/share/browser-attach/extension
Open chrome://extensions or edge://extensions, enable developer mode, choose "Load unpacked" and load that directory. Load it once for every browser profile you want to expose; the extension options page lets you set a recognizable profile name.
Or without a global install:
2. Configure the MCP client
Merge the following into your client's MCP configuration, or see mcp-config.json:
On Windows clients that require a full command extension, use npx.cmd. With a global install you can also configure "command": "browser-attach", "args": ["mcp"]. Restart the MCP client to discover the tools.
@latest selects the package at launch; upgrading an existing pair is coordinated at startup. The first extension load, and pairs still on an older protocol, need one manual extension reload — see local data and upgrades.
Host entry points are collected in agent integration, and the connection parameters, JSON/TOML examples and verification steps are in the setup reference; other clients use the stdio entry above.
The npm package includes an optional browser-attach skill with setup, recovery and cross-site recipes. Copy the whole skills/browser-attach directory to your host's skill location if desired; npm installation does not register it with the host.
3. Start driving
browser_discover(kind="browsers")→browser_discover(kind="tabs")to confirm the browser, tab title and URL.browser_claim_tabwith thetab_idfromdiscover(kind="tabs")(optionalexpected_url/expected_titleexact guards) to take control and receive this connection'stab_handle.browser_snapshotto get elementrefs, then click, fill or run other actions.- Observe when the next decision needs new state, and finish with
browser_tab_control(action="release"). Usesnapshot(diff_since="latest")or actionobserve:{diff_since:"latest"}for page changes; inspectmode/reset_reasonand finish pagination. A full-page refresh is not required after every action.
When titles change often, omit expected_title and check the identity returned by claim instead. Elements may be addressed by ref or by a selector re-resolved on every call; design trade-offs: architecture notes.
Claiming and ordinary input never activate a tab or window; call browser_tab_control(action="activate") explicitly when foreground rendering is needed. When an outcome is unknown, observe again first and avoid duplicate submissions. Full parameters, pagination, uploads and input semantics: usage guide.
Tools
Local data and upgrades
Override it explicitly with the absolute path BROWSER_ATTACH_HOME. The Windows default avoids AppData, which packaged hosts may virtualize; no other host's private cache is searched or merged automatically. The directory holds the pairing configuration, Hub logs and the stable extension copy, and depends on neither the clone location, the client working directory nor the npm cache. If you already use a custom directory, keep using the same environment variable or --config instead of accidentally creating a second pairing under the new default.
A host assembly step that writes the client entry pins the absolute paths of the current Node, CLI and the actual pairing file and sets BROWSER_ATTACH_HOME; it works together with a custom --config. When the MCP launches the Hub it passes the same absolute pairing path and directory, so different launch environments cannot derive a second configuration. See agent integration.
To upgrade, install again with the command from step 1 and reconnect the MCP client. With @latest and a pair on 0.17 or newer the restart is enough; a pair still on an older protocol needs browser-attach stop, a restart and one manual extension reload. Custom pairing paths, ports and extension directories are retained, closed browser profiles update when they next connect, and an older MCP package cannot downgrade a newer Hub or installed extension.
An upgrade waits for extension cleanup and confirms the new version after reload; cleanup or reload failures are reported instead of replaying page actions. Manual reload remains available on the extension options page for recovery, and Hub and extension versions must match for page control. The default port is 47831; choose another port with setup --port when creating a pairing.
Architecture and boundaries
Each MCP connection holds its own control and handles cannot be used across connections. Disconnecting or stopping debugging releases control. The client endpoint requires a Bearer key and rejects web page Origins; the extension verifies a fixed Origin, key and version. browser_evaluate can read and write data with the page's existing sign-in state; a timeout or error may already have had an effect and must not be replayed automatically. No generic CDP tool is exposed.
Logs are collected from claim time, survive navigation and are cleared on release, with bounded buffers that report data_loss on eviction. Buffered reads use the existing claim without requiring a supported or responsive current page; capture changes still require page access. Network logs store lifecycle metadata and available initiators by default; an explicit capture reads bounded, redacted headers/bodies of subsequent XHR/fetch requests without changing caches or intercepting traffic. Navigation requests and commits remain separate observations. Buffer limits and parameters: usage guide.
The extension holds debugger permission and client actions can use existing site sign-in state; only connect clients you trust. Web page content must not be treated as user authorization. The pairing key and the generated config.generated.js must not be committed or published; the packaging check rejects packages that contain that file.
Chrome / Edge HTTP(S) pages and existing ordinary file:// tabs with extension file access enabled are supported, and file access is checked during discovery, claim, operations and navigation. open_tab and fetch still accept HTTP(S) only. Browser internal pages, arbitrary extension pages, download management, network interception and Firefox / WebKit remain outside scope, and built-in PDF viewer content is browser-dependent. Native pointer input requires an unsuspended tab in a non-minimized window; an unmodified left single click may target an inactive tab, while hover, drag and other click variants require an active tab. Full limits and failure modes: usage guide.
Local development
Run the source directly and pair the extension in the repository:
Development mode deliberately uses the repository extension path. For normal installs, use setup without --extension-dir so it keeps working after the repository moves.
Real-browser tests need a Chromium / Edge executable that allows loading extensions from the command line; the path is supplied by the developer:
These tests use temporary profiles and local fixtures. Coverage and limits: test report; implementation and design trade-offs: architecture.
Contributing
Reproducible issues via Issues, or Pull Requests. Please include Node, OS, browser and extension versions, and remove pairing keys and private page data. See CONTRIBUTING.md for the process.
Released under the MIT License.
來源:README.md,提交 5e818db
工具
0版本歷史
6- v0.33.0最新Oct 31, 2026
- v0.32.1Oct 29, 2026
- v0.24.1Oct 26, 2026
- v0.24.0Oct 26, 2026
- v0.23.5Oct 25, 2026
- v0.23.4Oct 25, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分