Skip to main content
Glama
grok-browser-mcp
by v76ADrR

grok-browser-mcp

MCP server that attaches to your already-running Brave over Chrome DevTools Protocol (CDP). Grok CLI can then snapshot, click, type, and screenshot whatever tab you have open — same window, same logins.

It does not launch a fresh empty browser.

Requirements

  • Linux (Brave flags file ~/.config/brave-flags.conf)

  • Brave

  • Node.js 18+

  • Grok CLI

Related MCP server: Browser Navigator MCP

Install

git clone https://github.com/v76ADrR/grok-browser-mcp.git
cd grok-browser-mcp
npm install

Enable CDP on Brave (once)

The Arch/CachyOS Brave wrapper reads ~/.config/brave-flags.conf. Put:

--remote-debugging-port=9222
--remote-debugging-address=127.0.0.1
--remote-allow-origins=*

Restart Brave. Tabs usually restore. Confirm:

curl -s http://127.0.0.1:9222/json/version

Or call the MCP tool browser_prepare (this restarts Brave).

CDP is localhost only. Any process on this machine can control the browser while those flags are set. Remove them and restart Brave when you are done.

Grok CLI config

~/.grok/config.toml:

[mcp_servers.browser]
command = "/usr/bin/node"
args = ["/ABS/PATH/TO/grok-browser-mcp/src/server.mjs"]
enabled = true
startup_timeout_sec = 20
tool_timeout_sec = 180

Reload: /mcps then r, or a new Grok session.

Tools

Tool

Purpose

browser_status

Brave PIDs + CDP health

browser_prepare

Write flags; restart Brave if CDP is down

browser_tabs

List / focus tabs

browser_snapshot

Clickable elements + refs

browser_find

Filter snapshot by text

browser_click

Click by ref / selector / text

browser_type / browser_press

Keyboard

browser_evaluate

JS in the page

browser_screenshot

JPEG of the current tab

browser_navigate / browser_scroll / browser_wait

Navigation

Never call Playwright browser.close() on this connection — it would quit the user's Brave.

License

MIT

Available Tools

14 tools
browser_clickB

Click an element. Prefer ref from the latest browser_snapshot / browser_find. Falls back to CSS selector or visible text.

Inputs: ref, text, exact, selector.

browser_desktop_screenshotA

Screenshot the GNOME desktop (Brave window as the user sees it), even if CDP is down. Uses org.gnome.Shell.Screenshot.

Inputs: no named parameters.

browser_evaluateC

Run JavaScript in the current tab (page.evaluate). Return value is JSON-stringified. Use for iCloud DOM inspection.

Inputs: expression (required).

browser_findA

Find visible clickable elements whose text contains query. Returns refs for browser_click.

Inputs: query (required).

browser_navigateC

Navigate the current tab to a URL.

Inputs: url (required).

browser_prepareA

Write Brave CDP flags and optionally restart Brave so Playwright can attach. Restarts the user's Brave (tabs usually restore). Use restart=true when CDP is down.

Inputs: restart.

browser_pressB

Press a key (Playwright key name), e.g. Enter, Tab, Escape, Control+a, ArrowDown.

Inputs: key (required).

browser_screenshotB

JPEG screenshot of the current tab. Returns an image plus a saved file path.

Inputs: fullPage.

browser_scrollC

Scroll the current tab with a mouse wheel delta.

Inputs: dx, dy.

browser_snapshotA

Accessibility / clickable-element snapshot of the current tab, with refs (e1, e2, …) for browser_click. Filter with query for large lists (e.g. iCloud contacts).

Inputs: limit, query, offset.

browser_statusA

Check whether Brave is running and whether Chrome DevTools Protocol is reachable on 127.0.0.1:9222.

Inputs: no named parameters.

browser_tabsB

List open Brave tabs (via CDP). Optionally focus one by index, URL substring, or title substring.

Inputs: index, urlIncludes, titleIncludes.

browser_typeC

Type into a field (ref/selector) or the focused element.

Inputs: text (required), ref, clear, selector.

browser_waitC

Wait for a number of milliseconds, or until text/selector appears.

Inputs: ms, text, selector.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools have clearly distinct actions and targets, but browser_snapshot and browser_find overlap because both return clickable-element refs, and browser_status/browser_prepare both concern Brave/CDP availability. The descriptions help mitigate this, so boundaries are mostly clear.

    Naming Consistency5/5

    All tools use the browser_ prefix followed by snake_case verbs or nouns, giving a highly predictable and readable pattern. browser_desktop_screenshot is slightly longer but still consistent with the schema.

    Tool Count5/5

    With 14 tools, the set sits comfortably in the expected range for a browser automation server. Each tool maps to a recognizable action or control, and the count does not feel bloated or thin.

    Completeness4/5

    The surface covers navigation, input, scrolling, waiting, JavaScript evaluation, snapshots, screenshots, tab listing/focusing, and CDP setup. Minor gaps exist around explicit new/close tab, back/forward/reload, and file upload or select-option handling, but browser_evaluate and browser_navigate can often work around them.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers