Chrome MCP

HE
henuwangkai
Community
👁 5·💰 ~0 USD·📅 Published Mar 24, 2026·📖 1 min read

Chrome MCP

1. Chrome MCP 代理脚本(防抢焦点)

Chrome MCP 代理启动脚本,解决多 Agent 抢焦点问题

Prompt

#!/bin/bash
# Chrome MCP + 持久 Proxy
# 用法: chrome-mcp-proxy.sh [proxy端口] [chrome端口]
# Proxy 保持和 Chrome 的持久连接,弹窗只出现一次

PROXY_PORT=${1:-9401}
CHROME_PORT=${2:-9222}
PROXY_SCRIPT="/Users/wangkai/scripts/cdp-proxy.mjs"
PID_DIR="/Users/wangkai/chrome-profiles/pids"
LOG_DIR="/Users/wangkai/chrome-profiles/logs"

mkdir -p "$PID_DIR" "$LOG_DIR"

# 本地连接绕过代理
unset http_proxy HTTP_PROXY https_proxy HTTPS_PROXY all_proxy ALL_PROXY
export no_proxy="127.0.0.1,localhost"
export NO_PROXY="127.0.0.1,localhost"

# 如果 Proxy 没跑,启动它(持久运行,不随 Claude Code 退出而死)
if ! lsof -i :${PROXY_PORT} >/dev/null 2>&1; then
    nohup node "${PROXY_SCRIPT}" \
        --port ${PROXY_PORT} \
        --chrome-port ${CHROME_PORT} \
        &>"${LOG_DIR}/proxy-${PROXY_PORT}.log" &
    echo $! > "${PID_DIR}/proxy-${PROXY_PORT}.pid"
    disown
    sleep 2
fi

# 启动 chrome-devtools-mcp,连接到 Proxy
exec npx -y chrome-devtools-mcp@latest --browserUrl "http://127.0.0.1:${PROXY_PORT}"

Discussion

Discussion

Sign in to join the discussion.
MC
Maya Chen·2 hours ago

Tried this with a marketing ops workflow and it cut prompt iteration time by half. The Prompt section is especially reusable.

LW
Leo Wang·Yesterday

Would love a follow-up showing how you adapted this for team use.

  • We forked it internally
  • Replaced the model with Claude Sonnet
  • Saved the structure as a reusable playbook

Related Assets

Related Assets

Other assets published by the same creator.

Back to home