Grok Bridge banner
ythx-101 ythx-101

Grok Bridge

AI community

Description

πŸŒ‰ Turn SuperGrok into a REST API β€” Safari browser automation bridge for AI agents

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

πŸŒ‰ grok-bridge v3.1.1

Turn **SuperGrok** into a REST API + CLI tool. No API key needed.

`v3.1.1` is the publishable release candidate that supersedes the `v3.1.0` release-candidate attempt. It keeps the stable v3 loopback/dedicated-tab boundary and highlights the grok.com Chinese UI submit-button fix.

How it works

Your Terminal/Script β†’ Safari JS injection β†’ grok.com β†’ Response extracted via DOM

Two modes:

REST API (recommended)

# Check local Safari/Grok setup first
python3 scripts/grok_bridge.py --doctor

# Start the server on your Mac
python3 scripts/grok_bridge.py --bind 127.0.0.1 --port 19998

# Default mode uses a dedicated background Safari tab named grok-bridge-agent.
# Use --shared-tab only when you intentionally want to drive the current Safari tab.

# Query from the Mac itself
curl -X POST http://127.0.0.1:19998/chat \
  -H "Content-Type: application/json" \
  -d '{"prompt":"What is the mass of the sun?","timeout":60}'

# Health check
curl http://127.0.0.1:19998/health

# Read current conversation
curl http://127.0.0.1:19998/history

Use `--doctor --json` when another tool or agent needs structured setup diagnostics.

Deployment boundary

Stable local deployment listens on `127.0.0.1:19998`. This is intentional: the bridge drives the signed-in Safari session on the Mac, so it should not be exposed directly on LAN, Tailscale, or a public interface.

Remote Claw/agent access should use an operator-controlled tunnel or proxy:

# From the remote agent host:
ssh -N -L 19998:127.0.0.1:19998 user@your-mac

# Then call the tunnel-local endpoint:
curl -X POST http://127.0.0.1:19998/chat \
  -H "Content-Type: application/json" \
  -d '{"prompt":"hello","timeout":60}'

If a deployment must listen beyond loopback, start it explicitly with `--bind ` and put host firewall / network ACLs in front of it. Do not use `0.0.0.0` as the stable default.

CLI (legacy)

# Local
bash scripts/grok_ch