diff --git a/chrome.bat b/chrome.bat new file mode 100644 index 0000000..d982545 --- /dev/null +++ b/chrome.bat @@ -0,0 +1,10 @@ +@echo off + +::删除端口跳转 +netsh interface portproxy delete v4tov4 listenport=9222 listenaddress=0.0.0.0 +::打开chrome的remote debugger mcp端口 +start chrome --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0 --user-data-dir=%TEMP%\chrome-opencode-profile +::端口跳转,为了使用chrome mcp +netsh interface portproxy add v4tov4 listenport=9222 listenaddress=0.0.0.0 connectport=9222 connectaddress=127.0.0.1 +::查看端口跳转是否存在 +netsh interface portproxy show v4tov4 diff --git a/config/opencode.json b/config/opencode.json index 4debba5..68e5ce9 100644 --- a/config/opencode.json +++ b/config/opencode.json @@ -60,7 +60,7 @@ "command": [ "docker", "run", "--rm", "-i", "chrome-devtools-mcp:node24-1.12.0", - "--browserUrl=http://192.168.3.95:9222" + "--browserUrl={env:CHROME_BROWSER_URL}" ], "enabled": false } diff --git a/python/docker-compose.yml b/python/docker-compose.yml index 33729f6..29490d2 100644 --- a/python/docker-compose.yml +++ b/python/docker-compose.yml @@ -5,6 +5,7 @@ environment: - TZ=Asia/Shanghai - ALIBABA_API_KEY=sk-6026a1b171b84c2985c316d063136105 + - CHROME_BROWSER_URL=${CHROME_BROWSER_URL} - HTTP_PROXY=http://host.docker.internal:${PROXY_PORT} - HTTPS_PROXY=http://host.docker.internal:${PROXY_PORT} - NO_PROXY=localhost,127.0.0.1,host.docker.internal,nexus.chaosoft.com.cn diff --git a/python/projects/hemin/startup.bat b/python/projects/hemin/startup.bat index 135b7ef..e487b08 100644 --- a/python/projects/hemin/startup.bat +++ b/python/projects/hemin/startup.bat @@ -27,13 +27,7 @@ echo. cd %PYTHON_ROOT% - -::端口跳转,为了使用chrome mcp - -netsh interface portproxy add v4tov4 listenport=9222 listenaddress=0.0.0.0 connectport=9222 connectaddress=127.0.0.1 -netsh interface portproxy show v4tov4 - echo 执行命令: !COMPOSE_CMD! run --rm opencode-python !COMPOSE_CMD! run --rm opencode-python -netsh interface portproxy delete v4tov4 listenport=9222 listenaddress=0.0.0.0 \ No newline at end of file +pause \ No newline at end of file diff --git a/yarn/projects/biz-office-rent-web/startup.bat b/yarn/projects/biz-office-rent-web/startup.bat index 794cc02..91f6f29 100644 --- a/yarn/projects/biz-office-rent-web/startup.bat +++ b/yarn/projects/biz-office-rent-web/startup.bat @@ -28,9 +28,6 @@ cd %YARN_ROOT% -::端口跳转,为了使用chrome mcp -::netsh interface portproxy add v4tov4 listenport=9222 listenaddress=0.0.0.0 connectport=9222 connectaddress=127.0.0.1 - echo 执行命令: !COMPOSE_CMD! run --rm opencode-yarn !COMPOSE_CMD! run --rm opencode-yarn