feat(browser_mcp): perceive nativo Go, datos de iframe, click XY y screenshot como imagen (v0.6.0)
Capacidades nuevas y cambios (40 -> 42 tools): - page_perceive ahora se genera de forma NATIVA en Go sobre la conexion CDP viva del pool (cdp_get_ax_outline_go_browser). Elimina el subprocess `fn run cdp_perceive_outline` (Python), el venv y la dependencia del binario `fn` en runtime (se borra resolveRoot/exec.Command). Respeta tab_select. - page_perceive acepta frame_id para percibir DENTRO de un iframe. El campo tab_id queda obsoleto (se ignora; usar tab_select) pero se conserva por compatibilidad. - frame_get_text (nueva, lectura): innerText de un iframe via cdp_get_text_in_frame_go_browser. Activa tambien bajo --read-only. - dom_click_xy (nueva, MUTA): click humanizado por coordenadas absolutas via cdp_click_xy_human_go_browser, con mode human/fast/instant y auto-observe. Fallback para actuar sobre lo que el LLM ve en page_screenshot. - page_screenshot devuelve la imagen como image content (cdp_screenshot_bytes_go_browser + mcp.NewToolResultImage) para que el LLM vea los pixeles; path pasa a ser opcional (si se da, ademas guarda a disco). - Auto-observe de las tools *_ref sube su truncado de 4000 a 8000 chars. - Fix de seguridad documental: todas las descripciones del parametro port que decian "Default 9222" (navegador diario del usuario) corregidas a "Default 9333" (Chrome aislado del MCP). El codigo ya usaba 9333; la doc era falsa y podia inducir al modelo a tocar pestanas de banca/correo. uses_functions del app.md: +cdp_get_ax_outline, +cdp_get_text_in_frame, +cdp_screenshot_bytes; -cdp_perceive_outline_py_pipelines. Verificacion: go build OK, go test OK (4 unit pass, 3 e2e skip gated BMCP_E2E=1), go vet OK, gofmt limpio, sin "Default 9222" en el codigo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -30,7 +30,7 @@ type cookieGetArgs struct {
|
||||
func cookieGetTool() mcp.Tool {
|
||||
return mcp.NewTool("cookie_get",
|
||||
mcp.WithDescription("Return all browser cookies (Network.getAllCookies) as JSON."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ type cookieSetArgs struct {
|
||||
func cookieSetTool() mcp.Tool {
|
||||
return mcp.NewTool("cookie_set",
|
||||
mcp.WithDescription("Set a cookie via Network.setCookie."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
mcp.WithString("name", mcp.Required(), mcp.Description("Cookie name.")),
|
||||
mcp.WithString("value", mcp.Description("Cookie value.")),
|
||||
mcp.WithString("domain", mcp.Required(), mcp.Description("Cookie domain.")),
|
||||
@@ -102,7 +102,7 @@ type cookieDeleteArgs struct {
|
||||
func cookieDeleteTool() mcp.Tool {
|
||||
return mcp.NewTool("cookie_delete",
|
||||
mcp.WithDescription("Delete cookies by name (optionally scoped to a domain) via Network.deleteCookies."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
mcp.WithString("name", mcp.Required(), mcp.Description("Cookie name to delete.")),
|
||||
mcp.WithString("domain", mcp.Description("Optional domain scope.")),
|
||||
)
|
||||
@@ -130,7 +130,7 @@ type cookieClearArgs struct {
|
||||
func cookieClearTool() mcp.Tool {
|
||||
return mcp.NewTool("cookie_clear",
|
||||
mcp.WithDescription("Clear all browser cookies via Network.clearBrowserCookies."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user